aa . aa
Lab / second-brain

Your AI forgets you every session.

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.

A brain that connects every new source to everything that came before.
The problem

The AI you work with every day has no memory.

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.

Why it compounds

Most notes are dead leaves. A brain worth having isn't.

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:

  1. Entities get extracted and linkedPeople, concepts, and decisions in the new source get pulled out and cross-referenced against every page that already mentions them.
  2. Provenance gets writtenEvery page touched by the new source gets an inline [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.
  3. Decisions chainEvery decision file has a 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.

How it works

What you do in 10 minutes.

01

Paste one prompt in Claude Code.

It creates a new repo from the GitHub template and reads the template's CLAUDE.md. That file becomes your setup wizard.

02

Answer 5 questions. Drop 3–5 real artifacts.

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/.

03

Watch the wiki get written.

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.

What's inside

Skills, rules, and seed files.

Get started

One prompt. Paste into Claude Code.

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.

FAQ

Questions you'd ask before starting.

Why not Notion / Obsidian / Reflect / Mem?
Those apps solve the human reader. Your AI still can't reach into them without a brittle API layer in between. A git repo of markdown is readable and writable by every agent you'll ever use, and outlives every one of the apps. Obsidian is a fine reader on top of this, if you want one. It isn't required.
What does "compounding" actually do in practice?
Three concrete mechanisms. First, every ingested source writes three layers of provenance into your wiki: a forward reference in the source, inline [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.
Why Claude Code as the runtime?
The AI that writes your brain should run inside the brain. Skills live in .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.
Is my data private?
Yes, by default. 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.
Can I run this without Claude Code?
SETUP-GUIDE.md covers ChatGPT, Claude Desktop, Cursor, Copilot, and manual. Same five questions, same seeded files, same ingest. About 15 minutes instead of 10.
Can I fork or contribute?
It's a GitHub template, hit "Use this template" for your own copy. MIT licensed. PRs on the template itself are welcome; open an issue first.
For AI agents

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.

Resources

Everything is public.

← back to lab agamarora.com
Copied. Paste into Claude Code.