memory-architecture
Skill1 starsChanged 7 months agoMITView on GitHub
Five-layer memory architecture: where each fact lives, how layers interact, when to promote learnings
5 other projects use a version of this.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- Bitterbot-AI/bitterbot-desktoptheir own version, first seen Oct 8, 2026
- nicuk/claude-md-memory-architecturetheir own version, first seen Sep 27, 2026
- d-padmanabhan/agent-engineering-handbooktheir own version, first seen Sep 18, 2026
- sefaertunc/Worclaudeword for word, first seen Apr 28, 2026
Other versions5 projects use a version of this.
Word for word · 1
- sefaertunc/Worclaude★ 4100% same
Edited · 0
None found.
Wrote their own version · 4
- Bitterbot-AI/bitterbot-desktop★ 2.5ksame name
- d-padmanabhan/agent-engineering-handbook★ 17same name
- nicuk/claude-md-memory-architecture★ 0same name
- thistleknot/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-routingSkill
- backend-conventionsSkill
- claude-md-maintenanceSkill
- coding-principlesSkill
- context-managementSkill
- coordinator-modeSkill
- frontend-design-systemSkill
- git-conventionsSkill
- planning-with-filesSkill
- project-patternsSkill
- prompt-engineeringSkill
- review-and-handoffSkill
- security-checklistSkill
- subagent-usageSkill
- testingSkill
- verificationSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
When a fact, rule, or pattern surfaces during a session, route it like this:
- Distinctive: line 39
Default rule: if you cannot point to a specific reason a fact belongs in a different layer, it does not belong in CLAUDE.md.
- Distinctive: line 100
Do delete stale learnings.
- Distinctive: line 104
Do read the file before recommending an update.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Memory Architecture
Worclaude projects use five distinct memory layers. Each has a different scope, owner, and lifecycle. Routing a fact to the correct layer is a load-bearing decision — the wrong layer means the fact is invisible when needed, or noisy when not.
The Five Layers
| Layer | Scope | Owner | Lifecycle |
CLAUDE.md | Team | Manual (humans + Claude via /update-claude-md) | Stable, lean (target ~200 lines) |
.claude/rules/ | Team | Manual, topic-organized | Stable; optionally path-scoped (deferred — see BACKLOG) |
.claude/learnings/ | Team | Hook-captured (learn-capture.cjs) | Append-only; transient inputs to promotion |
CLAUDE.local.md | Personal | Manual; gitignored | Per-machine sandbox; never shared |
| Claude Code auto memory | Personal | Autonomous (Claude) | Active, self-pruning |
The line between team and personal is the most important boundary. Team layers are committed and shared with collaborators; personal layers stay on the local machine.
Routing Contract
When a fact, rule, or pattern surfaces during a session, route it like this:
| Source | Destination |
A team-relevant rule the user wants enforced — typed [LEARN] block or /learn invocation | .claude/learnings/<category>.md (via hook) |
| A personal preference (workflow, tone, naming whim) | Claude Code auto memory (Claude does this autonomously when noticed) |
| A machine-local sandbox value (paths, secrets, dev URLs) | CLAUDE.local.md (manual; gitignored) |
| A topic that has accreted multiple learnings AND is stable | Promote to CLAUDE.md via /update-claude-md |
Default rule: if you cannot point to a specific reason a fact belongs in
a different layer, it does not belong in CLAUDE.md. CLAUDE.md is the
last layer to grow, not the first.
Layer Interactions
CLAUDE.mdis the read-on-every-session layer. It is loaded into context at session start and after every/compact. Long files waste context on every interaction. Stay under ~200 lines of actual content..claude/learnings/is the staging area. Hooks write here on every[LEARN]block. Same category = same file = appended block, so a file that grows multiple**Rule:**entries signals recurrence. Theindex.jsoncreatedfield is updated to the latest capture date — use it as a "last touched" timestamp, not a fixed creation date.- Auto memory runs in parallel. Claude Code maintains
~/.claude/projects/<project-slug>/memory/autonomously. It is per-machine and personal. Worclaude does not write to it and does not read from it during/update-claude-mdpromotion (deliberate scope boundary — see BACKLOG for the discussion). CLAUDE.local.mdoverridesCLAUDE.mdfor the local machine. Use it for facts that are genuinely user-specific within an otherwise shared project. Do not commit it..claude/rules/is reserved. Claude Code's official docs recommend it for topic-organized, optionally path-scoped team rules. Worclaude defers scaffolding it until a usage signal exists; users can still create the folder manually. Do not duplicateCLAUDE.mdcontent into.claude/rules/ad-hoc.
Promotion Path: Learnings → CLAUDE.md
Promotion is the bridge from .claude/learnings/ to CLAUDE.md. It is
deliberately gated by /update-claude-md rather than automatic — promotion
is a content decision, not a mechanical one.
A learning is a promotion candidate when at least one of these holds:
- Recurrence: the learning's file in
.claude/learnings/has 3 or more**Rule:**blocks (i.e., the same category was captured at least three times). Counted by scanning the file, not the index. - Recency cluster: the index entry's
createddate is within the last 14 days AND the same theme has shown up in another recent learning. Recent + repeated > recent alone. - Drift: the learning's content is structurally relevant to an
existing
CLAUDE.mdsection (e.g., a new "always do X" pattern that would naturally live in## Critical Rulesor## Gotchas) but the pattern is missing from the file.
Even when a candidate qualifies, /update-claude-md confirms each
proposed addition with the user via AskUserQuestion. No silent writes.
Don't / Do
- Don't edit
.claude/learnings/files by hand to "fix" them. They are the raw capture surface. If a learning is wrong, fix the rule inCLAUDE.mdor remove the learning file. - Don't scaffold
.claude/rules/content from oldCLAUDE.mdsections "to makeCLAUDE.mdsmaller." Splitting into sub-files just fragments the single source of truth without saving context. - Don't mix personal preferences into team layers. If something
applies only to your local workflow, it belongs in
CLAUDE.local.mdor Claude Code's auto memory — not inCLAUDE.md. - Do delete stale learnings. If a category was captured once eight months ago and never recurred, it is noise.
- Do prune
CLAUDE.mdwhen it crosses 200 lines.worclaude doctorwarns at 150 and errors at 200. Pruning is part of maintenance. - Do read the file before recommending an update. Memory across sessions is not authoritative — current file content is.
Cross-References
/learn— captures a[LEARN]block to.claude/learnings/./update-claude-md— proposes promotions from learnings toCLAUDE.md, with size + dedup gates.claude-md-maintenanceskill — what belongs inCLAUDE.md, format discipline, the 200-line target.worclaude doctor— surfaces drift betweenCLAUDE.mdclaims andpackage.jsonreality (see Phase 3 T3.8).
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.

