🩺 CPR for Claude Code
Compress, Preserve & Resume
Persistent memory across sessions. Never lose context again.
Estimated ~66% reduction in session-restart token cost (analytical model, range 51-74%).
/cpr:preserve
Save key learnings to CLAUDE.md
|
/cpr:compress
Capture the full session to a searchable log
|
/cpr:resume
Restore context from past sessions
|
Three skills and two hooks that save, search, and restore your conversation context, so you can pick up exactly where you left off.
Is it for me? •
Problem •
Solution •
Why It Saves Tokens •
Installation •
Usage •
Workflow •
Upgrading •
FAQ
What Is CPR?
CPR is a Claude Code plugin. It adds three slash commands and two hooks:
| Piece | What it does |
|---|
/cpr:compress | Writes a structured, searchable session log. A script appends the raw transcript. |
/cpr:preserve | Updates CLAUDE.md with the learnings every future session should start with. |
/cpr:resume | Loads recent session summaries and searches past sessions by topic. |
| PreCompact hook | Saves the raw transcript before every compaction, manual or automatic. |
| SessionStart hook | Hands the model a short memory brief when a session starts or compacts. |
No build step, no dependencies beyond Python 3.10, and every file is plain markdown or a small script you can read.
Is CPR For Me?
Yes if you work on the same project across several Claude Code sessions and find yourself re-explaining what happened last time, or if you want the full conversation kept on disk and searchable by topic rather than flattened into a compaction summary.
No if your sessions are one-off fixes or throwaway scripts. There is no next session to pay the save back.
CPR sits next to CLAUDE.md and Claude Code's auto memory rather than replacing them. CLAUDE.md holds instructions, auto memory holds preferences, CPR holds the state of the work. Install takes one line, and removing it is /plugin uninstall cpr@cpr.
The Problem
Claude Code has no memory of the work between sessions. When you close a conversation, the decisions, the fixes, the paths and the reasons go with it.
It gets worse: