I gave my Claude Code
a second brain.
You commented BRAIN. Here it is. The 3 systems I run, the exact CLAUDE.md routing table, the front-matter script, and the self-heal cron. All copy-paste ready.
Everyone's telling you to build a second brain. Nobody's showing you how to make Claude actually use it.
Most people build a beautiful Notion or Obsidian vault, then never touch it again. Why? Because their AI can't see it. Claude doesn't know your notes exist. You're manually copy-pasting context into every conversation, explaining the same business background over and over, watching Claude make decisions without the knowledge you've already collected.
The fix isn't a better note-taking app. It's wiring your knowledge base directly into Claude Code.
Here's the exact setup I'm running. Replicate it in under an hour.
A structured wiki Claude reads like a codebase
Stack: Obsidian + Andrej Karpathy's LLM Wiki structure.
The pattern: instead of dumping documents into folders and hoping AI finds the right one, you build a structured wiki with an index Claude reads first on every query. Named pages, cross-references, a routing table.
Claude navigates it like a codebase. Not a folder of random notes.
The key file is CLAUDE.md at the vault root. This is Claude's map. It tells Claude where everything lives, what workflow to use for each task, and what it must never touch.
A skill that finds gaps in your knowledge and fills them in
Scans your knowledge base weekly. Finds concepts mentioned multiple times without their own page. Searches the web. Writes the pages back in.
You set it up once. It runs on a cron. Your brain gets smarter while you sleep.
The part nobody talks about
A static wiki goes stale. A live knowledge graph rebuilds every time a file changes. Code, client notes, research docs, anything.
I run a nightly cron that scans every changed file across all my projects, extracts entities and relationships using Claude, and merges them into a graph. 13,473 nodes. 19,856 edges. Claude always gets current context, not a snapshot from 3 months ago.
A GRAPH_REPORT.md at the vault root gives Claude a summary of the most connected concepts before it reads anything else.
Install Obsidian. Create your vault.
Download Obsidian (free, local-first, Claude reads the file system directly). Create a vault in a folder Claude Code can see. Inside your main project directory works well.
$ mkdir -p ~/your-project/knowledge-vault/wiki $ mkdir -p ~/your-project/knowledge-vault/raw
wiki/ is where Claude writes and maintains pages. raw/ is where you drop source documents. Claude reads them but never modifies them.
Drop in your CLAUDE.md routing table.
This is the most important file. Claude reads it first on every session.
# Knowledge Vault Layout: flat. All wiki pages live in wiki/ ## Routing table | Task | Read first | |-----------------|-----------------------------------| | Answer a query | wiki/index.md | | Ingest source | this file, wiki/index.md, raw/ | | Gap-fill | wiki/index.md, wiki/log.md last 10| ## Rules - Never modify raw/ (immutable sources) - Never delete wiki pages without confirmation - Never add claims without a source in front matter - Always read wiki/index.md before answering queries
Read the full Karpathy gist for the complete schema. It covers naming conventions, page format, and the log structure.
Front-matter every page.
Without front matter, Claude reads every full file to understand what a page is about. With it, Claude scans metadata and navigates 10x faster, especially when you have hundreds of pages.
--- title: Page Title tags: [tag1, tag2] summary: "One sentence description" related: [[other-page]], [[another-page]] last_updated: 2026-04-25 ---
Got existing pages without front matter? Use this prompt to backfill all of them:
Build index.md and log.md.
index.md is the catalog. One line per page, organized by category. Claude reads this first on every query instead of scanning hundreds of files.
# Wiki Index ## Clients - [[severn-accounting]] · SEO + website, Astro 5 - [[kpmg-international]] · Global MSA deal ## Products - [[optimax-offer-v2]] · Local Lead Engine, 3-tier - [[roofer-sms-campaign]] · 34-contact blast, 4 leads
log.md is append-only. Every ingest, query, or gap-fill adds one entry:
## [2026-04-25] ingest | Karpathy LLM Wiki Gist
Read raw/2026-04-25-karpathy-llm-wiki.md.
Created [[llm-wiki-pattern]], [[obsidian-setup]].
Updated [[claude-code]] with wikilink to
[[llm-wiki-pattern]].
Ingest your first source.
Drop any document into raw/. A PDF, markdown file, web clip, or transcript. Then run this prompt:
A single substantive source touches 10 to 15 pages. That's normal. It's the whole point.
Set up the weekly self-heal.
If you're running Claude Code on a server, schedule the gap-filling process. Add this to your crontab:
# Runs every Sunday at 3am
0 3 * * 0 claude --dangerously-skip-permissions \
-p "Scan wiki/index.md for concepts mentioned 2+
times without their own page. Research the top
5 gaps using web search. Write wiki pages with
proper front matter. Append to wiki/log.md." \
>> /var/log/wiki-heal.log 2>&1
Your brain gets smarter every Sunday while you sleep.
Claude starts knowing your business. Not just your code.
Before this setup: Claude started every conversation from scratch. I spent the first few messages re-explaining context that already lived in my notes.
After: Claude reads CLAUDE.md at session start, checks the knowledge graph summary, navigates the wiki index when it needs depth, and makes decisions based on what I've already documented.
Your second brain finally pays for itself.
Everything you need
-
Karpathy LLM Wiki gist
The file structure this is built on. -
Obsidian
Free, local-first, Claude reads the file system directly. -
Claude Code
The CLI that powers all of this. -
Claude Code docs
CLAUDE.md reference and project setup guide.
That's the drop.
Small ask: reply with which system you're building first. I read every one.
If this saved you from another rebuild, share the reel. That's how the next person finds it.
@mikemeansbusiness_ai