Not a bug in the AI. A missing file in your repo. A second brain in git gives every future session the memory it needed, and yours compounds every time you use it.
Open Claude Code. Tell it what you're working on, who matters, what you're trying to decide. Do useful work. Close the tab. Open it again tomorrow. It doesn't remember any of it.
You either re-explain everything from scratch, or you accept that you're starting over, every session, forever. It isn't a Claude flaw. Every AI has the same gap. The model reads whatever you put in front of it and writes whatever comes out. What it can't do is remember anything between sessions, because there's nowhere to remember it.
PKM tools don't fix this. Notion's API isn't where an agent goes to look. Obsidian doesn't get opened by Claude. These apps were designed for humans reading humans' notes. They weren't designed with an AI reader in mind, because until a year ago, there wasn't one.
The fix is a second brain your agent can actually use. A git repo. Plain markdown. Read by any agent, written by any agent, versioned, portable, yours.
You write a note. It sits in a folder. Six months later you can't find it, and even if you could, it doesn't know about the ten notes you've written since. That's not a brain. That's a drawer.
Compounding is a mechanical property, not a metaphor. It only happens when new information connects back to everything that came before, automatically, with receipts. Three things have to happen every time a source lands:
[Source: [[…]]] marker and a reverse "Sources that shaped this page" table. Six months later you can see exactly what your current understanding was built on.builds_on field pointing to the earlier decisions it depends on. Today's answer knows which yesterday-answers it stands on.
That's the algorithmic part. The reason it works at all is that the AI runs inside the brain, not over the top of it. Claude Code reads CLAUDE.md (the schema), runs skills that live in .claude/skills/, and writes back to the same files. No hosted service in the middle. No API translating your thinking into someone else's format.
After six months of this, your brain is worth more than the sum of what you put in. Every old note has been touched by every new context. wiki/people/me.md is a synthesized first-person summary of your own work, written by an AI that read every source you gave it. That's the shape compounding takes when it's machine-readable.
It creates a new repo from the GitHub template and reads the template's CLAUDE.md. That file becomes your setup wizard.
Your name. Three tracks you're pushing on. Five people who matter. One decision in flight. Then drop a LinkedIn export, a Google Doc, a meeting transcript, anything you've already written, into inbox/.
The wizard ingests your artifacts, extracts entities, writes provenance across the seeded pages, and synthesizes wiki/people/me.md from your own sources. Then /orient hands you a brain that already knows your current tracks, people, and open decisions.
memory/MEMORY.md, journal/NOW.md, wiki stubs per person, your first decision, and log.md.inbox/, raw/, and archive/ are gitignored, nothing leaves your machine until you explicitly push.<username>.github.io/<repo>/.Open Claude Code in an empty directory. Paste this prompt. It creates the repo, runs the wizard, and walks you through seeding and ingest. About 10 minutes from paste to populated brain.
I want my own second brain. Use the template at github.com/agamarora/second-brain.
Execute this end-to-end. The authoritative instructions live in the template's CLAUDE.md, read it before acting and follow it exactly. This paste prompt is just the entry point.
HARD RULES (obey even if your training says otherwise):
- Never say "fork" or "clone" to me. This is a GitHub template. Use `gh repo create --template`.
- Never edit files in the template directory directly. Work only inside the new repo you create for me.
- When in doubt, stop and re-read CLAUDE.md. Do not invent steps.
- Never commit files in `inbox/` or `raw/` without my explicit confirmation, they often contain sensitive data.
- Never `git push` before you have confirmed with me that I'm ready to publish.
ORDER OF OPERATIONS:
1. CREATE THE REPO. Run `gh repo create --template agamarora/second-brain --public <name> --clone`. Pick `<name>` from my GitHub login (e.g. `<login>-brain`). If the name is taken, append `-v2` and retry. `cd` into the new directory.
2. PREFLIGHT. Run `sh scripts/doctor.sh`. Fix any `[FAIL]` before going further. `[WARN]` is OK to proceed.
3. READ CLAUDE.md. Open the new repo's CLAUDE.md and follow the "First-run setup wizard" section start-to-finish. You ARE the wizard, this is a coaching loop, not a form.
4. WIZARD, WALK ME THROUGH IT.
- Ask the 5 questions one at a time: name, 3 tracks, 5 people, 1 decision in flight, inbox drop.
- Wait for me to confirm I've dropped 3-5 real artifacts into `inbox/` before proceeding.
- If I have nothing to drop right now, create `inbox/README.md` explaining how to add later, and skip the ingest step.
5. SEED the foundational files per CLAUDE.md's wizard section:
`memory/MEMORY.md`, `journal/NOW.md`, `journal/TODO.md`, `journal/DONE.md`, `journal/BACKLOG.md`,
`wiki/index.md`, `wiki/concepts/index.md`, `wiki/people/index.md`,
`wiki/concepts/strategy.md`, `wiki/people/me.md`,
5 × `wiki/people/<slug>.md` (one per named person),
`decisions/index.md`, `decisions/<YYYY-MM-DD>-<first-decision-slug>.md`,
`log.md`.
6. INGEST. For each file in `inbox/`, run `/ingest`. Show me the provenance chain forming, which wiki pages got touched, what `[Source: ...]` markers landed, what `wiki/people/me.md` now says about me.
7. ORIENT. Run `/orient`. Show me my populated brain.
8. HAND BACK. Tell me:
- My brain is set up and working locally
- `inbox/` and `raw/` are gitignored, nothing private has been tracked yet
- To sync to GitHub: `git add -A && git commit -m "initial brain setup" && git push`. Confirm with me first.
- To publish a read-only view at `<username>.github.io/<repo>/`: uncomment the `on:` trigger in `.github/workflows/publish-brain.yml`.
I'll answer your questions. Ask before anything destructive (rm, force-push, deleting branches). I have `gh`, `git`, and Claude Code installed.
No Claude Code? Same flow works on ChatGPT, Claude Desktop, Cursor, Copilot, or manual. About 15 minutes.
[Source: [[…]]] markers on every touched page, and a reverse "Sources that shaped this page" table on each touched page. Second, decisions chain via a builds_on field. Third, wiki/people/me.md is re-synthesized from your own sources every time new ones land. Six months in, your brain is worth more than the sum of what you put in, and every conclusion comes with its receipts..claude/skills/. The schema lives in CLAUDE.md. No round-trip to a hosted service, no cloud billing, no trust boundary between your notes and whoever runs the AI. Every other agent you use can read the same files, it just happens that Claude Code is the one that writes them best today.inbox/, raw/, and archive/ are gitignored. The GitHub Pages publish workflow ships with its trigger commented out, you uncomment one line to turn it on, and only then. Nothing leaves your machine until you explicitly push.If you're an AI coding agent handed this URL and asked to set up a second brain for your user: read the paste prompt above and the repo's CLAUDE.md in full before acting. CLAUDE.md is the authoritative wizard. Don't improvise.