Context & memory·terminal·MIT
compact-keeper
A Markdown handoff in ~/.claude/handoffs for every compaction, with the resume command.

compact-keeper saves a Markdown file each time Claude Code compacts the conversation, so the context that /compact replaced can be recovered later. It covers manual and automatic compactions, adds nothing to the context and costs no tokens.
What it saves
One file per compaction in ~/.claude/handoffs/, named by date, time, project folder and the first eight characters of the session id, such as 2026-10-03-0952-my-app-4f9c2a1e.md. Each file holds:
- the time of the compaction, whether you or Claude Code started it, and the token count before and after
- the working directory and the session id, with the
claude --resumecommand that reopens the session - the instructions you gave
/compact, if any - the files edited since the previous compaction
- the summary Claude Code wrote to replace the conversation
A toast shows the file’s path once it is saved.
Install
Needs Claude Code 2.1.287 or later.
claude plugin marketplace add arasovic/claude-code-mods
claude plugin install compact-keeper@claude-code-mods
Restart Claude Code. There is nothing to open: the next compaction writes the first file.
The marketplace holds fourteen mods by the same author, among them session-meter. Its name, claude-code-mods, is also used by hamzafer’s and karanb192’s marketplaces; if you added one of those, the add clashes, so remove it first with claude plugin marketplace remove claude-code-mods.
How it works
The mod hooks two events. On tool.call it watches only the Edit and Write tools: when one succeeds, it records the file path, keeping the 100 most recent. It does not read file contents. On session.compact it lets the compaction finish, writes the handoff to your home folder and empties the list.
Compactions run by a subagent are skipped, and so are summaries prepared in advance that may never be applied. If the write fails, the compaction goes ahead as normal. The mod makes no network calls.
Limitations
- Only edits made through the Edit and Write tools appear in the file list. Files changed by shell commands are not listed.
- Nothing deletes old handoffs, so the folder grows by one file per compaction.
Similar Claude Mods
compact-handoff
Like /compact, but the conversation becomes your validated /handoff and work carries on.
cs
Rotate and wrap keys above the prompt from 40% context, forced rotation at 80%. Needs cs.
auto-handoff
Hands a long session to a fresh one with a Haiku-written brief instead of compacting.
handoff-compact
Compaction becomes a handoff: goal, proof, decisions, dead ends and the next step.
Popular Claude Mods
The whole directory →blast-radius
Shows what rm -rf or a force push would change and waits for Proceed or Cancel.
cache-keeper
Prompt-cache timer, keep-warm pings, cold-send guard, a board of chats and a handoff.
firstmate-calm
Hides tool rows and swaps the spinner for a sailboat. Toggle with /calm, zero tokens.
prompt-rail
Your session's prompts as a rail: hover to read one, click to jump back to it.



