claude-code-memory
Skill0 starsChanged 7 months agoMITView on GitHub
Use when you want to set up, maintain, or review a Claude Code style layered memory workflow, including `CLAUDE.md` rules, session memory, durable memory, and promotion of stable learnings into instruction files.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- jnerytech/specdtheir own version, first seen Jul 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- jnerytech/specd★ 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.
The file
Show its rules and text
We split this skill into the rules it gives an agent
28 rules. About 0 are common, 26 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈26
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 8
Use this skill when the task involves memory design or memory hygiene for Claude Code or a similar coding agent.
- Distinctive: line 26
Treat the host instruction file as the rule layer.
- Distinctive: line 28
Put information here only if it is:
- Distinctive: line 43
Do not place transient task state here.
- Distinctive: line 80
Keep it concise but concrete.
- Very specific: line 84
Use .agent-memory/ for long-lived memories that should survive across conversations.
- Distinctive: line 88
Use the following durable memory types:
- Distinctive: line 105
run tests before proposing a commit
- Distinctive: line 106
avoid long recap paragraphs
- Distinctive: line 107
prefer one bundled refactor PR in this codebase
- Distinctive: line 158
Do not save these unless there is a strong reason and the non-obvious part is the actual point:
- Distinctive: line 167
If it can be recovered cheaply from the current repo, prefer not to save it as durable memory.
- Distinctive: line 171
Never trust durable memory blindly.
- Distinctive: line 173
Before acting on it:
- Distinctive: line 175
verify named files still exist
- Distinctive: line 177
prefer current repo state over historical memory if they conflict
- Distinctive: line 178
update or remove stale memories when you discover drift
- Distinctive: line 182
When reviewing memory, classify each item:
- Distinctive: line 185
Keep in durable memory
- Distinctive: line 186
Keep only in session memory
- Distinctive: line 187
Delete as stale, duplicate, or overfit
- Distinctive: line 190
Keep it in durable memory when it remains useful context but is not a rule.
- Distinctive: line 191
Keep it only in session memory when it is tied to the present thread.
- Distinctive: line 195
When the user asks to review memory:
- Distinctive: line 197
Read the host instruction file such as CLAUDE.md
- Distinctive: line 199
Read the most relevant durable topic files
- Very specific: line 200
Read .agent-memory/session/summary.md if current-thread context matters
- Distinctive: line 207
Do not modify durable memory or instruction files without user approval unless the user explicitly asked you to apply the cleanup.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Overview
Use this skill when the task involves memory design or memory hygiene for Claude Code or a similar coding agent.
This skill organizes memory into three layers:
- Instruction memory
- Session memory
- Durable memory
The intent is to keep each layer narrow, useful, and easy to trust.
Before you start
- Identify the host tool's instruction file. For Claude Code this is usually
CLAUDE.mdorCLAUDE.local.md. Other common examples areAGENTS.mdand.github/copilot-instructions.md. - Identify or create a repo-local durable memory directory. The default layout in this skill uses
.agent-memory/. - Identify or create the session summary file at
.agent-memory/session/summary.md.
Layer 1: Instruction memory
Treat the host instruction file as the rule layer. In Claude Code, this is the CLAUDE.md layer.
Put information here only if it is:
- stable
- normative
- broadly applicable across future work
- costly for the agent to rediscover incorrectly
Good candidates:
- test commands
- review expectations
- approval boundaries
- release process rules
- communication style preferences that consistently apply
Do not place transient task state here.
Layer 2: Session memory
Maintain .agent-memory/session/summary.md as the short-lived working notebook for the current thread.
It should answer:
- What is actively being worked on now
- What did the user ask for
- Which files and functions matter
- Which commands have already been run
- Which errors happened and how they were resolved
- What remains next
This layer should be updated during long tasks and before compaction or handoff.
Use this structure:
# Session Title
# Current State
# Task Specification
# Files and Functions
# Workflow
# Errors and Corrections
# Key Results
# WorklogKeep it concise but concrete. Prefer file paths, exact commands, and specific failure modes over generic summaries.
Layer 3: Durable memory
Use .agent-memory/ for long-lived memories that should survive across conversations.
Store durable memories in topic files and keep .agent-memory/MEMORY.md as an index.
Use the following durable memory types:
user-profile
Information about the user's role, goals, background, and level of familiarity.
Examples:
- backend-heavy engineer who wants frontend explanations grounded in systems concepts
- founder who prefers quick trade-off summaries
working-style
Guidance about how to collaborate with this user or team.
Examples:
- run tests before proposing a commit
- avoid long recap paragraphs
- prefer one bundled refactor PR in this codebase
project-context
Important project facts that are not derivable from the repo.
Examples:
- freeze window dates
- stakeholder constraints
- migration rationale
- incident aftermath that still shapes decisions
external-reference
Pointers to systems outside the repo.
Examples:
- which dashboard matters for this codepath
- which Linear board tracks this class of bugs
- which Slack channel owns deployment coordination
Durable memory format
Each durable memory should live in its own file with frontmatter:
---
name: testing-policy
description: Integration tests in this repo must hit a real database
type: working-style
---
Integration tests in this repo must hit a real database.
Why:
A previous production migration failure was missed by mock-based coverage.
How to apply:
When changing data access or migrations, prefer real-db integration coverage over mocks.The index file should stay short:
- [Testing Policy](testing-policy.md) - Real database integration tests are expected hereWhat not to save as durable memory
Do not save these unless there is a strong reason and the non-obvious part is the actual point:
- file structure
- code architecture visible in the repo
- git history
- recent diff summaries
- temporary task state
- obvious commands already documented in project instructions
If it can be recovered cheaply from the current repo, prefer not to save it as durable memory.
Recall discipline
Never trust durable memory blindly.
Before acting on it:
- verify named files still exist
- grep for named functions or flags
- prefer current repo state over historical memory if they conflict
- update or remove stale memories when you discover drift
Promotion workflow
When reviewing memory, classify each item:
- Promote to instruction memory
- Keep in durable memory
- Keep only in session memory
- Delete as stale, duplicate, or overfit
Promote into the instruction layer when the item has become a rule. Keep it in durable memory when it remains useful context but is not a rule. Keep it only in session memory when it is tied to the present thread.
Review workflow
When the user asks to review memory:
- Read the host instruction file such as
CLAUDE.md - Read
.agent-memory/MEMORY.md - Read the most relevant durable topic files
- Read
.agent-memory/session/summary.mdif current-thread context matters - Produce a report with:
- promotions
- cleanup
- conflicts
- ambiguous items
Do not modify durable memory or instruction files without user approval unless the user explicitly asked you to apply the cleanup.
File layout used by this skill
.agent-memory/
├── MEMORY.md
├── user/
├── style/
├── project/
├── references/
└── session/
└── summary.mdReferences
- Architecture notes: references/architecture.md
- Host tool mapping: references/host-tool-mapping.md
- Example durable memory files: examples/persistent-memory/MEMORY.md
- Example session summary: examples/session-memory/summary.md
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.

