claude-mem
Skill9 starsChanged 2 months agoMITView on GitHub
Persistent project memory. Keeps a PROJECT_CONTEXT.md at the repo root holding the project's purpose, stack, commands, file map, locked decisions, current state and next steps. Reads it at the start of work and updates it at the end of every session that changed something. Use when the user says "claude-mem", "remember this for next time", "update project context", "where were we" or "pick up where we left off", at the start of work in any repo that already has PROJECT_CONTEXT.md, and before ending a session that changed code or decisions. Composes with ponytail and napkin. Not for personal preferences about the user (Claude's own memory holds those), and not for a repo that already runs its own state discipline.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- alebgl77/claude-inctheir own version, first seen Jul 28, 2026
- williamcorrea23/sap-router-skilltheir own version, first seen Jul 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- alebgl77/claude-inc★ 21same name
- williamcorrea23/sap-router-skill★ 1same 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 repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- context/CLAUDE.mdCLAUDE.md
- api-designSkill
- backendSkill
- cavemanSkill
- commitSkill
- evaluator-optimizerSkill
- founder-skillSkill
- frontend-design-systemSkill
- interactive-live-testingSkill
- module-planningSkill
- multi-agent-orchestrationSkill
- napkinSkill
- plan-featureSkill
- ponytailSkill
- prSkill
- ralph-loopSkill
- review-boardSkill
- reviewSkill
- systematic-debuggingSkill
- tdd-workflowSkill
- verification-before-completionSkill
- verificationSkill
- work-recordingSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Do not duplicate across layers.
- Very specific: line 35
Verify before you write: Every path in the File Map exists (ls it), every command is one that runs, every "done" in Current State points at …
- Very specific: line 37
Never store secrets: No tokens, passwords, keys, connection strings or personal data.
- Very specific: line 39
If the repo already runs its own state discipline (a knowledge base with its own index and changelog, or a canonical state file the user …
- Distinctive: line 43
Create it from this template the first time, only when the user asks or invokes this skill in a repo without one:
- Very specific: line 101
Session start: read PROJECT_CONTEXT.md. If it is missing and the user did not ask for it, do not create it.
- Very specific: line 102
Before updating: run git log --oneline -10 and git status to ground what actually changed, and ls every path you are about to list.
- Distinctive: line 103
Updating: use Edit for targeted section rewrites.
- Very specific: line 105
Commit it together with the code it describes (docs(context): ...) when the project commits per logical step.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Claude-mem: persistent project memory
You are the project's chief of staff. Every session starts cold, with no memory of yesterday's decisions, last week's dead ends, or the folder somebody renamed. Your job is to make the next session start warm, by keeping one short, true, current file that any agent or person can read in two minutes.
Input: $ARGUMENTS
The problem this fixes
Without it, every session rediscovers the stack, relitigates settled decisions, and proposes again the approach that was already tried and rejected. Work done in one session is invisible to the next. Notes, when they exist at all, are scattered through chat history nobody can search.
Where it sits among the memory layers
| Layer | Scope | Holds | Lifecycle |
PROJECT_CONTEXT.md (this skill) | One repo, committed | Current state: what this is, how it is built, what is decided, what is next | Rewritten as a snapshot |
Work records (docs/workrecords/) | One repo, per day | The story of what happened and why | Append-only journal |
mistakes.log (napkin) | One repo | Errors made and the rule that prevents each | Append-only |
| Claude's own memory | One user, private | Preferences and facts about the user | Managed by Claude Code |
Do not duplicate across layers. PROJECT_CONTEXT.md links to the others; it never copies them.
Rules
- Read first. At the start of work in a repo, read
PROJECT_CONTEXT.mdif it exists, before proposing anything. Treat its Decisions section as settled unless the user reopens one. - Update at the end of every session that changed something: code, a decision, the file layout or the plan. Also update right after a decision is locked mid-session, so it survives a crash or a context reset. A session that changed nothing leaves the file alone.
- Snapshot, not diary. Rewrite Current State, File Map and Next Steps to describe now; do not append to them. History lives in git and the work records.
- Decisions are append-only. Each locked decision gets one dated line with its reason. A reversed decision is never deleted: mark it
SUPERSEDED YYYY-MM-DD by D-NNNand add the new line. - Verify before you write. Every path in the File Map exists (
lsit), every command is one that runs, every "done" in Current State points at evidence (a commit, a passing test). Never record intent as fact. - Stay under 150 lines. Past that, compress: drop finished next steps, collapse the File Map to directories, move narrative to the work record. Short enough that reading it is never skipped.
- Never store secrets. No tokens, passwords, keys, connection strings or personal data. Name where a secret lives (
.env, the vault), never its value.
If the repo already runs its own state discipline (a knowledge base with its own index and changelog, or a canonical state file the user has named), do not create PROJECT_CONTEXT.md. Follow that repo's rules instead.
The file
Create it from this template the first time, only when the user asks or invokes this skill in a repo without one:
# PROJECT_CONTEXT
> Last updated: YYYY-MM-DD by <session or agent>. Read this first. It is the current state, not a history.
## Purpose
<One or two sentences: what this is and who it is for.>
## Stack
<Languages, frameworks, datastore, hosting. Versions where they matter.>
## Commands
<The real dev, test, build, lint and deploy commands. Only ones verified to run.>
## File Map
<The directories and key files that matter, one line each, with what lives there.>
## Decisions
- D-001 | YYYY-MM-DD | <decision> | why: <reason>
## Current State
<What works, what is half-built, what is broken. Each claim backed by a commit or a test.>
## Next Steps
1. <The single next action, specific enough to start without asking.>
## Open Questions
- <What is waiting on whom.>
## See also
- Work records: docs/workrecords/
- Mistakes: mistakes.logExamples
Example 1: recording a decision
Bad: Decided to use Postgres. No date, no reason, no id, so the next session cannot tell whether it is settled or why.
Good: - D-004 | 2026-11-28 | Postgres over SQLite for the API | why: two writers (API and worker) need row-level locking
Example 2: current state
Bad: Auth is done and working great. Payments mostly done.
Good: Auth: email magic link shipped (a1b2c3d), 14 tests pass. Payments: Stripe checkout session creates; webhook handler not written, see Next Steps 1.
Example 3: the end-of-session update
Bad: appending a 60-line "Session 7 summary" to the bottom, so the file grows forever and the current state is buried.
Good: rewrite Current State in place, remove the finished next step, add the new decision line, bump Last updated. Under ten changed lines.
Tool usage
- Session start: read
PROJECT_CONTEXT.md. If it is missing and the user did not ask for it, do not create it; mention once that claude-mem can start one. - Before updating: run
git log --oneline -10andgit statusto ground what actually changed, andlsevery path you are about to list. - Updating: use Edit for targeted section rewrites. Use Write only to create the file or after a compression pass.
- After updating:
wc -l PROJECT_CONTEXT.mdmust report 150 or fewer. - Commit it together with the code it describes (
docs(context): ...) when the project commits per logical step.
Output format
At session start, stay silent unless something matters, then use one line: Context loaded: <purpose>; next step is <Next Steps 1>. If the file contradicts the code, say so in one line and trust the code.
At session end, after the update:
PROJECT_CONTEXT.md updated
- Decisions: +D-005 (<short>)
- State: <what changed, one line>
- Next: <new Next Steps 1>Composition
- With napkin: the See also section points to
mistakes.log; entries are never copied in. - With ponytail: the Stack and Commands sections tell ponytail what is already installed, so minimal code reuses it.
- With the kit's work-recording skill: the work record tells the story, this file tells the state. Write both, duplicate neither.
- With the Operating Standard: this skill is how its "check memory for prior context and write findings back" snippet is made concrete at repo level.
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.

