Saves the current session as a searchable log with a curated summary and the raw transcript, so a later session can resume from it.

MITAuto-check passedAgent Workflows

Install CPR Compress

skills CLI
$ npx skills add EliaAlberti/cpr-compress-preserve-resume --skill compress -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install EliaAlberti/cpr-compress-preserve-resume compress --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/EliaAlberti/cpr-compress-preserve-resume.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/compress .claude/skills/compress && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
compress
GitHub stars
514
Token cost
~1.1k tokens
SKILL.md length
360 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Saves the current session as a searchable log with a curated summary and the raw transcript, so a later session can resume from it.

  • Works in 3 steps: What to preserve. Multi-select, header… → Custom note. Single-select, header… → Topic name. Derive a 3-5 word,…
  • Saving a long session before running /compact
  • SKILL.md covers Where this log goes, Arguments, The questions and Write the log, plus 2 more sections
  • Calls python3

What it does

Run before `/compact` or before ending a session, this command writes a markdown session log in two parts: a structured summary the agent writes and the raw transcript appended by a script. The CPR hooks already autosave the raw transcript before each compaction, so this skill is where the curated part comes from. Adding `quick` skips the questions.

Without `quick`, it asks up to three questions: what to preserve (key learnings, solutions and fixes, decisions, files modified, setup and config, pending tasks, errors and workarounds), an optional custom note, and a lowercase hyphenated topic name of three to five words. The file is named from a timestamp and the topic, always includes Quick Reference, Quick Resume Context and Custom Notes sections, and keeps exact values and keywords because `/cpr:resume` searches them.

When your agent uses it

  • Saving a long session before running /compact
  • Ending a session with decisions and pending tasks recorded for next time
  • Creating a searchable log of fixes and workarounds found during debugging

Example prompts

  • “Compress this session before I compact.”
  • “/cpr:compress quick”
  • “Save this session as api-auth-refactor and keep the decisions and pending tasks.”

Requirements

  • The CPR plugin
  • Python 3 for its path and transcript scripts
  • Pre-approved tools (allowed-tools): Read, Write, AskUserQuestion, Bash(python3 *), Bash(mkdir *)

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. What to preserve. Multi-select, header "Preserve". Options: Key Learnings, Solutions & Fixes, Decisions Made, Files Modified, Setup &…
  2. Custom note. Single-select, header "Custom note", exactly two options: Skip and Add a custom note. A free-text answer is the note, kept…
  3. Topic name. Derive a 3-5 word, lowercase, hyphenated topic first (for example api-auth-refactor). Single-select, header "Topic name"…

What it can do on your machine

Read from SKILL.md and the folder at commit cfd1e77. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • AskUserQuestion
    • Bash(python3 *)
    • Bash(mkdir *)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

CPR Compress loads about 1.1k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 360 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from EliaAlberti/cpr-compress-preserve-resume at commit cfd1e77, republished under its MIT licence (© EliaAlberti). 360 words, ~1,073 tokens.

Download SKILL.mdSave it as .claude/skills/compress/SKILL.md (or your agent's skills folder).
name
compress
description
Save this session to a searchable CPR log with a curated summary plus the raw transcript. Run before /compact or before ending a session. Add "quick" to skip the questions.
allowed-tools
Read, Write, AskUserQuestion, Bash(python3 *), Bash(mkdir *)
argument-hint
[quick] [topic-name]
disable-model-invocation
true

/cpr:compress

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.

Where this log goes

!python3 "${CLAUDE_PLUGIN_ROOT}/scripts/cpr_paths.py"

Session id for the raw transcript: ${CLAUDE_SESSION_ID}

Arguments

$ARGUMENTS

  • Contains quick: skip the three questions below. Include every section that has real content, and derive the topic name yourself.
  • Any other words: use them as the topic name (lowercase, hyphens), and still ask the first two questions.
  • Empty: run all three questions.

The questions

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.

  1. What to preserve. Multi-select, header "Preserve". Options: Key Learnings, Solutions & Fixes, Decisions Made, Files Modified, Setup & Config, Pending Tasks, Errors & Workarounds. Recommend the ones this session actually produced.
  2. Custom note. Single-select, header "Custom note", exactly two options: Skip and Add a custom note. A free-text answer is the note, kept verbatim.
  3. Topic name. Derive a 3-5 word, lowercase, hyphenated topic first (for example 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.
Show full SKILL.md (113 more words)Show less

Write the log

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.

markdown
# 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.

Append the raw transcript

Do not type the conversation yourself. After the file is saved, run:

bash
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.

Confirm

markdown
## 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.

© EliaAlberti, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/compress of EliaAlberti/cpr-compress-preserve-resume.

Open the folder on GitHubat commit cfd1e77

Compare with similar skills

CPR Compress next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

CPR Compress compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
CPR Compress this skillEliaAlberti/cpr-compress-preserve-resume514—~1.1kAutomated safety check: PassMIT
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: NotesCustom licence
Planning with FilesOthmanAdi/planning-with-files27k—~2.9kAutomated safety check: PassMIT
User Thoughts Memorysickn33/agentic-awesome-skills47k1 repos~2.5kAutomated safety check: PassMIT
Planning With FilesOthmanAdi/planning-with-files27k—~3kAutomated safety check: PassMIT
Harness Engineering10xChengTu/harness-engineering1021 repos~1kAutomated safety check: PassNone

Similar skills

  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 6 days ago
    Agent WorkflowsAuto-check: notes
  • Planning with Files

    OthmanAdi/planning-with-files

    Keeps a task plan, findings and progress log in markdown files on disk so long agent tasks survive context resets, with Gemini hooks and helper scripts.

    27k GitHub stars~2.9k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • User Thoughts Memory

    sickn33/agentic-awesome-skills

    Saves a user's project decisions, rules and preferences into a project-local mdbase so later sessions and other agents can recover the intent.

    47k GitHub starsUsed in 1 repo~2.5k tokens
    Agent WorkflowsAuto-check passed
  • Planning With Files

    OthmanAdi/planning-with-files

    Keeps a task plan, findings and progress log as Markdown files in the project so long multi-step agent work survives context resets.

    27k GitHub stars~3k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • Harness Engineering

    10xChengTu/harness-engineering

    Set up and improve harness engineering (AGENTS.md, docs/, lint rules, eval systems, project-level prompt engineering) for AI-agent-friendly codebases.

    102 GitHub starsUsed in 1 repo~1k tokens
    Agent WorkflowsAuto-check passed
  • Planning with Files for Kiro

    OthmanAdi/planning-with-files

    Keeps task_plan.md, findings.md and progress.md on disk as the agent's working memory for multi-step work, wired into Kiro steering, with no hooks.

    27k GitHub stars~2.1k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed

More from EliaAlberti/cpr-compress-preserve-resume

  • CLAUDE.md Preserve

    EliaAlberti/cpr-compress-preserve-resume

    Writes this session's durable learnings into the project's CLAUDE.md and keeps the file short by archiving stale sections.

    514 GitHub stars~889 tokensUpdated 1 mo ago
    Auto-check passed
  • CPR Session Resume

    EliaAlberti/cpr-compress-preserve-resume

    Loads context from recent CPR session logs at the start of a session and can search past sessions by topic, then writes a short resume report.

    514 GitHub stars~623 tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about CPR Compress

What does CPR Compress do?

Saves the current session as a searchable log with a curated summary and the raw transcript, so a later session can resume from it. Run before `/compact` or before ending a session, this command writes a markdown session log in two parts: a structured summary the agent writes and the raw transcript appended by a script. The CPR hooks already autosave the raw transcript before each compaction, so this skill is where the curated part comes from.

When should I use CPR Compress?

CPR Compress fits situations like: saving a long session before running /compact; ending a session with decisions and pending tasks recorded for next time; creating a searchable log of fixes and workarounds found during debugging.

How do I install CPR Compress in Claude Code?

Run `npx skills add EliaAlberti/cpr-compress-preserve-resume --skill compress -a claude-code`. Or copy the skill folder (skills/compress in EliaAlberti/cpr-compress-preserve-resume) into .claude/skills/compress in your project. Claude Code loads it when a task matches its description.

How do I install CPR Compress in Codex?

Run `npx skills add EliaAlberti/cpr-compress-preserve-resume --skill compress -a codex`. Or copy the skill folder (skills/compress in EliaAlberti/cpr-compress-preserve-resume) into .agents/skills/compress in your project. Codex loads it when a task matches its description.

Can I use CPR Compress in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add EliaAlberti/cpr-compress-preserve-resume --skill compress -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/compress, .gemini/skills/compress, .github/skills/compress and .opencode/skills/compress in your project.

What does CPR Compress need to run?

Going by SKILL.md and its folder, CPR Compress needs the command-line tools its instructions call (python3). Our summary lists: The CPR plugin; Python 3 for its path and transcript scripts. Its frontmatter pre-approves these tools: Read, Write, AskUserQuestion, Bash(python3 *), Bash(mkdir *).

Does CPR Compress access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is CPR Compress safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does CPR Compress use?

CPR Compress is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does CPR Compress use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to CPR Compress?

Skills that share tags, products or a category with CPR Compress: Memori Long-Term Memory (MemoriLabs/Memori, 17k stars), Planning with Files (OthmanAdi/planning-with-files, 27k stars), User Thoughts Memory (sickn33/agentic-awesome-skills, 47k stars) and Planning With Files (OthmanAdi/planning-with-files, 27k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains CPR Compress?

EliaAlberti (a GitHub user) maintains it in EliaAlberti/cpr-compress-preserve-resume, which has 514 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on September 9, 2026.

Source: EliaAlberti/cpr-compress-preserve-resume on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.