| name | yp-compress |
| description | Rewrite a memory file in terse prose to reduce input tokens. |
Compress Context
Rewrite a memory file in terse form. Saves original as <filename>.original.md.
Invoke with a target file, for example CLAUDE.md or .agents/project-context.md.
What Claude does
- Read
<file> — if absent, stop and report error
- If
<filename>.original.md already exists, ask before overwriting backup
- Rewrite prose sections per
references/rules.md
- Write compressed version to
<file> (overwrites original)
- Write original to
<filename>.original.md
- Report: "Compressed : [N] → [M] lines ([X]% reduction). Original saved as .original.md"
- If reduction < 10%: warn "File already terse — minimal savings achieved."
Retry up to 2x on quality check failure, patching only the failing sections.
References
| File | When to read |
|---|
references/rules.md | Exact rules for what to rewrite vs. what to pass through untouched |