This skill should be used at the start of every session to load persistent memory, during work to record key decisions and facts, and at session end to prune stale entries. It manages the lifecycle of recent-memory, long-term-memory, and project-memory files. Activate automatically on every session.
Manage persistent memory across Claude Code sessions. Load context at startup, record during work, prune on exit.
Claude Code has no memory between sessions. Every new conversation starts cold. This skill creates a persistent memory layer using markdown files so that decisions, preferences, patterns, and project context survive between sessions.
~/.claude/memory/
├── recent.md ← rolling 48-hour context (loaded inline at startup)
├── long-term.md ← distilled facts and patterns (referenced by path)
├── projects/
│ └── <slug>.md ← per-project state (loaded when working on that project)
└── index.json ← metadata: timestamps, entry counts, sizes
At the start of every session:
~/.claude/memory/recent.md inline. This is your short-term context.~/.claude/memory/long-term.md — do NOT read it inline. Reference it when you need a deep lookup.$PWD or git remote. If a matching file exists in ~/.claude/memory/projects/, load its ## Active Work section inline.If ~/.claude/memory/ does not exist, create it:
mkdir -p ~/.claude/memory/projects
If recent.md does not exist, create it with a header:
# Recent Memory
Rolling 48-hour context. Auto-pruned entries older than 48 hours.
After any significant event, append an entry to ~/.claude/memory/recent.md:
### YYYY-MM-DD HH:MM [tag]
One-line summary of what happened.
Context: project=<slug>, files=<relevant files>
Tags (always use exactly one):
[decision] — a design or implementation choice was made[preference] — user expressed a preference (style, tool, approach)[fact] — a discovery about the codebase, API, or environment[error] — an error was encountered and resolved[pattern] — a recurring pattern was identified[context] — important background context for future sessionsWhat to record (be selective — not every action):
What NOT to record:
Before session ends or when memory feels heavy:
recent.md for entries with timestamps older than 48 hours.[pattern] or [preference]), note it for promotion to long-term memory.index.json:
{
"recent": { "entries": 12, "last_updated": "2026-04-10T13:00:00Z" },
"long_term": { "entries": 45, "last_updated": "2026-04-09T02:00:00Z" },
"projects": { "lumacv": "2026-04-10T12:30:00Z" }
}
recent.md under 200 lines. If it exceeds this, prune aggressively.~/.claude/memory/ is not writable: warn the user, proceed without memory. Do not fail.recent.md is corrupted: back up the file, create a fresh one, warn the user.