en un clic
wiki-brain
// Turn Claude Code into a knowledge base that compounds. Every conversation ingests into a personal wiki you browse in Obsidian. Based on Andrej Karpathy's LLM Wiki pattern, powered by Graphify.
// Turn Claude Code into a knowledge base that compounds. Every conversation ingests into a personal wiki you browse in Obsidian. Based on Andrej Karpathy's LLM Wiki pattern, powered by Graphify.
| name | wiki-brain |
| description | Turn Claude Code into a knowledge base that compounds. Every conversation ingests into a personal wiki you browse in Obsidian. Based on Andrej Karpathy's LLM Wiki pattern, powered by Graphify. |
Turn Claude Code into a system that remembers. Every conversation feeds an ever-growing personal wiki you browse in Obsidian. Claude queries a knowledge graph before reading raw files, so answers are faster, smarter, and cheaper over time.
Based on Andrej Karpathy's LLM Wiki pattern and powered by Graphify.
/wiki-brain # first run: setup wizard · after: show status menu
/wiki-brain ingest <file-or-url> # ingest a new source into the wiki
/wiki-brain query "<question>" # query the knowledge graph + wiki
/wiki-brain lint # health check the wiki
/wiki-brain rebuild # force a graphify rebuild
/wiki-brain doctor # verify install health
/recall # show last 5 sessions + read linked pages
Check for config at ~/.claude/skills/wiki-brain/config.json. If it exists with setupComplete: true, skip to Step 1 (status menu).
If no config, run the setup wizard.
Welcome to /wiki-brain!
This turns Claude Code into a knowledge base that compounds. Every
conversation you have from now on can feed a personal wiki you'll
browse in Obsidian. Claude gets smarter about YOUR stuff over time,
and answers questions faster by querying a knowledge graph instead
of re-reading files.
Setup takes about 5 minutes. Let's go.
Question 1 of 4: Do you already use Obsidian?
Obsidian is a free app for browsing markdown notes with backlinks
and graph view. Your wiki lives inside an Obsidian "vault" (just a
folder on your computer).
1. Yes — I already have Obsidian installed and a vault set up
2. No — I need to install it and create a vault
If answer is 1:
Great. What's the full path to the vault you want to use?
Example: /Users/yourname/Documents/MyVault
(Tip: in Obsidian, right-click your vault name in the sidebar and
choose "Reveal in Finder/Explorer" to see the path.)
Read the path, verify it exists and is writable. If not, ask again.
If answer is 2:
No problem. Here's how to install Obsidian and create a vault:
STEP 1 — Download Obsidian
• Go to https://obsidian.md
• Click "Download" and pick your operating system
• Open the downloaded file and install it (drag to Applications on
Mac, run the installer on Windows)
STEP 2 — Create a vault
• Open Obsidian
• Click "Create new vault"
• Name it something like "Brain" or "Wiki"
• Pick a location (Documents folder is a good default)
• Click "Create"
STEP 3 — Find the vault path
• In Obsidian, right-click your vault name in the top-left sidebar
• Click "Reveal in Finder" (Mac) or "Show in Explorer" (Windows)
• Copy the full path from the Finder/Explorer address bar
Come back here when you've done all three steps. Paste the full
path to your vault and hit Enter.
Wait for the path. Verify it exists and is a directory.
Question 2 of 4: How often should we rebuild your knowledge graph?
WHAT THIS IS:
Graphify reads all your wiki notes and builds a "map" of how
everything connects — which topics relate to which, what links
to what. When you ask Claude a question, it queries this map
first instead of opening every file one by one. This makes
Claude faster, smarter, and cheaper because it doesn't have
to re-read your notes every time.
WHY IT NEEDS REBUILDING:
Every time you finish a Claude conversation, your wiki gets
updated with new info. The map gets a little out of date.
A "rebuild" tells Graphify to re-scan your wiki and update
the map so Claude is working with current information.
IMPORTANT:
A rebuild only runs if your wiki has actually changed since
last time. If nothing's new, it skips. You never burn compute
for nothing.
PICK ONE:
1. Aggressive — every 3 days
Best if you're in Claude Code daily and want the freshest map.
2. Balanced — every 7 days ← recommended
Good for most people. Stays current week to week.
3. Manual only — no auto rebuild
You run /wiki-brain rebuild yourself. Full control, zero
background activity.
Question 3 of 4: How often should we health-check your wiki?
WHAT THIS IS:
Over time, your wiki accumulates pages. Some get out of date.
Some end up disconnected from everything (orphans). Some say
one thing on page A and the opposite on page B (contradictions).
A "lint" is Claude doing a health check on your wiki — it reads
through, looks for problems, and reports them so you can fix
or ignore them.
WHY IT MATTERS:
A wiki you don't maintain rots. Lint catches rot early. It
doesn't auto-fix anything — you stay in control.
WHAT LINT CHECKS:
• Contradictions — page A says X, page B says the opposite
• Stale claims — info that newer notes have superseded
• Orphan pages — notes nothing else links to
• Missing pages — concepts mentioned everywhere with no
dedicated page
• Broken links — [[references]] to pages that don't exist
PICK ONE:
1. Weekly — for fast-growing wikis
2. Monthly — recommended for most people
3. Manual only — you run /wiki-brain lint yourself
Question 4 of 4: Where should I add the wiki-brain instructions?
I need to add a short block of instructions to your CLAUDE.md
so Claude knows how to use your wiki. You can put these in:
1. Your GLOBAL CLAUDE.md (~/.claude/CLAUDE.md)
Wiki-brain will work in every project.
2. A specific project's CLAUDE.md
Only that project will use the wiki. Paste the path when
asked.
Pick one:
If 2, ask for the path. Verify the file exists (or offer to create it).
Run:
which graphify 2>/dev/null || python3 -c "import graphify" 2>/dev/null && echo "GRAPHIFY_OK" || echo "GRAPHIFY_MISSING"
If missing:
Installing Graphify now... (this is the tool that builds the
knowledge graph from your wiki files)
Run:
python3 -m pip install graphifyy 2>&1 | tail -3 || python3 -m pip install graphifyy --break-system-packages 2>&1 | tail -3
Verify with python3 -c "import graphify" && echo OK. If it still fails, show the error and stop — tell the user to run pip install graphifyy manually and retry /wiki-brain.
Inside the user's vault path, create:
<vault>/
├── raw/ # drop source files here
├── wiki/ # Claude-maintained pages
│ └── index.md # catalog of all wiki pages
└── log.md # chronological record
Use Bash:
VAULT="<user-provided-path>"
mkdir -p "$VAULT/raw" "$VAULT/wiki"
[ ! -f "$VAULT/wiki/index.md" ] && cat ~/.claude/skills/wiki-brain/templates/index.md > "$VAULT/wiki/index.md"
[ ! -f "$VAULT/log.md" ] && cat ~/.claude/skills/wiki-brain/templates/log.md > "$VAULT/log.md"
Show the user exactly what will be added to their CLAUDE.md BEFORE writing anything. Read ~/.claude/skills/wiki-brain/templates/claude-md-patch.md, substitute {{VAULT_PATH}} with the user's vault path, and display:
Here's what I'll add to <CLAUDE.md path>:
---
<rendered patch>
---
Want me to append this? (yes/no)
If no, stop and tell the user they can re-run /wiki-brain later.
If yes, append to the CLAUDE.md file (never overwrite). If the file already has ## Wiki-Brain or ## Context Navigation headers, warn the user and ask before appending to avoid duplicates.
Read ~/.claude/settings.json (create it as {} if missing). Add a SessionEnd hook entry that runs the wiki-brain hook script. The hook script path is ~/.claude/skills/wiki-brain/hooks/session-end.sh.
Use this JSON merge pattern (preserve any existing hooks):
{
"hooks": {
"SessionEnd": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "~/.claude/skills/wiki-brain/hooks/session-end.sh"
}
]
}
]
}
}
Make the hook script executable: chmod +x ~/.claude/skills/wiki-brain/hooks/session-end.sh.
Write ~/.claude/skills/wiki-brain/config.json:
{
"setupComplete": true,
"setupDate": "<YYYY-MM-DD>",
"vaultPath": "<user-provided-path>",
"claudeMdPath": "<path-they-picked>",
"rebuildCadenceDays": 3 | 7 | 0,
"lintCadenceDays": 7 | 30 | 0,
"lastRebuild": null,
"lastLint": null
}
0 means manual only.
Run the first Graphify build on the (empty) wiki so the output directory exists:
cd "$VAULT" && graphify . --wiki 2>&1 | tail -5 || true
It's OK if this does nothing — the wiki is empty. Just prime the directory.
All set. Here's what just happened:
✓ Obsidian vault: <path>
✓ Folders created: raw/, wiki/, log.md
✓ Graphify installed
✓ CLAUDE.md patched
✓ SessionEnd hook installed
✓ Cadence: rebuild every <N> days, lint every <N> days
WHAT TO DO NEXT:
1. Open Obsidian and point it at your vault
2. Drop any source (article, PDF, transcript) into <vault>/raw/
3. Tell Claude: "Ingest the new file in raw/"
4. Watch your wiki fill up with interlinked pages
5. Use /recall anytime to see what you've been working on
Your wiki will get richer with every conversation from now on.
Welcome to compounding knowledge.
When /wiki-brain is called with no arguments AND config exists, load the config and show:
Wiki-Brain — <vault-path>
Pages in wiki: <count>
Sources in raw/: <count>
Last rebuild: <date> (next due in N days)
Last lint: <date> (next due in N days)
Log entries: <count>
WHAT WOULD YOU LIKE TO DO?
1. Ingest a source (/wiki-brain ingest <file>)
2. Query the wiki (/wiki-brain query "<question>")
3. Health check (/wiki-brain lint)
4. Force rebuild (/wiki-brain rebuild)
5. Show recent activity (/recall)
6. Diagnose setup (/wiki-brain doctor)
7. Exit
/wiki-brain ingest <file-or-url>
<vault>/raw/<slug>-<date>.md. If it's a local file: copy it into <vault>/raw/ (never modify the original).<vault>/wiki/<topic-slug>.md if this is a new topic[[Other Page]] Obsidian syntax---\ndate: <YYYY-MM-DD>\nsources:\n - <filename>\ntags: [...]\n---<vault>/wiki/index.md — add the new page with a one-line summary.<vault>/log.md:
## [YYYY-MM-DD HH:MM] ingest | <source title>
Touched: wiki/page-a.md, wiki/page-b.md, wiki/page-c.md
Be thorough. A single source should typically touch 3–10 wiki pages. That's how the wiki compounds — don't be lazy.
/wiki-brain query "<question>"
graphify query "<question>" from the vault directory. This returns a graph-based answer.<vault>/wiki/index.md to find any directly relevant pages the graph query might have missed.[[Page Name]] links).<vault>/wiki/<topic>-analysis-<date>.md and update the index.## [YYYY-MM-DD HH:MM] query | "<question>"
Answered from: <pages>
/wiki-brain lint
A health-check pass. Claude reads the wiki and reports problems.
<vault>/wiki/index.md to get all pages.[[links]][[Target]] where Target doesn't exist<vault>/lint-reports/<YYYY-MM-DD>.md.lastLint in config./wiki-brain rebuild
Force a Graphify rebuild.
cd "$VAULT" && graphify . --wiki --update 2>&1 | tail -10
Update lastRebuild in config. Report success or failure.
/wiki-brain doctor
Verify install health. Run these checks and report pass/fail for each:
config.json exists and is valid JSONraw/, wiki/, wiki/index.md, log.md all existgraphify is importable (python3 -c "import graphify")~/.claude/settings.jsonsession-end.sh is executablerebuildCadenceDays × 2 (warn if older)log.md has at least one entry in the last 30 days (warn if not)Display results as a checklist. For any failure, show the exact fix.
/recall
tail -20 "<vault>/log.md" to get recent entries.Last 5 activities:
1. [2026-04-11 15:45] ingest | "The LLM Wiki Pattern"
Touched: [[LLM Wikis]], [[Karpathy Principles]], [[Graphify]]
2. [2026-04-10 09:12] query | "how do we ingest conversations?"
Answered from: [[LLM Wikis]], [[SessionEnd Hooks]]
...
When the user ends a Claude Code session and this skill is active, Claude must:
<vault>/log.md in the format:
## [YYYY-MM-DD HH:MM] session | <3-8 word session title>
Touched: <comma-separated wiki pages OR "none">
/wiki-brain ingest — cross-link, update the index, be thorough.This is instructed in the CLAUDE.md patch. The SessionEnd hook runs AFTER this and handles Graphify rebuild cadence checks.
raw/. Sources are immutable.wiki/ entirely. The user doesn't edit it (except for the occasional correction).wiki/index.md when creating or renaming a page.log.md on ingest, query, lint, rebuild, and session end.[[Page Name]] Obsidian syntax. A page with no links is a dead-end.> Contradicts: <older claim, source> and let the user decide.config.json is gitignored. The vault is the user's private space — never commit it or send it anywhere.Built by @tenfoldmarc. Follow for daily AI automation builds — real systems, not theory.