/checkpoint:checkpointfrom checkpoint
Persist a session before compaction — write the resume brief the next context window inherits, and update the issue ledger (progress.md, lessons.md) and memory so nothing that outlives the session is lost. Use at a phase boundary, when context passes ~70%, before running /compact, or any time you are about to hand the session over. Also invoke when the user says "lets pause and think about compaction" or asks what to persist before compacting.
Ships in checkpoint. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Compaction keeps roughly 2% of a context window. Everything that survives does so because it is on disk, not because the summary happened to mention it.
You are writing to two different time horizons, and conflating them loses work:
RESUME.md — the next window only. A SessionStart hook re-injects it
automatically after the next compaction, resume, or fork, then consumes it
(renames it). Nobody copies it by hand, and nobody reads it twice.progress.md,
lessons.md and the memory directory are what a session next week reads. They
are not consumed and not injected; they are found because someone wrote them
down deliberately.Anything durable that goes only into RESUME.md is gone one window later.
Step 4 exists to catch exactly that.
A resumed session inherits the format of the work from the artifacts around it, and silently loses the steps. In the real incident this mechanism exists for, a fresh window reconstructed a file bus's shape perfectly and dropped the step of reading a clock — then wrote ten plausible timestamps, one 31 minutes in the future, which were later used as evidence.
So: record what must be DONE, not what things look like. If a convention requires measuring something, say that it must be measured.
1. Resolve the path — do not guess it, and do not work around a refusal.
CKPT=$("${CLAUDE_PLUGIN_ROOT}/hooks/checkpoint-path.sh") || echo "CANNOT RESOLVE SESSION"
echo "$CKPT"
(CLAUDE_PLUGIN_ROOT is set for you when this skill runs from the installed
plugin. If it is empty, the plugin's hooks are not installed — say so rather
than substituting a path.)
If that fails, stop and tell the user. Do not invent a path, and do not invent a filename to sit alongside someone else's — writing to the wrong directory is worse than not writing at all, because it silently mixes two sessions' state and can serve one agent another's plan.
This is not hypothetical. An earlier version of the resolver guessed the session
by picking the most recently modified transcript, so every concurrent session
resolved to the same directory. Four unrelated briefs — from four different
projects, in four different panes — landed in one folder and overwrote each
other. The agents involved noticed and began inventing suffixed filenames
(RESUME.<topic>-<timestamp>.md) to protect their own work.
That instinct was right about the danger and wrong as a fix: it left the shared
RESUME.md pointing at whichever session wrote last, so the restore hook served
the wrong brief and the real ones were never read. If the path is wrong, say
so — do not route around it.
2. Measure, don't recall. Before writing anything, run the commands. Never fill a field from memory of what it was earlier in the session:
git rev-parse HEAD; git rev-parse --abbrev-ref HEAD
git status --porcelain | head -20
date -u +%Y-%m-%dT%H:%M:%SZ
3. Write $CKPT/RESUME.md using the sections below. Omit any section that
genuinely does not apply — an empty section is noise, but a missing fact is a
defect. If something cannot be determined, write unknown rather than a
plausible value.
# RESUME — <one-line topic> (post-compaction brief)
> Written <UTC timestamp you just measured>, at <phase / point in the work>.
## THE NEXT ACTION
<The single specific thing to do next: the command, the file, the step. Not the
area of work. Someone with no memory of this session should be able to act on
this line alone.>
## State, measured
Branch <name> @ <sha>. <N> dirty paths: <the ones that matter and why>.
Pushed? <yes/no>. Deliberately uncommitted: <anything that must NOT be tidied,
and what breaks if someone tidies it>.
## Owner decisions
Made: <decision — and what it rules out>.
Pending: <what is waiting on the owner, and what is blocked until it lands>.
## Procedure that lives only in the doing
<Steps a fresh window would not infer from the artifacts. Anything that must be
measured rather than matched. Invocation flags, orderings, gotchas already hit.>
## Live things to re-arm
tmux <session/panes>, worktrees <paths>, background shells, monitors, anything
awaiting a reply. NOTE: teammate agents and TaskList do NOT survive a
compaction — list who must be respawned and from which brief.
## Claimed but not yet verified
<Anything asserted this session that has not been observed passing. This is the
first thing a resumed session should re-check.>
## Remaining pipeline
<Numbered steps to done, with exact refs or commands.>
4. Persist what outlives this session — not just the brief.
RESUME.md is short-term. It is consumed once, by the next window, and then it
is gone. Anything that should survive past that has to land somewhere durable
now, while you still remember it. Work through these three and say explicitly
which ones did not apply:
a. The issue ledger — progress.md and lessons.md.
If this project keeps a per-issue ledger — a directory per unit of work holding
its own notes, e.g. docs/issues/<id>-<slug>/ — update it before compacting:
progress.md — what is now done, what is in flight, what is blocked and
on whom. State it so a reader who was never here can act. Convert relative
dates to absolute ones; "yesterday" is meaningless in a file.lessons.md — write for method, not outcome. "The deploy worked" is
worth nothing next quarter. "| tail masked a non-zero exit, so capture the
status first and print it separately" is worth everything. A lesson that
could not have changed what someone does is not a lesson.git checkout away
from gone, and the branch it lives on may not be where the next window lands.If there is no ledger for this work, say so rather than inventing one.
b. Memory — but only for what is genuinely new.
If this session changed what you know about how the project works, how the
owner wants to be worked with, or where things live, write it to the memory
directory now. Before writing, check for an existing memory covering it and
update that file instead of creating a near-duplicate, then add the one-line
pointer to MEMORY.md. Do not save what the repo already records — code
structure, git history, or anything a reader could derive by looking.
⚠️ If a memory was contradicted this session, fix or delete it. A confidently wrong memory is worse than a missing one, because the next window will act on it without re-checking.
c. Anything else a fresh window cannot re-derive.
Draft artifacts, a message you composed but have not sent, a command that took
three attempts to get right, credentials pathing, the exact query that produced
a number you cited. Put it in the ledger, the scratchpad, or the brief — but
put it somewhere, and reference the path from RESUME.md so it is findable.
⛔ Do not paste secrets, credentials, tokens or regulated data (PHI, PII, cardholder data) into any of these. The brief, the ledger and the memory are all read later by people and agents with different access than you have now. Reference where the data lives instead of reproducing it.
5. Confirm. Print the absolute path and the line count, and tell the user in one line what the next action is. State plainly which of 4a/4b/4c you updated and which did not apply — "no ledger for this work" is a useful answer; silence is not. If this is a swarm run, emit the confirmation on the bus — the brief existing on disk is what makes the handshake mechanical rather than remembered.
/checkpoint writes the short-term resume brief for the next window. If you
keep such an index, running both at a big boundary is reasonable.RESUME.consumed.<ts>.md. A second compaction without a fresh
/checkpoint correctly reports NO CHECKPOINT FOUND instead of serving a
stale brief under a green banner.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub scastillo/claude-checkpoint --plugin checkpoint