compounding-llm-wiki
CLAUDE.md0 starsChanged 5 months agoMITView on GitHub
This file is the lean core of the behavioral schema for the LLM that maintains this wiki. It is the repo's CLAUDE.md, so it auto-loads every session — and it deliberately holds only what every session needs: what the wiki is, where things live, the cross-cutting invariants, model routing, and the Hard Rules. Workflow-specific procedure lives in schema/*.md and loads on demand. Before doing a given piece of work, read the matching detail file(s) in full — the Workflow router…
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 71
When embedded in a larger repo, index.md, log.md, and the wiki/ and raw/ folders live at that repo root alongside this schema file — there …
- Very specific: line 74
Only if the repo already uses CLAUDE.md for a different, conflicting purpose should this schema be kept under another name (e.g.
- Distinctive: line 82
Every wiki page has one of six types.
- Very specific: line 97
Read the listed schema/*.md file(s) in full, first, before doing the work — they carry the detail this lean core omits.
- Very specific: line 142
Every raw/NNNN_…/article.md is an orphan in Graph View — correct: it has no inbound wikilinks.
- Very specific: line 143
Every source node is labelled article — Obsidian labels a node by its *filename*, not its H1, and the pipeline names every source package …
- Very specific: line 145
Do not rename article.md to make labels descriptive: source paths are frozen and load-bearing (see *Source folder naming* in …
- Very specific: line 195
When a task in the table is dispatched to a subagent, pass the model override explicitly and record in log.md which model actually ran the …
- Distinctive: line 206
Source-document claims must be traceable: Every factual statement from a raw document must be attributable to that document.
- Distinctive: line 208
Use source-grounded analogies: When source documents use specific metaphors or analogies to explain concepts, preserve and use them — they …
- Distinctive: line 209
Sessions are not load-bearing: Every important output must be crystallized into a wiki page or the log.
- Distinctive: line 210
One page per concept: Do not create near-duplicate pages.
- Distinctive: line 211
Never silently resolve a contradiction: When two sources conflict, flag it, log it, and surface it to the user.
- Distinctive: line 212
Mark causation direction explicitly on every link: Use: increase / decrease / activate / inhibit / trigger / suppress / enable / block.
≈ “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
LLM Wiki Schema
This file is the lean core of the behavioral schema for the LLM that maintains this wiki. It is
the repo's CLAUDE.md, so it auto-loads every session — and it deliberately holds only what
every session needs: what the wiki is, where things live, the cross-cutting invariants, model
routing, and the Hard Rules.
Workflow-specific procedure lives in schema/*.md and loads on demand. Before doing a given
piece of work, read the matching detail file(s) in full — the Workflow router below says which.
This keeps the always-loaded context small: a detail file enters context only when its workflow runs,
instead of every session paying for the whole schema. A hook gate (.claude/settings.json) enforces
the load — you cannot write a wiki/** page, index.md, or log.md without having read the matching
schema/ file in the current session, so the on-demand split never silently drops a rule.
What this wiki is
A persistent, compounding knowledge base built from source documents in any domain. The wiki synthesizes, cross-links, and compounds knowledge so that each new source added and each question answered makes the whole richer.
The wiki is NOT a search index over raw source documents. It is a synthesized, cross-linked artifact where knowledge is compiled once, kept current, and gets richer with every source added and every question asked. Do not re-derive answers from raw sources at query time — read the wiki pages.
Directory layout
[project-wiki]/
├── CLAUDE.md ← lean-core schema, auto-loaded every session (this file)
├── schema/ ← detailed workflow rules, loaded ON DEMAND via the Workflow router
│ └── page-format.md · ingest.md · contradictions.md · causal.md · query.md · lint.md · formats.md
├── .claude/settings.json ← hook gate: enforces the on-demand schema load before wiki/index/log writes
├── README.md ← project overview and setup guide
├── LICENSE ← MIT
├── index.md ← catalog of every wiki page (the LLM keeps this current)
├── home-page.md ← Obsidian Map of Content (A–Z index) — AUTO-GENERATED by the home-page-moc skill; never hand-edit
├── log.md ← append-only history of ingests, contradictions, lint passes, URL acquisitions
├── raw/ ← source documents — IMMUTABLE, read-only, never modify
│ ├── 0001_source-document/ ← one folder per source, self-contained; NNNN_ = catalog ID
│ │ ├── article.md ← the source text (filename may vary)
│ │ └── images/ ← assets referenced by relative links from the source text
│ │ ├── figure-001.png
│ │ └── ...
│ ├── 0002_another-source/
│ │ ├── paper.md
│ │ └── figures/
│ └── ... (one folder per source document)
└── wiki/ ← the synthesized, cross-linked knowledge base (LLM-maintained)
├── concepts/ ← abstract ideas, named entities, domain terms
├── tools/ ← specific named tools, systems, interventions (if the domain includes these)
├── workflows/ ← repeatable step-by-step processes and techniques
├── setup-guides/ ← installation / configuration walkthroughs (if applicable)
├── causal-chains/ ← explicit multi-step cause-effect pathway maps
└── metaphors/ ← domain-specific teaching analogiesEach source document gets its own folder inside raw/. This keeps every source a
self-contained, portable unit: the source text and the assets it references travel together, and
the relative image links inside the text (e.g. ) keep working
without any edits. Never flatten assets into a shared folder — filenames collide across sources
(many have a cover.jpg) and flattening would force rewriting links inside the source, violating
the immutability rule. The folder name is NNNN_<slug> — a frozen catalog ID followed by a unique
kebab-case slug. See Source folder naming in schema/ingest.md.
The wiki root may be a dedicated directory or may coincide with an existing repository root.
When embedded in a larger repo, index.md, log.md, and the wiki/ and raw/ folders live at
that repo root alongside this schema file — there is no separate wiki subdirectory. Normally this
schema is the repo's CLAUDE.md, so Claude Code auto-loads it at the start of every session.
Only if the repo already uses CLAUDE.md for a different, conflicting purpose should this schema be
kept under another name (e.g. WIKI_CLAUDE.md) and pointed to manually. All paths in this schema
are relative to the wiki root, wherever it sits.
Page types
Every wiki page has one of six types. Use the type that best fits the primary purpose of the page.
| Type | Subfolder | Use for |
concept | wiki/concepts/ | Abstract ideas, named entities, or domain terms the reader needs to understand |
tool | wiki/tools/ | A specific named tool, integration, system, or named intervention |
workflow | wiki/workflows/ | A repeatable process or technique |
setup-guide | wiki/setup-guides/ | Installation, configuration, or onboarding steps |
causal-chain | wiki/causal-chains/ | An explicit multi-step cause-effect pathway tracing how one state leads to another |
metaphor | wiki/metaphors/ | Teaching analogies that make abstract concepts concrete and actionable |
Workflow router
Read the listed schema/*.md file(s) in full, first, before doing the work — they carry the
detail this lean core omits. The hook gate enforces the load at the point of mutation; this table is
the authority on what to read for each task.
| When you are… | Read first | Gate trips on |
| Acquiring a URL source | schema/ingest.md | — |
| Ingesting a raw source | schema/ingest.md + schema/page-format.md; add schema/contradictions.md when updating an existing page | wiki/** write |
| Writing or editing any wiki page | schema/page-format.md | wiki/** write |
| Building a causal-chain page | schema/page-format.md + schema/causal.md | wiki/causal-chains/** write |
| Answering a reader question | schema/query.md; add schema/causal.md if the question is causal | — |
| Running a lint pass | schema/lint.md + schema/contradictions.md | wiki/** write |
| Flagging or resolving a contradiction | schema/contradictions.md | wiki/** write |
Updating index.md or log.md | schema/formats.md | index.md / log.md write |
The deterministic shell checks in lint/ingest (orphans, missing pages, broken links) need no detail
file. Reasoning-heavy work — lint, causal-chain construction, contradiction analysis — additionally
routes to a subagent with a model override per Model selection below; pass the subagent the same
"read schema/X.md first" instruction so it loads only the slice its task needs.
Cross-cutting invariants
These hold across ingest, lint, and query alike, so they stay in the always-loaded core rather than in any single workflow file. (The Hard Rules at the end of this file are also always-loaded.)
Path conventions (two distinct kinds)
These look similar but differ deliberately — do not mix them:
sources:frontmatter uses a root-relative path:raw/0001_sample-source/article.md. This is a canonical metadata reference, not a clickable link, so it reads the same on every page regardless of where the page sits.- Image embeds (and any in-body link that must actually resolve) use a page-relative path: from a page in
wiki/concepts/, that is../../raw/0001_sample-source/images/foo.png. Wiki pages sit two levels below the wiki root, so the../../prefix is required for the markdown link to resolve.
The source layer is provenance, not graph nodes
raw/ is the source/provenance layer, distinct from the synthesized knowledge layer in wiki/.
A page records where it came from with the sources: frontmatter path and plain-text inline
citations (raw/0001_…/article.md (slide N)) — neither is a [[wikilink]], so neither creates an
Obsidian graph edge, by design. The synthesized layer (wiki/**, index.md) is the knowledge graph;
the source packages sit beneath it and are reached by their sources: path, the source-PDF link, or
backlink search — not by being graph nodes. (The only sanctioned [[raw/…]] wikilink is the rare
See source for fuller detail pointer.)
Consequences to expect and not to "fix" by integrating sources into the graph:
- Every
raw/NNNN_…/article.mdis an orphan in Graph View — correct: it has no inbound wikilinks. - Every source node is labelled
article— Obsidian labels a node by its filename, not its H1, and the pipeline names every source packagearticle.md(the descriptive name is on the folder). Do not renamearticle.mdto make labels descriptive: source paths are frozen and load-bearing (see Source folder naming inschema/ingest.md), so a rename silently breaks every citing page for a cosmetic label.
Exclude the source layer from Graph View so the graph shows only the synthesized knowledge web:
in the graph's search/filter box (or .obsidian/graph.json "search", which is machine-local and
git-ignored) set -path:"raw/". Keep showOrphans: true so a genuine orphan wiki page still
surfaces as a real lint signal — only raw/ is an expected orphan.
Forward links are expected
Cross-link liberally, including to pages that do not exist yet. A [[page-slug]] pointing at a
not-yet-created page is not an error — it marks a page worth writing when its source is ingested
(e.g. linking [[claudemd-files]] before the CC4E #5 source is added). The lint workflow tracks
these as missing pages and they resolve as more sources come in. Do not suppress a useful link
merely because its target page is absent.
A forward link resolves automatically the moment a page file with the matching name is created —
no edit to the linking pages is needed. Whether a later ingest may create that page under the wanted
slug is governed by the orphaned-forward-link check in the Ingest workflow (schema/ingest.md, step 3): the slug is
claimed only when the new page is the same entity the linking text refers to, not merely the same
subject. While a forward link remains unresolved and a closely related page exists, the link site may
carry a pending-pointer — [[wanted-slug]] *(page pending — closest coverage: [[other-page]])* —
so a reader hitting the dead link is offered the nearest existing coverage. The pointer's wording is
fixed (it must stay greppable), and lint strips it automatically once the wanted page exists.
Model selection
Different parts of this work demand different levels of reasoning, and model cost scales with capability. To match spend to need without relying on a human to remember to switch models, the session routes work to a subagent with an explicit model override based on task type. The orchestrating session makes this decision automatically — do not ask the user to switch models manually for these tasks.
Capability note: the model running the main session cannot reassign itself mid-session. The only programmatic way to run a task on a different model is to dispatch it to a subagent with a
modeloverride. That is the mechanism this section relies on. An instruction to "switch your own model" would be unexecutable, so do not add one.
| Task type | Run on | Model id | Why |
| Ingestion (read source, extract entities, create/update pages, add links) | Subagent | claude-sonnet-4-6 | Mechanical pattern-matching against a fixed schema. The template carries the structure; a lighter model is sufficient and far cheaper. |
| Lint pass | Subagent | claude-opus-4-8 | Contradiction sweeps and consistency checks need real reasoning; a weak model fails silently here. |
| Causal-chain construction | Subagent | claude-opus-4-8 | Multi-hop reasoning and direction-of-effect correctness; errors compound down the chain. |
| Contradiction analysis (the plausibility assessment) | Subagent | claude-opus-4-8 | The assessment's value depends on the model's reasoning quality. |
| Reader Q&A | Inline (session model) | — | Answers run in the interactive thread on whatever model the session uses. Routing live Q&A through subagents loses conversational context, so it is intentionally not auto-routed. |
Routing rules:
- When a task in the table is dispatched to a subagent, pass the model override explicitly and record in
log.mdwhich model actually ran the task (this is the model name captured inexternal_knowledgeand contradiction-assessment entries). - Effort is governed by each model's configured default — not by this schema and not by per-task dispatch. The dispatch mechanism overrides the model but exposes no effort override, so a subagent simply inherits whatever effort its model is configured to. Effort is therefore coupled to the model, not the task. Workspace convention: run all models at high effort for consistency and to remove the one variable per-task routing cannot control. (An earlier draft prescribed "medium for ingestion, high for reasoning"; that was advisory intent that was never actually enforced — ingestion effort equals Sonnet's configured default, whatever it is set to. Do not rely on a per-task effort guarantee; there is no mechanism behind it.)
- If subagent dispatch is unavailable in the current environment, fall back to running inline and tell the user which model the session is on, so they can switch via
/modelif it is mismatched to the task. Never silently run a reasoning-heavy task on a model chosen only for ingestion. - The model ids above are the intended defaults. If the available model lineup changes, update this table rather than hardcoding model choices elsewhere in the schema.
- Provenance must record the current session model — never the system-prompt identity string. Every place this schema records which model did the work (
external_knowledgefrontmatter, contradiction assessments,log.mdModel:lines, and any page-level model field) MUST name the model actually active when the work ran. The model identity stated in the session's system prompt is the model at session start; it goes stale the moment the user runs/modelto switch mid-session, and it does not update. So do not copy the model name from that identity line by reflex — confirm the live session model (the one shown in the client's status bar / set by the last/model) and record that. This failure has occurred: a mid-session switch from one model to another left provenance fields naming the start-of-session model long after it had changed. When in doubt, state the model you believe is active and note the uncertainty rather than asserting a stale identity.
Hard rules
- Never modify files in
raw/. Raw sources are immutable. Read them; do not edit them. - Source-document claims must be traceable. Every factual statement from a raw document must be attributable to that document. LLM general knowledge may fill causal chain gaps only when marked EXTERNAL with a reputable citation — never blended silently into sourced content.
- Write for the target reader. Match explanation depth and vocabulary to whoever will use this wiki. Define domain terms on first use.
- Use source-grounded analogies. When source documents use specific metaphors or analogies to explain concepts, preserve and use them — they are part of the source's pedagogy.
- Sessions are not load-bearing. Every important output must be crystallized into a wiki page or the log. Nothing of value should exist only in chat history.
- One page per concept. Do not create near-duplicate pages. If two concepts are closely related, one page can cover both with a clear structure.
- Never silently resolve a contradiction. When two sources conflict, flag it, log it, and surface it to the user. Do not choose a side without human review unless it is an unambiguous scope mismatch with the scope documented on both pages.
- Mark causation direction explicitly on every link. Use: increase / decrease / activate / inhibit / trigger / suppress / enable / block. A causal link without a stated direction is incomplete and must be flagged during lint.
- Never describe an image you have not opened. Citing, summarizing, embedding-as-evidence, or even classifying an image requires having read that exact image with the Read tool. Guessing its contents from the surrounding text is fabrication — the same violation as inventing a source quote — and is the cause of false image citations. See Images & assets rule 3 in
schema/ingest.md.
Prompt log (kept centrally, not in this repo)
This project's prompt log is not stored in this repo. Per the workspace Prompt
Recording Workflow (cli_projects/CLAUDE.md), it lives in the private,
workspace-level prompt-logs/ backup (see prompt-logs/README.md for the
rationale — keeping logs out of repos that can go public). project_prompts.txt
stays gitignored here as a guard.
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.

