/cpr:compress [quick] [topic-name]from CPR: Compress, Preserve & Resume
Saves the current Claude Code session as a searchable CPR log with a curated summary and raw transcript. Run before /compact or ending a session to preserve context for future sessions.
Ships in CPR: Compress, Preserve & Resume. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Save this conversation as a session log that a future session can load in seconds and search by topic. The log has two parts: a structured summary you write, and the raw transcript a script appends. Run it before /compact or before ending the session. The CPR hooks also autosave the raw transcript before every compaction, so this skill is where the curated summary comes from.
!python3 "${CLAUDE_PLUGIN_ROOT}/scripts/cpr_paths.py"
Session id for the raw transcript: ${CLAUDE_SESSION_ID}
$ARGUMENTS
quick: skip the three questions below. Include every section that has real content, and derive the topic name yourself.Ask them with AskUserQuestion, one call each. The tool adds its own free-text option, so never add an "Other" option and never fall back to a plain-text prompt.
Skip and Add a custom note. A free-text answer is the note, kept verbatim.api-auth-refactor). Single-select, header "Topic name", exactly two options: Accept: {suggested-name} and Provide a different name. A free-text answer is the topic, normalised to lowercase and hyphens.Filename: {timestamp_slug}-{topic}.md inside logs_dir from the block above. Create the folder if it is missing. Write only the sections the user chose, plus the three that are always present: Quick Reference, Quick Resume Context, and Custom Notes.
# Session Log: {timestamp_display} - {topic}
## Quick Reference (for AI scanning)
**Confidence keywords:** {10-20 search terms: project names, technologies, actions, identifiers, people relevant to decisions}
**Projects:** {project names or references mentioned}
**Outcome:** {one sentence}
## Decisions Made
- {decision and the reason}
## Key Learnings
- {learning}
## Solutions & Fixes
- {what was broken, what fixed it, the command or code if short}
## Files Modified
- `{path}`: {what changed}
## Setup & Config
- {exact values: paths, flags, env names. Never paraphrase an identifier}
## Pending Tasks
- [ ] {unfinished work, next steps, blockers}
## Errors & Workarounds
- {error and the workaround}
## Key Exchanges
- {notable exchange, one line}
## Custom Notes
{the note from question 2, or "None"}
---
## Quick Resume Context
{2-3 sentences a future session needs before touching anything. This paragraph is what the SessionStart hook shows at the start of every new session, so make it carry the state.}
Keep bullets short and concrete. Preserve exact values. Keywords matter more than they look: /cpr:resume <topic> searches them.
Do not type the conversation yourself. After the file is saved, run:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/dump_transcript.py" "{logs_dir}/{filename}" ${CLAUDE_SESSION_ID}
It appends ## Raw Session Log with every user message and assistant reply, skips tool calls and thinking, mirrors the file if routing is configured, and prints the number of turns written. The archive costs zero model output tokens.
## Session Saved
`{logs_dir}/{filename}`
- **Project:** {project_name}
- **Topic:** {topic}
- **Sections:** {chosen sections}
- **Keywords:** {keywords}
- **Raw log:** {N} turns appended
Next: `/compact` if you are continuing, or just close the session. `/cpr:resume` loads this back next time.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub eliaalberti/cpr-compress-preserve-resume --plugin cpr3 skills in this plugin
/preserveWrite this session's durable learnings into the project's CLAUDE.md, keeping it short and archiving stale sections. Run after important decisions or when the project's status changes./resumeLoad context from recent CPR session logs, and search past sessions by topic. Use at the start of a session or when you need to know what happened before.Other plugins' skills for the same job