Why it exists
Claude starts every session blank. What survives today is either too durable or too raw:
- CLAUDE.md and auto-memory hold facts that stay true for months. They are the wrong place for “the migration is half-done on
feat/queue, tests red on purpose”. claude --resumeholds the whole transcript, behind an id you have to find among dozens of sessions in the picker.- Commit messages say what changed. They do not say what was decided against, what is waiting on whom, or what comes next.
So I kept typing the same instruction into project after project:
Keep an untracked
_memoria.mdwith the resume command and a log of where we are.
This skill turns that into something that happens without asking, and fixes the parts that went wrong when I did it by hand.
By hand, and with the skill
| By hand | With the skill |
|---|---|
| The resume id was whatever someone remembered to paste, often stale | The SessionStart hook writes the current id and keeps the last five |
| Claude only read the file if told to | The hook loads it into context at startup, on resume, after /clear and after compaction |
| A session that ended abruptly left no trace | The SessionEnd hook appends its commits under “Unlogged sessions” for the next one to fold in |
Each repo needed the .git/info/exclude line added by hand |
Added automatically, with a warning if the file is ever tracked |
| The file grew without bound | A 400-line cap on what is loaded, and a /memoria prune routine |
What a session looks like
Mostly you do nothing. Open a session in a repo that has a _memoria.md and the first reply starts with where you left off:
> let's carry on
Where we left off: AI triage shipped (c4098d2). Next is the
scheduler and alerts. One open question: the positioning,
waiting on two prospect calls.
In a repo without one, Claude offers once to start it. It never creates the file unasked, because not every repo deserves one.
| Say | Effect |
|---|---|
/memoria init |
Create _memoria.md from the template and fill in what can be established |
/memoria save, “update memoria”, “save where we are” |
Update Now, Done, Decisions, Open questions, Next and Running it |
/memoria, “where did we leave off” |
A five-line summary |
/memoria prune |
Collapse old Done entries and drop answered questions |
The file
Seven sections, each with one job. The block at the top belongs to the hook; the rest belongs to you and Claude.
# _memoria — <project>
## Resume session id and resume command (written by the hook)
## Now what is in flight
## Repo remote, branch, history quirks, warnings
## Running it commands, ports, env var names (never values)
## Done dated, with commit hashes
## Decisions with the reason
## Open questions
## Next numbered, each doable in a sitting
The repository has a full worked example, anonymised from a real project.
Install
- Install the skill from the repo root:
./install.sh memoria, or.\install.ps1 -Skills memoriaon Windows. - Merge the hook block from
example-settings.jsoninto~/.claude/settings.json. Merge it; other hooks can sit alongside. - Restart Claude Code.
It needs bash and git, and Git Bash on Windows is enough. There is no jq and no network access.
The hooks are optional. Without them the skill still works in any agent: reading the file at the start of a session and saving it at the end are written out as plain steps. What you lose is the automatic part.
Configuration
Environment variables, all optional:
| Variable | Default | Meaning |
|---|---|---|
MEMORIA_FILE |
_memoria.md |
File name at the project root |
MEMORIA_MAX_LINES |
400 |
Lines loaded at session start |
MEMORIA_HISTORY |
5 |
Earlier session ids kept in the Resume block |
MEMORIA_STATE_DIR |
~/.claude/memoria |
Per-session state and memoria.log |
What it will not do
- Commit the file. It is excluded through
.git/info/exclude, so even your.gitignorestays untouched. - Store secrets. The file records the names of environment variables and where they live, never their values.
- Block a session. The hooks always exit 0 and log to
~/.claude/memoria/memoria.log. A broken hook costs you the summary, nothing else. - Rewrite a file it did not create. A hand-written
_memoria.mdwithout the resume markers is left alone; the hook asks Claude to convert it with you.