← All guides

Second brain · June 28, 2026 · 3 min read

Build a second brain that maintains itself

You drop messy notes into one inbox folder. A scheduled agent files them into a clean linked wiki while you sleep. One rule keeps it from breaking.

The problem

Every note system I built by hand died the same way. Capturing is easy. Filing, linking, and tidying is a second job, and after two weeks I stopped doing it. Notes piled up, the structure rotted, and I stopped trusting the vault enough to open it.

What I built instead

My Obsidian vault is split into two folders with two different owners.

raw/ is mine. Everything I capture lands there: quick notes from my phone via Telegram, article dumps, half-formed ideas. Messy is fine. Messy is the point.

wiki/ belongs to the agent. A scheduled Claude Code agent I call the Librarian runs on my Mac mini every night at 4 AM. It reads whatever is sitting in raw/, compiles it into clean linked pages (concepts, entities, comparisons), cross-links them in both directions, updates an index and a log, then moves each ingested source into raw/processed/ so the inbox only ever shows the unprocessed queue.

I capture. The agent files. One of my vaults now has over 170 compiled wiki pages and I did not write a single one of them by hand.

The one rule

Only the Librarian writes wiki/. Me, my phone, every other agent: we only ever add files to raw/. The moment two writers touch the wiki, pages contradict each other and nobody knows which version to trust. One inbox, one compiler.

Here is a condensed version of the CLAUDE.md that sits in my vault root. Paste it into yours:

You are the Librarian for this knowledge vault.
I add raw material to raw/. You compile it into a clean, linked wiki in wiki/.

Folders:
- raw/               my inbox. Never edit or delete a source's content.
- wiki/              you own this completely. Nobody else writes here.
- wiki/concepts/     topic pages
- wiki/entities/     people, companies, tools, products
- wiki/comparisons/  side-by-side and tradeoff pages

When I add a source:
1. Read it. Tell me the 3 to 5 things in it that actually matter.
2. Create or update the relevant wiki pages and [[link]] them both ways.
3. If it contradicts an existing page, add a CONFLICT block for me to
   resolve. Never silently overwrite.
4. Update wiki/index.md (a map of every page) and append one line to
   wiki/log.md.
5. Move the fully ingested file into raw/processed/.

The one rule: you are the ONLY writer inside wiki/. If wiki/ changed and
you did not change it, stop and flag it.

Do this now

  1. Create the folders in any Obsidian vault:
mkdir -p raw/inbox wiki/concepts wiki/entities wiki/comparisons
  1. Paste the CLAUDE.md above into the vault root.
  2. Drop three messy notes into raw/, open Claude Code in the vault, and say process raw/.

Run it manually until you trust the output. Then put it on a nightly schedule and wake up to a wiki that filed itself. Once the wiki is compiling on its own, the natural next step is to ask your notes anything with a local RAG so you can query everything the Librarian has filed.

Claude Code

Turn this into a Claude skill

Paste this into Claude Code. It reads this guide and builds a skill shaped to how you work.

Read the guide at https://aiwithamirthan.com/guides/second-brain-that-maintains-itself. Then build me a Claude Code skill from it, personalized to how I actually work.

1. Fetch and read the full guide at the URL above.
2. Look at my setup so the skill fits me, not a generic template: skim my repos, my CLAUDE.md / AGENTS.md files, my existing skills, and my stack.
3. Create a new skill (a SKILL.md with a clear name, description, and steps) that lets me do what this guide teaches, adapted to my tools and goals.
4. Tell me where you saved it and how to invoke it.

If anything about my setup is unclear, ask me one or two questions first.

Want to build this yourself?

Join Claude Code Academy: courses, build alongs, and builders turning AI into real systems. And I post a new build on Instagram nearly every day.