memory-architecturelisted
Install: claude install-skill nicuk/claude-md-memory-architecture
# Memory architecture for coding agents
Memory exists for one reason: so the next session does not pay again for what this one
already learned. Two things undo that. Memory that is **expensive** gets loaded every
session whether it is needed or not. Memory that is **false** sends the next session the
wrong way while sounding sure of itself. Everything below guards against one or the other.
Two ideas carry the whole skill:
1. **Put each fact in the cheapest layer that the agent who needs it will still find.**
Every layer has a load cost (when it enters context) and a rot rate (how fast it goes
stale). The two usually trade off against each other.
2. **A claim with an enforcer stays true; a claim with only an author rots.** Anything
that can go stale either gets something that fails when it does, or it gets written as
dated history rather than as a present-tense fact.
## The layers
Load behaviour below is Claude Code's documented behaviour. Other harnesses differ, so
confirm yours with `/memory` or its docs before relying on a row.
| Layer | Enters context | Holds | Never holds |
|---|---|---|---|
| **Global** `~/.claude/CLAUDE.md` | every session, every repo | preferences true in a repo you haven't created yet | anything naming a stack, a path, a command or a project |
| **Project root** `CLAUDE.md` / `AGENTS.md` | every session in the repo | the constitution: rules that forbid, require or disambiguate a decision, plus pointers to canonical docs | how-to (goe