llm-wiki
CLAUDE.md394 starsChanged 6 months agoMITView on GitHub
You are maintaining an LLM Wiki (per Karpathy's spec) that compiles the user's Claude Code session history into a structured, interlinked markdown knowledge base. Triggered by /wiki-ingest <path> or /wiki-sync. Files under `raw/sessions/<YYYY-MM-DDTHH-MM>-<project
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llmwiki-ingestSkill
- llmwiki-querySkill
- llmwiki-syncSkill
- project-maintainerSkill
- self-learnSkill
- wiki-allSkill
The file
We split this CLAUDE.md into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 131
Read wiki/index.md and wiki/overview.md to identify relevant pages.
- Distinctive: line 133
Use Read on the matching pages.
- Very specific: line 135
If the answer is substantial (3+ paragraphs), ask the user if they want it saved to wiki/syntheses/<slug>.md.
- Distinctive: line 142
Use Grep and Read to find:
- Very specific: line 163
Every section heading carries a (count) of pages in that section.
- Very specific: line 200
No silent overwrites: When ingest conflicts with existing wiki content, record both claims under ## Contradictions.
- Very specific: line 201
Cross-link everything: Every page should have a ## Connections section with at least one [[wikilink]].
- Very specific: line 202
Frontmatter is authoritative: Always fill title, type, tags, sources (where applicable), and last_updated.
- Distinctive: line 203
One commit per page group: when publishing to git — match the PR rules in the open-source framework.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 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.
Files
llmwiki — Claude Code Schema
You are maintaining an LLM Wiki (per Karpathy's spec) that compiles the user's Claude Code session history into a structured, interlinked markdown knowledge base.
Three layers
raw/ IMMUTABLE. Session transcripts converted from ~/.claude/projects/*/*.jsonl.
Flat naming: YYYY-MM-DDTHH-MM-project-slug.md (no subdirectories).
Never modify files here. Treat as source-of-truth for facts.
wiki/ YOU OWN THIS. LLM-generated pages that summarise, cross-reference, and
synthesise the raw layer. All of your writes go here.
index.md Catalog of every page in the wiki. Update on every ingest.
log.md Append-only chronological record of every operation.
overview.md Living synthesis across all sources.
sources/ One summary page per raw source (kebab-case slug).
entities/ People, companies, projects, products (TitleCase.md).
concepts/ Ideas, frameworks, methods, theories (TitleCase.md).
syntheses/ Saved query answers (kebab-case slug).
comparisons/ Side-by-side diffs of two or more entities/concepts (kebab-case slug). [v0.2+]
questions/ First-class open questions with state tracking (kebab-case slug). [v0.2+]
archive/ Deprecated / demoted pages preserved for history. [v0.2+]
site/ GENERATED. Static HTML from `python3 -m llmwiki build`. Do not edit by hand.Slash commands (and what they do)
| Command | Intent | Workflow |
/wiki-sync | Convert new .jsonl sessions into raw/sessions/ AND ingest them into wiki/ | Runs python3 -m llmwiki sync, then executes the Ingest Workflow below for each new file |
/wiki-ingest <path> | Ingest one source or folder | Executes the Ingest Workflow for the given path |
/wiki-query <question> | Answer a question from the wiki | Executes the Query Workflow below |
/wiki-lint | Find orphans, broken links, stale pages | Executes the Lint Workflow below |
/wiki-build | Regenerate the static HTML site | Runs python3 -m llmwiki build |
/wiki-serve | Start the local HTTP server | Runs python3 -m llmwiki serve |
/wiki-update | Update one wiki page in place (v0.2+) | Surgical edit of one page without re-ingest |
/wiki-graph | Build the knowledge graph (v0.2+) | Walks [[wikilinks]] → graph/graph.json + graph.html |
/wiki-reflect | Higher-order self-reflection over the wiki (v0.2+) | Finds gaps, patterns, and suggests new pages |
Ingest Workflow
Triggered by /wiki-ingest <path> or /wiki-sync.
- Read the source file(s) under
raw/using the Read tool. - Read wiki context —
wiki/index.mdandwiki/overview.md— so you know what's already there. - For each source file, write
wiki/sources/<slug>.mdusing the Source Page Format below.<slug>comes from the YAML frontmatter'sslugfield when present, otherwise from the filename. - Update
wiki/index.md— add the new source under## Sources. - Update
wiki/overview.md— revise the synthesis if the new source adds substantial new information. Don't rewrite for trivia. - Create/update entity pages (
wiki/entities/<Name>.md) for any people, companies, projects, products, tools, libraries mentioned. TitleCase filename. - Create/update concept pages (
wiki/concepts/<Name>.md) for any ideas, patterns, frameworks, or decisions mentioned. - Cross-link everything with
[[wikilinks]]under## Connectionson every page. - Flag contradictions — if a new source contradicts existing wiki content, add a
## Contradictionssection to the affected page and leave BOTH claims visible. Do not silently overwrite. - Append to
wiki/log.mdwith the format:## [YYYY-MM-DD] ingest | <title>
Session-derived source specifics
Files under raw/sessions/<YYYY-MM-DDTHH-MM>-<project>-<slug>.md are auto-generated from .jsonl transcripts (flat naming, no subdirectories). They have rich YAML frontmatter (project, slug, started, model, tools_used, gitBranch, etc.). When ingesting these:
- Trust the frontmatter — don't re-infer metadata from the body
- Do NOT copy the Conversation section verbatim — treat it as raw material to summarize
- Create or update a project entity page at
wiki/entities/<ProjectSlug>.mdwith a bulleted session list under## Sessions - Extract decisions — anything the user explicitly locked ("decision locked", "let's go with", "I decided...") goes into
wiki/concepts/ - Extract tools + libraries — every
tools_usedentry and every library mentioned in code previews becomes a potential entity page - If
is_subagent: true— link the page as a child of its parent session rather than a standalone entity
Source Page Format
---
title: "Source Title"
type: source
tags: [claude-code, session-transcript]
date: YYYY-MM-DD
source_file: raw/sessions/<YYYY-MM-DDTHH-MM>-<project>-<slug>.md
project: <project-slug>
model: <model-id>
---
## Summary
2–4 sentence synthesis of what the session accomplished.
## Key Claims
- Claim 1
- Claim 2
- Claim 3
## Key Quotes
> "Quote here" — context
## Connections
- [[EntityName]] — how they relate
- [[ConceptName]] — how it connects
## Contradictions
- Contradicts [[OtherPage]] on: ...Entity / Concept Page Format
---
title: "Entity Name"
type: entity # or: concept
tags: []
sources: [source-slug-1, source-slug-2]
last_updated: YYYY-MM-DD
---
# Entity Name
One-paragraph description.
## Key Facts
- Fact 1
- Fact 2
## Sessions
- [[session-slug]] (YYYY-MM-DD) — what happened
## Connections
- [[RelatedEntity]]
- [[RelatedConcept]]Query Workflow
Triggered by /wiki-query <question>.
- Read
wiki/index.mdandwiki/overview.mdto identify relevant pages. - (v0.5, #60) Before descending into a folder, read its
_context.mdif one exists (e.g.wiki/entities/_context.md,wiki/concepts/_context.md). The context file is a one- or two-paragraph description of what lives in that folder — use it to decide whether the folder is worth walking into for the current query, and which of its pages to read in full versus skip. This saves context tokens on every deep query. - Use Read on the matching pages.
- Synthesise an answer with inline
[[wikilink]]citations. - If the answer is substantial (3+ paragraphs), ask the user if they want it saved to
wiki/syntheses/<slug>.md. - Append to
wiki/log.mdwith## [YYYY-MM-DD] query | <question>.
Lint Workflow
Triggered by /wiki-lint.
Use Grep and Read to find:
- Orphan pages — wiki pages with no inbound
[[links]]from any other page. - Broken wikilinks —
[[Name]]pointing to a page that does not exist. - Contradictions — claims that conflict across pages.
- Stale summaries — pages whose
last_updatedis older than the newest source that contributes to them. - Missing entity pages — entities mentioned in 3+ source pages but lacking their own page.
- Data gaps — questions the wiki can't answer; suggest new sources or queries.
- (v0.5, #60) Uncontexted folders — any
wiki/subfolder containing >10.mdfiles that lacks a_context.mdstub. Large knowledge folders without a context description make deep queries more expensive per call — suggest creating a stub that describes what lives there. Usepython3 -c "from llmwiki.context_md import find_uncontexted_folders; from pathlib import Path; print(list(find_uncontexted_folders(Path('wiki'))))"or load the helper directly.
Output a report to the chat. Ask the user if they want it saved to wiki/lint-report.md.
Naming Conventions
- Source slugs:
kebab-case(matches the raw filename without.md) - Entity pages:
TitleCase.md(e.g.,OpenAI.md,AndrejKarpathy.md) - Concept pages:
TitleCase.md(e.g.,ReinforcementLearning.md,RAG.md) - Synthesis pages:
kebab-case.md
Index Format
Every section heading carries a (count) of pages in that section. Update the count when adding/removing a page so the index stays scannable past ~50 pages (#387 U6).
# Wiki Index
## Overview (1)
- [Overview](overview.md)
## Sources (N)
- [Source Title](sources/slug.md) — one-line summary
## Entities (N)
- [Entity Name](entities/EntityName.md) — one-line description
## Projects (N)
- [project-slug](projects/project-slug.md) — one-line description
## Concepts (N)
- [Concept Name](concepts/ConceptName.md) — one-line description
## Syntheses (N)
- [Analysis Title](syntheses/slug.md) — what question it answersLog Format
Each entry starts with ## [YYYY-MM-DD] <operation> | <title> so it's grep-parseable:
grep "^## \[" wiki/log.md | tail -10Operations: sync, ingest, query, lint, build.
Hard rules
raw/is immutable. Never modify files underraw/. If source data is wrong, fix the converter, not the output. Enforced at runtime as of #326:llmwiki syncrefuses to overwrite an existingraw/file unless you pass--force; failures go into.llmwiki-quarantine.jsonso you can see what didn't sync and why. Non-AI adapters (Obsidian, Jira, Meeting, PDF) are opt-in only — they never fire on a defaultsyncwithout explicitenabled: trueinsessions_config.json.- No silent overwrites. When ingest conflicts with existing wiki content, record both claims under
## Contradictions. - Cross-link everything. Every page should have a
## Connectionssection with at least one[[wikilink]]. - Frontmatter is authoritative. Always fill
title,type,tags,sources(where applicable), andlast_updated. - One commit per page group when publishing to git — match the PR rules in the open-source framework.
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
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.

