From compress-memory
Use when the user asks to compress a natural-language memory file (CLAUDE.md, STATE.md, ROADMAP.md, project notes) to save input tokens. Preserves code blocks, URLs, file paths, frontmatter, headings, tables, and list structure byte-exact. Backs up the original to FILE.original.md before each compression. Refuses to operate on downstream-consumed artifacts (plan documents, UI contracts, impact analyses, design documents, review reports). Triggers: "/compress-memory <path>", "compress STATE.md", "shrink CLAUDE.md", "compact this memory file". Also auto-invoked by project-orchestration:pause-work when ROADMAP.md frontmatter contains compress_memory: enabled.
How this skill is triggered — by the user, by Claude, or both
Slash command
/compress-memory:compress-memoryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Compress natural-language memory files into a terser form that preserves every byte a downstream consumer (skill or human) might key off. Reduces input tokens replayed every Claude Code session.
Compress natural-language memory files into a terser form that preserves every byte a downstream consumer (skill or human) might key off. Reduces input tokens replayed every Claude Code session.
This is input token compression. Caveman-style output speech is explicitly NOT in scope (it would fight every skill in this suite that produces structured artifacts). See NOTICE.md for the relationship to caveman-compress.
/compress-memory <filepath> slash commandproject-orchestration:pause-work invokes this skill on docs/planning/STATE.md (and ROADMAP.md if dirty) when docs/planning/ROADMAP.md frontmatter contains compress_memory: enabled.This skill REFUSES the following files (see safety-rules.md for the full denylist):
docs/plans/ — these are plan documents read literally by downstream skills*-design.md, *-impact-analysis*, *ui-contract*, *-review-*.md — contracts between skillsMILESTONE.md — rewritten on milestone transitions, not pause-workCONVENTIONS.md — machine-read before every commit and tag; its fields are prose, so compression can break them while validation still passes*.original.md — backup files.md or .txtcompress: skip or compress_memory: skip in their frontmatterWhen asked to compress a denied file, refuse with the specific reason. Do not modify the file.
.md or .txt. If not → abort with reason.compress: skip or compress_memory: skip → abort with the per-file opt-out message..md (or .txt) extension with .original.md (or .original.txt). For docs/planning/STATE.md, the backup is docs/planning/STATE.original.md. NOT STATE.md.original.md.Apply the rules in compression-rules.md:
Apply rules to PROSE ONLY. Treat code blocks as read-only regions.
Run all of the following mechanical checks BEFORE writing the candidate to disk. Each check compares the candidate against the original input.
If ANY check fails:
pause-work, return failure to the parent so it can log and continue with the uncompressed file.If all validation checks pass:
Write the compressed candidate over the original file path using the Write tool.
Verify the write succeeded by re-reading the file and confirming size matches the candidate.
Report to the user:
Compressed
<path>:
- Before:
<X>bytes- After:
<Y>bytes- Saved:
<Z>%- Backup:
<basename>.original.md(e.g.docs/planning/STATE.md→docs/planning/STATE.original.md)
digraph compress_memory {
"Request to compress <file>" [shape=doublecircle];
"Allowed extension?" [shape=diamond];
"Path on denylist?" [shape=diamond];
"Size <= 50 kB?" [shape=diamond];
"Frontmatter opts out?" [shape=diamond];
"Backup exists?" [shape=diamond];
"Write backup" [shape=box];
"Generate compressed candidate" [shape=box];
"Validation passes?" [shape=diamond];
"Write compressed file" [shape=box];
"Report result" [shape=doublecircle];
"Abort with reason" [shape=doublecircle];
"Request to compress <file>" -> "Allowed extension?";
"Allowed extension?" -> "Abort with reason" [label="no"];
"Allowed extension?" -> "Path on denylist?" [label="yes"];
"Path on denylist?" -> "Abort with reason" [label="yes"];
"Path on denylist?" -> "Size <= 50 kB?" [label="no"];
"Size <= 50 kB?" -> "Abort with reason" [label="no"];
"Size <= 50 kB?" -> "Frontmatter opts out?" [label="yes"];
"Frontmatter opts out?" -> "Abort with reason" [label="yes"];
"Frontmatter opts out?" -> "Backup exists?" [label="no"];
"Backup exists?" -> "Generate compressed candidate" [label="yes"];
"Backup exists?" -> "Write backup" [label="no"];
"Write backup" -> "Generate compressed candidate";
"Generate compressed candidate" -> "Validation passes?";
"Validation passes?" -> "Abort with reason" [label="no"];
"Validation passes?" -> "Write compressed file" [label="yes"];
"Write compressed file" -> "Report result";
}
*.original.md — the first backup is canonical. Do not re-create the backup on subsequent compressions; the user wants to be able to recover the pristine version..original.md to the full filename — backup naming REPLACES the extension. STATE.md → STATE.original.md, NOT STATE.md.original.md. Getting this wrong silently violates the denylist pattern matching.Guides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Resolves in-progress git merge or rebase conflicts by analyzing history, understanding intent, and preserving both changes where possible. Runs automated checks after resolution.
npx claudepluginhub marcelroozekrans/superpowers-extensions --plugin compress-memory