Reference ยท Concept

The CLAUDE.md wiki pattern

Turn one config file into a memory system: keep CLAUDE.md small and use it as a front door to a markdown wiki your AI reads at the start of every session.

The problem with a flat CLAUDE.md

The first instinct is to pour everything into CLAUDE.md: every preference, every project fact, every rule. It works for a week. Then the file grows until it's too large to load every session and too tangled to maintain. Now the model carries dead weight and still misses the one thing it needed for today's task.

The pattern: router, not warehouse

The fix is to split the job in two. CLAUDE.md stays lean and becomes the router: a short file the assistant reads first that tells it to load a wiki index, then pull only the few pages relevant to the work at hand. The warehouse is the wiki: a folder of markdown, one durable fact per page, linked from an index that acts as the front door.

CLAUDE.md  (always loaded, small)
  ↓ bootstraps
wiki/index.md  (the front door, what exists, what to read when)
  ↓ loads only what's relevant
topic pages  ·  regressions  ·  running log

What goes where

Keeping it honest: enforcement

A wiki that depends on you remembering to update it will rot. So the pattern leans on enforcement, not discipline: a hook flags changed files for re-documentation, a scheduled pass hunts stale pages and dead links and reports to a channel you actually read, and a rule says work isn't "done" until the docs reflect it. A warning written to a log nobody reads is the same as no check at all.

Why it's worth the setup

Because the file is named for Claude, but the payoff is model-agnostic. When a new model or tool ships, you point it at the same wiki and it resumes with your context instead of a blank chat. This is the CLAUDE.md-flavored version of the Karpathy memory system: durable, owned, file-based memory, with the config file as its front door.

Frequently asked

Why not just put everything in CLAUDE.md?
It grows until it's too big to load every session and too tangled to maintain. A linked wiki keeps the always-loaded file lean and lets the model pull only what it needs. CLAUDE.md becomes the router, not the warehouse.
Does this only work with Claude?
No. The bootstrap file is the only Claude-specific piece, and it's a few lines. Any assistant that reads files at session start can use the same wiki.
How big should CLAUDE.md be?
Small enough that loading it every session costs nothing you'd notice. If it's growing, that's the signal to move a section into the wiki and leave a pointer.

Get the full template

The CLAUDE.md + wiki + enforcement system, documented and free. Forkable in an afternoon.

Read the Karpathy+ guide Have it built for you