← ClaudeAtlas

memory-architecturelisted

Keeps coding-agent memory cheap and true, so Claude stops forgetting between sessions, re-reading bloated CLAUDE.md files, redoing research and acting on stale notes. Knows which files actually load and when (CLAUDE.md at every level, AGENTS.md, .claude/rules, MEMORY.md), where each fact belongs, and the gates that stop it rotting. Ships a self-testing audit script and a 0-10 score. Use it for any question about those files, even a narrow one, before answering from memory or searching by hand. That includes which CLAUDE.md files load in a folder, whether the paths an AGENTS.md or CLAUDE.md mentions still exist, why an agent ignored or broke a rule it was given, how to make Claude Code, Cursor and Codex follow the same rules, how to set up, audit, slim down or clean up agent memory, where a rule or fact should live, and why an agent keeps forgetting, redoing work or burning tokens. Also use it before saving a memory or writing an agent-facing doc, even if nobody says "memory".
nicuk/claude-md-memory-architecture · ★ 1 · AI & Automation · score 62
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