THE DROP · 003 SECOND BRAIN
Claude
AI HACKS · DAY 06

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.

Manual trigger prompt
"Run the wiki-self-heal skill. Find 3 knowledge gaps in /path/to/your/wiki/, research each one using web search, and write updated wiki pages with proper front matter. Append results to wiki/log.md."

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.


Step 01

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.

Terminal
$ 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.

Step 02

Drop in your CLAUDE.md routing table.

This is the most important file. Claude reads it first on every session.

CLAUDE.md
# 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.

Step 03

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.

Page format
---
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:

Backfill prompt
"Write a Python script that reads every .md file in /path/to/wiki/, checks if it already has YAML front matter (starts with ---), and if not: extracts the title from the first # heading, extracts tags from bold items, builds a one-line summary, and prepends a front matter block with title, tags, summary, and last_updated: today. Skip index.md and log.md."
Step 04

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.md
# 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:

wiki/log.md
## [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]].
Step 05

Ingest your first source.

Drop any document into raw/. A PDF, markdown file, web clip, or transcript. Then run this prompt:

Ingest prompt
"Ingest the new source I just added to raw/. Read wiki/index.md first to find pages it affects. Create new entity or concept pages with front matter for anything new. Update existing pages, noting any contradictions. Add wikilinks. Update wiki/index.md. Append one entry to wiki/log.md. Report what you Created and Updated."

A single substantive source touches 10 to 15 pages. That's normal. It's the whole point.

Step 06 · Optional

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:

Cron · Sunday 3am
# 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.


What this actually changes

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.

Resources

Everything you need

— END —

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.

Mike
@mikemeansbusiness_ai