# Review Notes Like Code With Pull Requests

> Let AI write to your notes only through a pull request. Set up the repo, the folder rule, the marked block and branch protection, then review each diff.

Updated 20 Nov 2026 by Atharva Shah. Canonical page: https://brainfeed.atharvashah.com/blog/review-notes-like-code-pull-requests/

## The Short Version

- Put the notes folder under git and push it to a private GitHub repo.
- Turn on Require a pull request before merging, so nothing skips your review.
- Give the AI one folder, and allow edits to your files only inside a marked block.
- Give every AI note a source, link, dates and a relation field in its frontmatter.
- Review each pull request in three passes: file list, edits to your files, then new notes.

An agent quotes a note back to you, and the claim is one you never wrote. Use pull requests for a knowledge base the way developers use them for code. A pull request lists every change an AI wants to make, line by line, before anything lands. You merge it or close it.

You let an AI tool tidy your notes a month ago, and nothing told you the note had changed. Closing a pull request leaves your notes as they were. Protect your main notes, give the AI one folder, and read each change before it lands.

The setup works for Claude Code, Codex, a scheduled job or any tool that can propose changes on GitHub.

## An AI That Edits in Place Can Rewrite Months of Notes in One Run

Your notes hold claims you checked. An AI tool that edits them in place can change those claims without asking.

The damage is quiet. You do not reread old notes every day. You find the change weeks later, when an agent quotes the edited note back to you as if you wrote it.

Builders who run agents over their vaults reach the same rule. Greg Isenberg's list of [Obsidian and Claude Code habits](https://x.com/i/status/2026036464287412412) includes this one: "human writes the vault. agents read it, suggest, execute." Another X account describes a vault loop where [Claude never writes straight to the live vault](https://x.com/i/status/2094692986760180130) and a review step checks every change first.

A pull request is that review step. Developers already use it for the same reason: code that runs your business deserves a second look before it merges.

## Step 1 Puts the Notes Under Git

Git records every version of every file. That alone makes an AI edit reversible.

1. Install [GitHub Desktop](https://docs.github.com/en/desktop), a free app with buttons instead of commands.
2. Add your notes folder as a repository and save a first version, called a commit.
3. Publish it to GitHub as a private repo.

An Obsidian vault is a folder of Markdown files, so this works without any plugin. Obsidian keeps reading the same files. The guide to [keeping a second brain in a GitHub repo](https://brainfeed.atharvashah.com/blog/second-brain-in-github-repo/) covers the setup in more detail.

## Step 2 Protects the Main Branch

A pull request only protects you if nothing can skip it. GitHub's [branch protection rules](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches) enforce that on the server.

1. Open the repo on GitHub, then Settings, then Branches.
2. Add a rule for the main branch, which holds your live notes.
3. Turn on "Require a pull request before merging".

The rule holds even when an agent holds a token with write access. It can save to its own side copy, called a branch. It cannot change your main notes. Only you merge.

## Step 3 Gives the AI One Folder of Its Own

Split the repo into two zones. You own every file you wrote. The AI owns one folder.

| Zone | Who writes there | How you review it |
|---|---|---|
| Your notes | You, by hand | You already trust them |
| The AI folder, such as one named brainfeed or ai | The AI, through pull requests | Skim the titles, open the ones that matter |
| A marked block at the end of your note | The AI, through pull requests | Read every line |

The folder rule keeps most AI output away from your writing. A new idea becomes a new file in the AI folder. It links to your note, and your note stays untouched.

### Edits to Your Own Files Go Inside a Marked Block

Sometimes an idea belongs in a note you wrote. Then the AI may add to it, but only inside a block it marks.

- A hidden start marker and end marker sit at the very end of your note.
- Between them sits one line per idea, with its source and date.
- Nothing above the start marker changes.

So a review of that file means reading the few lines between two markers.

Brainfeed follows exactly this rule. New notes go only under its own folder. A file you wrote changes only inside a marked block at its end, and the pull request lists every such change.

## Step 4 Makes Every AI Note Carry Its Source

A note you cannot trace is a note you cannot check. Give every AI-written note the same short label block at the top, called frontmatter. It holds six facts:

- the newsletter it came from
- the issue title
- a link to the issue
- the date the issue went out
- the date you accepted the idea
- the relation: new, builds on a note, or conflicts with one

Under the label block sit a title, the idea in one sentence, a line on why it matters, and a link to the related note. That link opens your note in Obsidian. The [frontmatter guide](https://brainfeed.atharvashah.com/blog/markdown-frontmatter-for-ai-agents/) explains each field.

**Example.** This is demo content, not a logged run. The input was one idea from an issue: test agents against a fake Slack. Your repo held a note called "agent-testing", so the card read "builds on agent-testing". You accepted it. The pull request then added one new note, "Test agents against a fake Slack", and left your note unchanged.

## Pull Requests for a Knowledge Base Need a Rule for Each Kind of Change

Decide your move from the file list before you read a single note. Five kinds of change cover almost every notes pull request, and three of them end the review on sight.

| What the file list shows | What it means | Your move |
|---|---|---|
| A new file in the AI folder | A new idea note | Skim the title and source, then keep it |
| An edit inside the marked block | New lines added to your note | Read every line |
| An edit above the marked block | The AI changed your writing | Close the pull request |
| A deleted or renamed file | The AI removed or moved your note | Close the pull request |
| An edit to the rules file | The AI changed its own rules | Close it and edit the file by hand |

Call it the close-on-sight rule. The last three rows break the folder rule, so no single note in the pull request can make up for them. Close it, write the reason in the closing comment, and fix the agent's instructions before the next run.

The rule also keeps reviews short. Most weeks, the file list shows only new files and a few marked blocks. You know in 10 seconds which ones need a careful read.

## Step 5 Reviews the Pull Request in Three Passes

A notes pull request reads faster than a code review, because most of it is new files. Read it in three passes.

1. **Read the file list.** Count the new files in the AI folder and the edited files outside it. Edited files deserve the most attention.
2. **Read every edit to a file you wrote.** Check that the change sits inside the marked block. Check the source link on each line.
3. **Skim the new notes.** Open any note whose title surprises you. Delete a file in the branch if you do not want it, or close the whole pull request.

GitHub's review screen has two features that fit notes well, per its [guide to reviewing proposed changes](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request).

- **Viewed.** Tick it on each file you finish, and the file folds away. If the agent changes that file later, GitHub clears the tick. So a second pass shows only what changed since your first.
- **Suggestion.** Fix one wrong word in a comment, instead of closing the whole pull request over it.

Keep pull requests small enough for one sitting. Brainfeed caps one pull request at 20 accepted notes, and it waits 30 seconds after your last accept so an undo still works.

Merging is the accept. Closing is the reject. Git keeps the history either way, so you can see later which day you kept each idea.

**Example.** This is demo content. Your note Agent testing ends with a marked block that held one line from October. The pull request adds a second line inside the block: "Test agents against a fake copy of the service. Source: AI Weekly 212, 20 Nov." The diff shows that one green line between the two markers. Every line above the start marker stays white, so the review takes one read.

## Rubber-Stamp Merges Defeat the Whole Setup

The common mistake comes after a few calm weeks. The titles look fine, so you merge without opening a single note. A pull request you never read gives you the same risk as an agent that edits in place. It only adds a button.

Fix it with a spot check that takes two minutes.

1. Open three new notes at random in each pull request.
2. Click the source link in each one.
3. Find the claim in the source. If one claim is missing or one link fails, close the pull request.

Three notes out of 20 will not catch every fault. They do catch a run where the source step broke, because that fault hits every note in the batch. If the spot check fails twice in a month, cut the batch size in half.

Write a reason when you close one. "Already in my notes" and "wrong topic" are the two most useful. A no with no reason teaches the agent nothing, so it brings back the same idea next week. Ask the agent, in its rules file, to read your closing comments before each run. The guide to [finding contradictions in your notes](https://brainfeed.atharvashah.com/blog/find-contradictions-in-your-notes/) covers the conflicts worth keeping when you do merge.

## The Same Rule Fits Claude Code and Codex

You can apply the rule to any agent that runs in your notes repo.

- Tell the agent in its rules file, `CLAUDE.md` or `AGENTS.md`, to work on a branch and open a pull request. The free [AGENTS.md generator](https://brainfeed.atharvashah.com/tools/agents-md-generator/) writes that rule for you.
- Keep branch protection on, so the instruction is backed by a rule the agent cannot skip.
- Give scheduled jobs access to this one repo only, limited to files and pull requests.

The instruction file shapes what the agent tries. Branch protection decides what it can do. Use both.

## The Rule Has Two Costs

Teams use the same setup on a shared repo. The [team notes repo use case](https://brainfeed.atharvashah.com/use-cases/team-shared-notes-repo/) and the [developer notes repo use case](https://brainfeed.atharvashah.com/use-cases/developer-notes-github-repo/) show the folder rule with more than one writer.

Pull requests need a git host. A local Obsidian vault with no remote cannot take one. Obsidian Sync alone does not give you a pull request either. Pushing the vault to a private GitHub repo fixes that, and it also gives you a full history of every note.

The second cost is review time. If you will not read a pull request each week, merged notes pile up unread, the same way saved links do. Write by hand instead, or keep the AI read-only.

## Get a Pull Request of Notes You Chose

Brainfeed reads newsletters, compares each idea with your notes, and shows you a card. Only the ideas you accept go into one pull request on your repo, inside its own folder.

Run the free scan of your repo at [brainfeed.atharvashah.com/#try](https://brainfeed.atharvashah.com/#try).

From there, Brainfeed turns those newsletters into a short weekly queue. You accept or reject each card, and accepted ideas arrive as one pull request you merge. The first pull request is free. Paid plans cost $9 for your first month, then $19, at [brainfeed.atharvashah.com/#join](https://brainfeed.atharvashah.com/#join).

## Questions and Answers

### Why should AI write to my notes through a pull request?

A pull request shows every changed line before it lands, and closing it leaves your notes untouched. An AI tool that edits in place can change a year of notes in one run. You find out weeks later, when an agent quotes the changed note back to you.

### Can I use pull requests with an Obsidian vault?

Yes, if the vault folder is a git repo pushed to GitHub. Obsidian reads plain Markdown files, so it does not care whether git manages them. A local vault with no remote cannot take a pull request until you push it to a host.

### How do I stop an agent from pushing straight to main?

Turn on branch protection for the main branch in GitHub and require a pull request before merging. The rule runs on GitHub's side, so it holds even when an agent has write access. Give the agent its own branch and nothing else.

### What should an AI-written note change look like?

New notes go into one folder the AI owns. Edits to your own files go inside a marked block at the end, between start and end comments. Every new note carries its source, its date and a link to the note it builds on, so you can check it.

### How long does a notes pull request review take?

Keep each pull request small enough to read in one sitting. Brainfeed caps one pull request at 20 accepted notes. Read the list of changed files first, then open any edit to a file you wrote. New files in the AI folder need less care.

### Can I review a notes pull request on my phone?

Yes. GitHub Mobile runs on Android and iOS, and it lets you read and review pull requests. A phone suits the skim of new notes in the AI folder. Leave edits to files you wrote for a laptop, where the wider view shows each changed line in full.

## Read Next

- [Markdown Frontmatter That Agents Can Use](https://brainfeed.atharvashah.com/blog/markdown-frontmatter-for-ai-agents/)
- [Connect Your Notes to an Agent Through MCP](https://brainfeed.atharvashah.com/blog/connect-notes-to-agent-mcp/)
- [The Weekly Review for a Second Brain, Step by Step](https://brainfeed.atharvashah.com/blog/second-brain-weekly-review/)
- [Use Cases for a Second Brain That Reads Newsletters](https://brainfeed.atharvashah.com/use-cases/)
- [Human-in-the-Loop Knowledge Capture: Why Accept Matters](https://brainfeed.atharvashah.com/blog/human-in-the-loop-knowledge-capture/)

## Try Brainfeed

Scan your notes free at https://brainfeed.atharvashah.com/#try. Your first pull request is free, and plans start at $9 for your first month, then $19, at https://brainfeed.atharvashah.com/#join.
