agentleFS
intergalacticuserintergalacticuser/llm-wiki-starter/CLAUDE.md

llm-wiki-starter

CLAUDE.md1 starsChanged 8 months agoMITView on GitHub

A persistent, compounding knowledge base maintained by LLMs. Based on the LLM Wiki pattern by Andrej Karpathy (2026). This is an LLM Wiki — a structured, interlinked collection of markdown files that serves as persistent memory across sessions. Instead of starting from scratch each conversation, the LLM reads this wiki to recall context, entities, concepts, and prior work. The wiki sits between raw source documents and the LLM. It is a compounding artifact: cross-references are already built, contradictions flagged, knowledge…

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

33 rules. About 0 are common, 17 are distinctive, and 16 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every wiki page uses this frontmatter structure:

    line 68
  2. Very specific:

    Use [[page-name]] to link between wiki pages.

    line 92
  3. Distinctive:

    When the user provides a new source document or asks to ingest content:

    line 104
  4. Distinctive:

    When the user asks a question:

    line 119
  5. Distinctive:

    Read summaries only if needed: after the durable pages

    line 126
  6. Very specific:

    Read the generated summaries in wiki/summaries/chat-*.md

    line 186
  7. Distinctive:

    Create/update entity and concept pages as needed

    line 189
  8. Very specific:

    Update index.md with new pages

    line 190
  9. Distinctive:

    Add cross-references between related pages

    line 191
  10. Very specific:

    Use python3 tools/analyze-product-families.py when chat names, folder names, or versioned workspaces may be hiding one broader product …

    line 195
  11. Very specific:

    Use ./refresh-memory when you want a one-command refresh cycle:

    line 206
  12. Distinctive:

    When asked "what do we know about X" or "review the wiki":

    line 234
  13. Very specific:

    Read index.md for overview

    line 236
  14. Very specific:

    Read log.md for recent activity

    line 237
  15. Very specific:

    Read the most relevant entities/, concepts/, and queries/ pages before opening summaries

    line 238
  16. Distinctive:

    When a new chat starts in this repository:

    line 243
  17. Distinctive:

    Read this file (CLAUDE.md)

    line 245
  18. Distinctive:

    If the project name is noisy or ambiguous, use normalization/query pages to map it to a canonical entity first

    line 249
  19. Distinctive:

    Treat workspace names, branch-like folder names, and version folders as heuristic signals only, not proof that the work belongs to a …

    line 250
  20. Very specific:

    Only after that, open wiki/summaries/ or sources/ as needed

    line 251
  21. Very specific:

    Entities: use the most common name: openai.md, andrej-karpathy.md

    line 261
  22. Very specific:

    Concepts: use descriptive names: attention-mechanism.md, rag-vs-wiki.md

    line 262
  23. Very specific:

    Queries: use question format: how-does-attention-work.md

    line 263
  24. Very specific:

    Sources are immutable: Never edit files in sources/.

    line 288
  25. Distinctive:

    Wiki pages are living documents: Update them freely as new information arrives.

    line 289
  26. Distinctive:

    Cite sources: Every claim in the wiki should trace back to a source.

    line 291
  27. Distinctive:

    Flag uncertainty: If something is unclear or contradictory, say so explicitly.

    line 292
  28. Distinctive:

    When starting a new conversation with this wiki:

    line 300
  29. Distinctive:

    Read this file (CLAUDE.md) to understand the system

    line 302
  30. Very specific:

    Read index.md to know what's in the wiki

    line 303
  31. Very specific:

    Check if there are un-ingested chats: run python3 tools/ingest-chats.py list to see recent sessions

    line 305
  32. Distinctive:

    If relevant new chats exist, offer to ingest them

    line 306
  33. Very specific:

    Auto-context loading: When the user asks a question, always check index.md first.

    line 310

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

LLM Wiki — Schema & Operating Instructions

A persistent, compounding knowledge base maintained by LLMs. Based on the LLM Wiki pattern by Andrej Karpathy (2026).


What This Is

This is an LLM Wiki — a structured, interlinked collection of markdown files that serves as persistent memory across sessions. Instead of starting from scratch each conversation, the LLM reads this wiki to recall context, entities, concepts, and prior work.

The wiki sits between raw source documents and the LLM. It is a compounding artifact: cross-references are already built, contradictions flagged, knowledge organized.


Three-Layer Architecture

Layer 1: sources/        — Raw, immutable source documents (articles, papers, data, images)
Layer 2: wiki/           — LLM-generated markdown (summaries, entity pages, concept pages, queries)
Layer 3: CLAUDE.md       — This file. Schema, conventions, workflows.

Directory Structure

llm wiki/
├── CLAUDE.md              # This file — schema & operating instructions
├── INSTRUCTIONS.md        # Universal version for any LLM/IDE
├── index.md               # Content catalog organized by category
├── log.md                 # Append-only chronological record
├── README.md              # Setup guide for humans
│
├── sources/               # Layer 1: Raw immutable source documents
│   ├── *.md               # Articles, papers converted to markdown
│   ├── *.pdf              # Original PDFs
│   ├── *.png / *.jpg      # Images, diagrams
│   └── *.csv / *.json     # Data files
│
├── wiki/                  # Layer 2: LLM-generated content
│   ├── entities/          # Pages about people, orgs, tools, projects
│   │   └── *.md
│   ├── concepts/          # Pages about ideas, patterns, techniques
│   │   └── *.md
│   ├── summaries/         # Source document summaries
│   │   └── *.md
│   └── queries/           # Answered questions filed as wiki pages
│       └── *.md
│
├── tools/                 # Automation scripts
│   ├── ingest-chats.py    # Chat history ingestion (Python)
│   ├── refresh-memory.py  # Incremental memory refresh + index rebuild
│   └── wiki-ingest-chats.sh  # Shell wrapper for chat ingestion
│
├── .cursorrules           # Schema for Cursor IDE
├── .clinerules            # Schema for Cline
├── .github/
│   └── copilot-instructions.md  # Schema for GitHub Copilot
└── .windsurfrules         # Schema for Windsurf IDE

Page Format

Every wiki page uses this frontmatter structure:

---
title: "Page Title"
type: entity | concept | summary | query
created: YYYY-MM-DD
updated: YYYY-MM-DD
sources: ["source-file.md"]       # Which sources informed this page
tags: [tag1, tag2]
status: active | stale | draft
---

# Page Title

Page content in markdown. Use [[wiki-links]] to cross-reference other pages.

## See Also
- [[Related Page 1]]
- [[Related Page 2]]

Wiki-Link Convention

Use [[page-name]] to link between wiki pages. The page-name is the filename without .md extension and without the directory prefix. When referencing, include the path hint:

  • [[entities/andrej-karpathy]] — link to an entity page
  • [[concepts/rag-vs-wiki]] — link to a concept page
  • [[summaries/source-article-name]] — link to a summary

Core Operations

1. INGEST — Process a New Source

When the user provides a new source document or asks to ingest content:

  1. Save the raw source to sources/ (if not already there)
  2. Read the source thoroughly
  3. Create a summary in wiki/summaries/ with key takeaways, claims, and data
  4. Create or update entity pages in wiki/entities/ for people, orgs, tools mentioned
  5. Create or update concept pages in wiki/concepts/ for ideas, patterns, techniques
  6. Update cross-references — add [[wiki-links]] between related pages
  7. Update index.md — add new pages to the catalog under appropriate categories
  8. Append to log.md — record the ingest with timestamp

A single source may touch 10-15 wiki pages. This is normal and expected.

2. QUERY — Answer a Question

When the user asks a question:

  1. Read index.md to find relevant wiki pages
  2. Route by page type first:
    • wiki/entities/ for projects, products, companies, tools, and people
    • wiki/concepts/ for recurring patterns, architecture, workflows, and failure modes
    • wiki/queries/ for prior syntheses, normalization rules, and durable question pages
  3. Read summaries only if needed after the durable pages
  4. Read raw sources only if needed for exact detail, ambiguity resolution, or citation depth
  5. Synthesize an answer with citations to wiki pages and original sources
  6. Optionally file the answer as a new page in wiki/queries/ if it has lasting value
  7. Append to log.md — record the query

When the project identity is unclear, treat chat names, folder names, version suffixes, and higher-level workspace directories as hints rather than hard boundaries. Infer the canonical product from the content itself: repeated feature vocabulary, shared bugs, deployment targets, app surfaces, brand language, and explicit references to older versions or sibling workspaces.

3. LINT — Health Check

Periodically (or when asked), audit the wiki for:

  • Contradictions between pages — flag and resolve
  • Stale claims — mark pages that may be outdated
  • Orphan pages — pages with no incoming links
  • Missing cross-references — pages that should link to each other but don't
  • Data gaps — topics mentioned but not yet covered
  • Index drift — pages that exist but aren't in index.md

Record lint results in log.md.

4. INGEST-CHATS — Process IDE Chat History

Ingest conversations from IDE chat histories into the wiki. This extracts knowledge from past sessions so it persists across conversations.

Trigger phrases: "Ingest chats", "Absorb chats", "Process chat history", "Засосать чаты"

Using the built-in tool:

# List all available chats across all IDEs
python3 tools/ingest-chats.py list

# Refresh memory incrementally (discover -> ingest new/updated -> rebuild index)
./refresh-memory

# Ingest ALL chats from all IDEs
python3 tools/ingest-chats.py ingest --all

# Ingest only current project's chats
python3 tools/ingest-chats.py ingest --current

# Ingest specific project
python3 tools/ingest-chats.py ingest --project "project-name"

# Ingest one specific chat file
python3 tools/ingest-chats.py ingest --chat /path/to/file.jsonl

# Filter by IDE
python3 tools/ingest-chats.py ingest --all --ide claude-code

What it does:

  1. Finds conversation files from IDE storage (Claude Code, Cursor, Windsurf, Continue, Cline)
  2. Extracts all user and assistant messages
  3. Saves raw transcript to sources/chats/ (immutable)
  4. Creates a summary page in wiki/summaries/ with key topics and initial request
  5. Updates log.md with the ingestion record

After running the tool, the LLM should:

  1. Read the generated summaries in wiki/summaries/chat-*.md
  2. Extract key decisions, patterns, entities, and concepts
  3. Normalize product identity across renamed folders, versioned workspaces, and higher-level directory changes before deciding that two chats belong to different products
  4. Create/update entity and concept pages as needed
  5. Update index.md with new pages
  6. Add cross-references between related pages

4b. ANALYZE-PRODUCT-FAMILIES — Find Cross-Folder Product Families

Use python3 tools/analyze-product-families.py when chat names, folder names, or versioned workspaces may be hiding one broader product family.

What it does:

  1. Reads the shared alias registry in tools/product-aliases.json
  2. Scores likely cross-folder and cross-version family overlaps from summary content
  3. Writes a candidate report into wiki/queries/
  4. Rebuilds index.md
  5. Appends the run to log.md

4a. REFRESH-MEMORY — Incremental Memory Refresh

Use ./refresh-memory when you want a one-command refresh cycle:

  1. Discover available chat sessions
  2. Ingest only new or updated conversations
  3. Rebuild index.md
  4. Append a refresh record to log.md

Examples:

./refresh-memory
./refresh-memory --ide claude-code
./refresh-memory --current
./refresh-memory --project "my-project"

Supported IDE chat storage locations:

IDEStorage PathFormat
Claude Code~/.claude/projects/*/JSONL
Cursor~/Library/Application Support/Cursor/User/workspaceStorage/SQLite
Windsurf~/Library/Application Support/Windsurf/User/workspaceStorage/SQLite
Continue~/.continue/sessions/JSON
ClineVS Code globalStorage saoudrizwan.claude-dev/JSON

5. REVIEW — Summarize Wiki State

When asked "what do we know about X" or "review the wiki":

  1. Read index.md for overview
  2. Read log.md for recent activity
  3. Read the most relevant entities/, concepts/, and queries/ pages before opening summaries
  4. Provide a structured summary of wiki contents, recent changes, and gaps

6. SESSION START — Relevance Routing For New Chats

When a new chat starts in this repository:

  1. Read this file (CLAUDE.md)
  2. Read index.md
  3. Read log.md
  4. Build a short candidate set of relevant pages in wiki/entities/, wiki/concepts/, and wiki/queries/
  5. If the project name is noisy or ambiguous, use normalization/query pages to map it to a canonical entity first
  6. Treat workspace names, branch-like folder names, and version folders as heuristic signals only, not proof that the work belongs to a different product
  7. Only after that, open wiki/summaries/ or sources/ as needed

This routing is mandatory for non-trivial questions. Do not answer from scratch if the wiki already contains relevant durable memory.


Naming Conventions

  • Filenames: lowercase, hyphens for spaces: andrej-karpathy.md, transformer-architecture.md
  • Summaries: match the source name: sources/attention-paper.pdf → wiki/summaries/attention-paper.md
  • Entities: use the most common name: openai.md, andrej-karpathy.md
  • Concepts: use descriptive names: attention-mechanism.md, rag-vs-wiki.md
  • Queries: use question format: how-does-attention-work.md

Log Format

log.md uses this format for parseability:

## [YYYY-MM-DD] INGEST | Source: filename.md
Summary of what was ingested and which wiki pages were created/updated.
Pages touched: [[page1]], [[page2]], [[page3]]

## [YYYY-MM-DD] QUERY | Question text
Brief answer summary. See [[queries/question-page]] for full answer.

## [YYYY-MM-DD] LINT | Health check
Findings: N contradictions, N stale pages, N orphans, N gaps.
Actions taken: ...

Important Principles

  1. Sources are immutable. Never edit files in sources/. They are the ground truth.
  2. Wiki pages are living documents. Update them freely as new information arrives.
  3. Cross-reference aggressively. The value compounds through connections.
  4. Cite sources. Every claim in the wiki should trace back to a source.
  5. Flag uncertainty. If something is unclear or contradictory, say so explicitly.
  6. Compounding value. Good answers become new wiki pages. The wiki grows smarter over time.
  7. Human curates, LLM maintains. The human decides what to ingest and what questions matter. The LLM handles the bookkeeping.

On Every New Session

When starting a new conversation with this wiki:

  1. Read this file (CLAUDE.md) to understand the system
  2. Read index.md to know what's in the wiki
  3. Scan log.md for recent activity
  4. Check if there are un-ingested chats: run python3 tools/ingest-chats.py list to see recent sessions
  5. If relevant new chats exist, offer to ingest them
  6. Build a small relevance shortlist from wiki/entities/, wiki/concepts/, and wiki/queries/
  7. You are now ready to ingest, query, or lint

Auto-context loading: When the user asks a question, always check index.md first. If the wiki has relevant pages, read durable memory pages before summaries, and summaries before raw sources. The wiki is your long-term memory — use it.


Tooling Integration

This wiki is designed to work with:

  • Obsidian — for human browsing, graph view, and web clipper for ingesting articles
  • Git — for version history (init a repo in this directory)
  • Any LLM IDE — Claude Code, Cursor, Copilot, Windsurf, Cline, Aider, etc.
  • qmd — optional hybrid BM25/vector search CLI for large wikis
  • Marp — for generating slide decks from wiki content
  • Dataview (Obsidian plugin) — for querying page frontmatter

Quick Reference

CommandWhat to do
"Ingest this"Run INGEST operation on provided source
"What do we know about X?"Run QUERY operation
"Lint the wiki"Run LINT operation
"Review the wiki"Run REVIEW operation
"Add to sources"Save file to sources/, don't process yet
"Update index"Rebuild index.md from current wiki pages
"Refresh memory"Run ./refresh-memory to ingest new/updated chats and rebuild the index
"Analyze product families"Run python3 tools/analyze-product-families.py to review cross-folder and cross-version merge candidates
"Ingest chats" / "Засосать чаты"Run INGEST-CHATS: process IDE conversation history
"Ingest all chats"Run INGEST-CHATS with --all flag
"Ingest this chat"Run INGEST-CHATS with --current flag
"List chats"Run python3 tools/ingest-chats.py list

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.