agentleFS
mnzraleemnzralee/claude-multi-agent-architecture/.claude/skills/claude-mem/SKILL.md

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

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
  1. Very specific:

    Do not duplicate across layers.

    line 27
  2. Very specific:

    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 …

    line 35
  3. Very specific:

    Never store secrets: No tokens, passwords, keys, connection strings or personal data.

    line 37
  4. Very specific:

    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 …

    line 39
  5. Distinctive:

    Create it from this template the first time, only when the user asks or invokes this skill in a repo without one:

    line 43
  6. Very specific:

    Session start: read PROJECT_CONTEXT.md. If it is missing and the user did not ask for it, do not create it.

    line 101
  7. Very specific:

    Before updating: run git log --oneline -10 and git status to ground what actually changed, and ls every path you are about to list.

    line 102
  8. Distinctive:

    Updating: use Edit for targeted section rewrites.

    line 103
  9. Very specific:

    Commit it together with the code it describes (docs(context): ...) when the project commits per logical step.

    line 105

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

LayerScopeHoldsLifecycle
PROJECT_CONTEXT.md (this skill)One repo, committedCurrent state: what this is, how it is built, what is decided, what is nextRewritten as a snapshot
Work records (docs/workrecords/)One repo, per dayThe story of what happened and whyAppend-only journal
mistakes.log (napkin)One repoErrors made and the rule that prevents eachAppend-only
Claude's own memoryOne user, privatePreferences and facts about the userManaged by Claude Code

Do not duplicate across layers. PROJECT_CONTEXT.md links to the others; it never copies them.

Rules

  1. Read first. At the start of work in a repo, read PROJECT_CONTEXT.md if it exists, before proposing anything. Treat its Decisions section as settled unless the user reopens one.
  2. 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.
  3. 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.
  4. 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-NNN and add the new line.
  5. 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 evidence (a commit, a passing test). Never record intent as fact.
  6. 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.
  7. 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.log

Examples

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 -10 and git status to ground what actually changed, and ls every 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.md must 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.