LLM Wiki — Second Brain for Claude Code + Obsidian

Use when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/llm-wiki, including the files SKILL.md points to.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit alirezarezvani/claude-skills/engineering/llm-wiki/skills/llm-wiki#main ~/.claude/skills/llm-wiki

For one project only, change the path to .claude/skills/llm-wiki. This skill also uses index.md, log.md, init_vault.py, ingest_source.py, update_index.py, append_log.py — copying SKILL.md alone won't be enough. See the folder on GitHub.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of LLM Wiki — Second Brain for Claude Code + Obsidian

Show the full text179 lines
namedescriptioncontextversionauthorlicensetagscompatible_tools
llm-wikiUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.fork2.9.0claude-code-skillsMIT[knowledge-management, obsidian, second-brain, pkm, rag-alternative, wiki, karpathy, memex][claude-code, codex-cli, cursor, antigravity, opencode, gemini-cli]

LLM Wiki — Second Brain for Claude Code + Obsidian

Inspired by Andrej Karpathy's LLM Wiki pattern (gist). This skill turns Claude Code (or any agent CLI) into a disciplined wiki maintainer that incrementally builds and maintains a persistent, interlinked Obsidian vault as you feed it sources. The knowledge compounds — cross-references, contradictions, and synthesis are already there when you query.

Core principle

Most LLM+docs workflows are RAG: retrieve fragments at query time, synthesize from scratch, forget. The wiki is compounding: sources are read once, integrated into a persistent markdown knowledge base, and kept current. You curate and ask; the LLM reads, files, cross-references, and maintains.

Obsidian is the IDE. The LLM is the programmer. The wiki is the codebase.

When to use

  • Personal: track goals, health, psychology, journaling, self-improvement
  • Research: deep dives over weeks on a topic — papers, articles, reports, evolving thesis
  • Book companion: file chapters as you read; build a fan-wiki-style companion for characters, themes, plot threads
  • Business/team: internal wiki fed by Slack, meeting notes, calls — LLM does maintenance nobody else wants to do
  • Competitive analysis, due diligence, trip planning, course notes, hobby deep-dives

Do NOT use when: you need one-shot Q&A over a fixed document (use RAG), you don't plan to add sources over time, or you don't want Obsidian in the loop.

Architecture (three layers)

vault/
├── raw/                    # Layer 1 — IMMUTABLE source of truth
│   ├── <source files>      # Articles, papers, PDFs, images, data
│   └── assets/             # Downloaded images from clipped articles
├── wiki/                   # Layer 2 — LLM-owned knowledge base
│   ├── index.md            # Content catalog (LLM updates every ingest)
│   ├── log.md              # Append-only timeline (## [YYYY-MM-DD] <op> | <title>)
│   ├── entities/           # Person/Org/Place pages
│   ├── concepts/           # Ideas, theories, frameworks
│   ├── sources/            # One summary page per ingested source
│   ├── comparisons/        # Cross-source analysis pages
│   └── synthesis/          # High-level syntheses, theses, overviews
├── CLAUDE.md               # Schema + conventions (Claude Code)
└── AGENTS.md               # Same content, for Codex/Cursor/Antigravity
  • Layer 1 (raw/) — you own. LLM only reads; never writes.
  • Layer 2 (wiki/) — LLM owns. It creates, updates, and cross-references pages. You read it.
  • Layer 3 (CLAUDE.md / AGENTS.md) — the schema. Conventions, workflows, frontmatter rules. Co-evolved by you and the LLM.

Three core operations

  1. Ingest — LLM reads a source, discusses takeaways with you, writes a source summary, updates 10-15 relevant pages, updates index, appends to log. See references/ingest-workflow.md.
  2. Query — LLM reads index.md first, drills into relevant pages, synthesizes with citations. Good answers get filed back into the wiki so explorations compound. See references/query-workflow.md.
  3. Lint — Health check: contradictions, stale claims, orphan pages, missing cross-refs, concepts mentioned but lacking their own page, data gaps to fill with web search. See references/lint-workflow.md.

Quick start

# 1. Initialize a vault (in Obsidian's vault directory)
python scripts/init_vault.py --path ~/vaults/research --topic "LLM interpretability"

# 2. Drop a source into raw/, then ingest
/wiki-ingest ~/vaults/research/raw/anthropic-monosemanticity.pdf

# 3. Ask questions (answers can be re-filed into the wiki)
/wiki-query "how does monosemanticity compare to mechanistic interpretability?"

# 4. Periodic health check
/wiki-lint

# 5. See the timeline
/wiki-log --last 10

Slash commands (this plugin ships)

Command Purpose
/wiki-init Bootstrap a fresh vault with schema files + starter structure
/wiki-ingest <path> Read a source, discuss, update wiki, log it
/wiki-query <question> Search wiki, synthesize answer, offer to file back
/wiki-lint Run health check — contradictions, orphans, stale claims, gaps
/wiki-log Show recent log entries (uses unix tools on log.md)

Sub-agents (this plugin ships)

Agent When dispatched
wiki-ingestor Delegated ingest flow — reads source, proposes updates, applies after your approval
wiki-linter Runs the health-check workflow independently, reports findings
wiki-librarian Answers queries using index-first search, synthesizes with citations

Python tools (scripts/)

All tools are standard library only (no pip installs). Run with python scripts/<tool>.py --help.

Script Purpose
init_vault.py Create folder structure + seed CLAUDE.md, AGENTS.md, index.md, log.md
ingest_source.py Helper: extract text/frontmatter from a source file, ready for LLM review
update_index.py Regenerate index.md from wiki page frontmatter (category, date, source count)
append_log.py Append a standardized log entry ## [YYYY-MM-DD] <op> | <title>
wiki_search.py BM25 search over wiki pages (standalone fallback when index.md isn't enough)
lint_wiki.py Find orphans (no inbound links), stale pages, missing cross-refs, broken links
graph_analyzer.py Compute link graph stats — hubs, orphans, clusters, disconnected components
export_marp.py Render a wiki page (or subtree) to a Marp slide deck

Cross-tool compatibility

The vault's schema lives in CLAUDE.md (Claude Code) or AGENTS.md (Codex/Cursor/Antigravity/OpenCode). The same content works in both. This plugin ships both templates. For per-tool setup instructions see references/cross-tool-setup.md.

CLAUDE.md       → Claude Code
AGENTS.md       → Codex CLI, Cursor, Antigravity, OpenCode, Gemini CLI
.cursorrules    → legacy Cursor (pre-AGENTS.md)

The scripts are pure Python stdlib → run identically everywhere. Only the loader file changes per tool.

  • Obsidian Web Clipper — browser extension; converts web articles to markdown and drops them in raw/
  • Download images locally — Settings → Files and links → Attachment folder path = raw/assets/. Settings → Hotkeys → bind "Download attachments for current file" to Ctrl+Shift+D
  • Graph view — see hubs/orphans; essential for spotting structural problems
  • Marp plugin — Markdown-based slide decks directly from wiki pages
  • Dataview plugin — dynamic tables/lists over page frontmatter (tags, dates, source counts)
  • Git — the vault is a plain markdown repo; version it

Full setup walkthrough: references/obsidian-setup.md

Why this works (vs plain RAG)

Plain RAG LLM Wiki
Rediscover knowledge each query Knowledge accumulates
Cross-references re-computed every time Cross-references pre-written and maintained
Contradictions surface only if you ask Contradictions flagged during ingest
Exploration disappears into chat history Good answers re-filed as new pages
Scales by embeddings infrastructure Scales by markdown + index.md + optional local search

At ~100 sources / hundreds of pages, index.md + filesystem search is enough. Past that, layer in a local search tool like qmd or use scripts/wiki_search.py.

This skill is marked context: fork so other skills can chain into it:

  • para-memory-files — PARA-method memory; complementary as long-term personal memory that feeds sources into the wiki
  • obsidian-vault (mattpocock) — lightweight Obsidian note helper; this skill is the maintained-wiki layer on top
  • rag-design — when wiki outgrows ~500 pages, use rag-design to bolt on a retrieval layer
  • mcp-design — expose the wiki as an MCP tool
  • agent-communication — for multi-agent wiki maintenance (ingestor + linter + librarian)

Reference docs

  • references/wiki-schema.md — full vault layout, page frontmatter, naming conventions
  • references/page-formats.md — entity, concept, source, comparison, synthesis templates
  • references/ingest-workflow.md — the detailed ingest flow the wiki-ingestor agent follows
  • references/query-workflow.md — query patterns, citation format, re-filing answers
  • references/lint-workflow.md — health-check heuristics
  • references/obsidian-setup.md — Obsidian plugins, hotkeys, vault config
  • references/cross-tool-setup.md — per-tool setup (Codex, Cursor, Antigravity, etc.)
  • references/memex-principles.md — Bush's Memex, why the LLM changes the maintenance math

Templates (assets/)

  • CLAUDE.md.template, AGENTS.md.template, .cursorrules.template — schema loaders per tool
  • index.md.template, log.md.template — starter index and log
  • page-templates/ — entity, concept, source-summary, comparison, synthesis
  • example-vault/ — small worked example you can study or copy

Iron rule

The LLM never edits files in raw/. Ever. Sources are immutable. All LLM writes go to wiki/. If you need to correct a source, do it in raw/ yourself — then re-ingest.

1---
2name: llm-wiki
3description: Use when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
4context: fork
5version: 2.9.0
6author: claude-code-skills
7license: MIT
8tags: [knowledge-management, obsidian, second-brain, pkm, rag-alternative, wiki, karpathy, memex]
9compatible_tools: [claude-code, codex-cli, cursor, antigravity, opencode, gemini-cli]
10---
11 
12# LLM Wiki — Second Brain for Claude Code + Obsidian
13 
14Inspired by Andrej Karpathy's LLM Wiki pattern ([gist](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)). This skill turns Claude Code (or any agent CLI) into a disciplined wiki maintainer that **incrementally builds and maintains** a persistent, interlinked Obsidian vault as you feed it sources. The knowledge compounds — cross-references, contradictions, and synthesis are already there when you query.
15 
16## Core principle
17 
18Most LLM+docs workflows are **RAG**: retrieve fragments at query time, synthesize from scratch, forget. The wiki is **compounding**: sources are read once, integrated into a persistent markdown knowledge base, and kept current. You curate and ask; the LLM reads, files, cross-references, and maintains.
19 
20> Obsidian is the IDE. The LLM is the programmer. The wiki is the codebase.
21 
22## When to use
23 
24- **Personal**: track goals, health, psychology, journaling, self-improvement
25- **Research**: deep dives over weeks on a topic — papers, articles, reports, evolving thesis
26- **Book companion**: file chapters as you read; build a fan-wiki-style companion for characters, themes, plot threads
27- **Business/team**: internal wiki fed by Slack, meeting notes, calls — LLM does maintenance nobody else wants to do
28- **Competitive analysis, due diligence, trip planning, course notes, hobby deep-dives**
29 
30**Do NOT use when:** you need one-shot Q&A over a fixed document (use RAG), you don't plan to add sources over time, or you don't want Obsidian in the loop.
31 
32## Architecture (three layers)
33 
34```
35vault/
36├── raw/ # Layer 1 — IMMUTABLE source of truth
37│ ├── <source files> # Articles, papers, PDFs, images, data
38│ └── assets/ # Downloaded images from clipped articles
39├── wiki/ # Layer 2 — LLM-owned knowledge base
40│ ├── index.md # Content catalog (LLM updates every ingest)
41│ ├── log.md # Append-only timeline (## [YYYY-MM-DD] <op> | <title>)
42│ ├── entities/ # Person/Org/Place pages
43│ ├── concepts/ # Ideas, theories, frameworks
44│ ├── sources/ # One summary page per ingested source
45│ ├── comparisons/ # Cross-source analysis pages
46│ └── synthesis/ # High-level syntheses, theses, overviews
47├── CLAUDE.md # Schema + conventions (Claude Code)
48└── AGENTS.md # Same content, for Codex/Cursor/Antigravity
49```
50 
51- **Layer 1 (raw/)** — you own. LLM only reads; never writes.
52- **Layer 2 (wiki/)** — LLM owns. It creates, updates, and cross-references pages. You read it.
53- **Layer 3 (CLAUDE.md / AGENTS.md)** — the *schema*. Conventions, workflows, frontmatter rules. Co-evolved by you and the LLM.
54 
55## Three core operations
56 
571. **Ingest** — LLM reads a source, discusses takeaways with you, writes a source summary, updates 10-15 relevant pages, updates index, appends to log. See `references/ingest-workflow.md`.
582. **Query** — LLM reads `index.md` first, drills into relevant pages, synthesizes with citations. Good answers get **filed back into the wiki** so explorations compound. See `references/query-workflow.md`.
593. **Lint** — Health check: contradictions, stale claims, orphan pages, missing cross-refs, concepts mentioned but lacking their own page, data gaps to fill with web search. See `references/lint-workflow.md`.
60 
61## Quick start
62 
63```bash
64# 1. Initialize a vault (in Obsidian's vault directory)
65python scripts/init_vault.py --path ~/vaults/research --topic "LLM interpretability"
66 
67# 2. Drop a source into raw/, then ingest
68/wiki-ingest ~/vaults/research/raw/anthropic-monosemanticity.pdf
69 
70# 3. Ask questions (answers can be re-filed into the wiki)
71/wiki-query "how does monosemanticity compare to mechanistic interpretability?"
72 
73# 4. Periodic health check
74/wiki-lint
75 
76# 5. See the timeline
77/wiki-log --last 10
78```
79 
80## Slash commands (this plugin ships)
81 
82| Command | Purpose |
83|---|---|
84| `/wiki-init` | Bootstrap a fresh vault with schema files + starter structure |
85| `/wiki-ingest <path>` | Read a source, discuss, update wiki, log it |
86| `/wiki-query <question>` | Search wiki, synthesize answer, offer to file back |
87| `/wiki-lint` | Run health check — contradictions, orphans, stale claims, gaps |
88| `/wiki-log` | Show recent log entries (uses unix tools on `log.md`) |
89 
90## Sub-agents (this plugin ships)
91 
92| Agent | When dispatched |
93|---|---|
94| `wiki-ingestor` | Delegated ingest flow — reads source, proposes updates, applies after your approval |
95| `wiki-linter` | Runs the health-check workflow independently, reports findings |
96| `wiki-librarian` | Answers queries using index-first search, synthesizes with citations |
97 
98## Python tools (`scripts/`)
99 
100All tools are **standard library only** (no pip installs). Run with `python scripts/<tool>.py --help`.
101 
102| Script | Purpose |
103|---|---|
104| `init_vault.py` | Create folder structure + seed CLAUDE.md, AGENTS.md, index.md, log.md |
105| `ingest_source.py` | Helper: extract text/frontmatter from a source file, ready for LLM review |
106| `update_index.py` | Regenerate `index.md` from wiki page frontmatter (category, date, source count) |
107| `append_log.py` | Append a standardized log entry `## [YYYY-MM-DD] <op> \| <title>` |
108| `wiki_search.py` | BM25 search over wiki pages (standalone fallback when index.md isn't enough) |
109| `lint_wiki.py` | Find orphans (no inbound links), stale pages, missing cross-refs, broken links |
110| `graph_analyzer.py` | Compute link graph stats — hubs, orphans, clusters, disconnected components |
111| `export_marp.py` | Render a wiki page (or subtree) to a Marp slide deck |
112 
113## Cross-tool compatibility
114 
115The vault's **schema** lives in CLAUDE.md (Claude Code) or AGENTS.md (Codex/Cursor/Antigravity/OpenCode). The same content works in both. This plugin ships both templates. For per-tool setup instructions see `references/cross-tool-setup.md`.
116 
117```
118CLAUDE.md → Claude Code
119AGENTS.md → Codex CLI, Cursor, Antigravity, OpenCode, Gemini CLI
120.cursorrules → legacy Cursor (pre-AGENTS.md)
121```
122 
123The scripts are pure Python stdlib → run identically everywhere. Only the loader file changes per tool.
124 
125## Obsidian setup (recommended)
126 
127- **Obsidian Web Clipper** — browser extension; converts web articles to markdown and drops them in `raw/`
128- **Download images locally** — Settings → Files and links → Attachment folder path = `raw/assets/`. Settings → Hotkeys → bind "Download attachments for current file" to `Ctrl+Shift+D`
129- **Graph view** — see hubs/orphans; essential for spotting structural problems
130- **Marp plugin** — Markdown-based slide decks directly from wiki pages
131- **Dataview plugin** — dynamic tables/lists over page frontmatter (tags, dates, source counts)
132- **Git** — the vault is a plain markdown repo; version it
133 
134Full setup walkthrough: `references/obsidian-setup.md`
135 
136## Why this works (vs plain RAG)
137 
138| Plain RAG | LLM Wiki |
139|---|---|
140| Rediscover knowledge each query | Knowledge accumulates |
141| Cross-references re-computed every time | Cross-references pre-written and maintained |
142| Contradictions surface only if you ask | Contradictions flagged during ingest |
143| Exploration disappears into chat history | Good answers re-filed as new pages |
144| Scales by embeddings infrastructure | Scales by markdown + `index.md` + optional local search |
145 
146At ~100 sources / hundreds of pages, `index.md` + filesystem search is enough. Past that, layer in a local search tool like [qmd](https://github.com/tobi/qmd) or use `scripts/wiki_search.py`.
147 
148## Related skills (chains via `context: fork`)
149 
150This skill is marked `context: fork` so other skills can chain into it:
151 
152- **`para-memory-files`** — PARA-method memory; complementary as long-term personal memory that feeds sources into the wiki
153- **`obsidian-vault`** (mattpocock) — lightweight Obsidian note helper; this skill is the maintained-wiki layer on top
154- **`rag-design`** — when wiki outgrows ~500 pages, use rag-design to bolt on a retrieval layer
155- **`mcp-design`** — expose the wiki as an MCP tool
156- **`agent-communication`** — for multi-agent wiki maintenance (ingestor + linter + librarian)
157 
158## Reference docs
159 
160- `references/wiki-schema.md` — full vault layout, page frontmatter, naming conventions
161- `references/page-formats.md` — entity, concept, source, comparison, synthesis templates
162- `references/ingest-workflow.md` — the detailed ingest flow the wiki-ingestor agent follows
163- `references/query-workflow.md` — query patterns, citation format, re-filing answers
164- `references/lint-workflow.md` — health-check heuristics
165- `references/obsidian-setup.md` — Obsidian plugins, hotkeys, vault config
166- `references/cross-tool-setup.md` — per-tool setup (Codex, Cursor, Antigravity, etc.)
167- `references/memex-principles.md` — Bush's Memex, why the LLM changes the maintenance math
168 
169## Templates (`assets/`)
170 
171- `CLAUDE.md.template`, `AGENTS.md.template`, `.cursorrules.template` — schema loaders per tool
172- `index.md.template`, `log.md.template` — starter index and log
173- `page-templates/` — entity, concept, source-summary, comparison, synthesis
174- `example-vault/` — small worked example you can study or copy
175 
176## Iron rule
177 
178**The LLM never edits files in `raw/`.** Ever. Sources are immutable. All LLM writes go to `wiki/`. If you need to correct a source, do it in `raw/` yourself — then re-ingest.
179 

Discussion

Alternatives

Also in Notes & knowledgeSee all 58 in Operations →