# quick-add
Start a message with # and Claude appends it to the right memory file — the fastest way to teach a durable rule mid-session.
If Codex treats memory as a pipeline, Claude Code treats it as a library of files you can read. Memory here is human-first: a hierarchy of plain-Markdown instructions plus a model-managed directory of facts — everything diffable, version-controllable, and yours.
This is the technical companion to the Codex teardown. Read both, then the comparison — the two philosophies are nearly opposite, and the best system borrows from each.
Codex's memory is something a worker processes. Claude Code's is something a human reads. One optimizes for pipelines; the other for trust and editability.
Claude Code's memory is not one store but two cooperating ideas, both file-based:
CLAUDE.md files that are loaded into context at the start of every session. Always-on, hierarchical, the "house rules."memory/ directory of small fact files the model reads and writes on demand, surfaced by relevance during a session.Both are just text on disk. There's no opaque database, no embedding blob you can't inspect. You can cat any of it, edit it by hand, commit it to git, and move it between machines. That legibility is the design philosophy.
Instruction memory cascades from broad to specific, and it composes — every layer in scope is concatenated into context at launch. Lower, more-specific files refine the ones above them.
enterprise policy /Library/.../ClaudeCode/CLAUDE.md (org-managed) ▼ user memory ~/.claude/CLAUDE.md (all your projects) ▼ project memory ./CLAUDE.md (checked into the repo) (the team) ▼ local / subtree ./sub/dir/CLAUDE.md (loaded when relevant)
Two mechanics make it powerful:
@path/to/file.md — recursively, several hops deep — so you compose memory instead of writing one monster file.On this machine the user layer (~/CLAUDE.md) is the home-base operating manual — startup ritual, the agent fleet, comms rules. The project layer governs each repo's conventions.
The second system is a model-managed folder of small, single-fact files with structured frontmatter, plus a MEMORY.md index that's loaded each session. The model reads the index, decides which facts are relevant, and pulls them in — and writes new ones as it learns. Recall by relevance, not by always-on bulk.
The index. One line per fact, loaded every session. Cheap to scan; the model expands only what's relevant. Pointers, never the full content.
# Memory Index
## Feedback
- [feedback_pace.md](feedback_pace.md) — one chunk at a time, no scope creep
- [feedback_db_retrieval.md](...) — query the DBs mid-task, don't rely on context
## Projects
- [project_agent_fleet.md](...) — fleet roster + upgrade path
## Reference
- [design-system.md](...) — locked tokens + components
One fact, one file. Frontmatter classifies it; the body holds the fact, with [[links]] to related memories. The model writes these as it learns, then adds a pointer to the index.
--- name: feedback-pace description: process one chunk at a time; avoid scope creep metadata: type: feedback --- Don't rush. Finish one chunk before starting the next. Why: rushing produced half-done work that needed redoing. How to apply: ship a slice, confirm, then continue. See [[feedback-db-retrieval]].
The frontmatter type — user · feedback · project · reference — is how the model decides what a memory is for. It's a lightweight classification, not a provenance ledger (no fact-vs-inference status) — a gap the portable layer closes.
Three human-facing levers, all of which just edit files:
# quick-addStart a message with # and Claude appends it to the right memory file — the fastest way to teach a durable rule mid-session.
/memoryOpen the memory files in your editor to review, prune, or rewrite by hand. Memory you can audit and curate.
/initScaffolds a project CLAUDE.md by scanning the repo — a starting set of house rules to refine.
The model adds fact files + index pointers on its own as it learns, then a consolidation pass keeps the set deduped.
The home-base setup shows the model's intended shape — and where people bolt on more. Three tiers, increasingly structured:
MEMORY.md + fact files; each fleet agent (data-miner, the briefing agents) has its own, so recall is scoped per agent.That third tier is the tell: file memory is excellent for instructions and human-curated facts, but the moment you need a ledger, a promotion gate, or graph relationships, you reach for a database. Which is exactly the Fleet Memory v2 argument.
Every memory is plain Markdown you can read, edit, and trust.
Project memory lives in git with the code — reviewable in PRs.
Enterprise → user → project, with @imports. No monster file.
The memory tool pulls only what matters, not the whole bulk.
No leased, retryable workers — consolidation is best-effort.
type classifies, but nothing marks fact vs inference vs refuted.
It's on your disk, in Claude's format — not shared with Codex or Grok.
Always-on CLAUDE.md competes for context; big sets need discipline.
The strengths are the inverse of Codex's, and so are the gaps. That's the whole reason the next page exists.