⚡ signal-compress — Input Compression
Reduce prompt tokens before the agent reads the same prose every turn. Preserve technical substance; compress prose only.
Invocation Triggers
Activate when user says any of:
/signal-compress
"compress this memory", "shrink this prompt", "compress project rules"
"compress CLAUDE.md", "compress GEMINI.md", "compress AGENTS.md"
"reduce input tokens", "make this rules file shorter"
Targets can be memory files, project rules, prompts, handoff notes, README-like prose, or pasted text.
Behavior
Back up first when a file path is provided:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\signal-compress.ps1 -Path .\GEMINI.md
The helper only creates <name>.original.<ext> and prints the prompt/review steps.
Compress prose only using templates/signal-compress-prompt.md.
Protect exact tokens:
- Fenced code blocks and shell commands
- Inline code, file paths, line numbers, URLs
- Quoted errors, stack traces, logs
- Version numbers, dates, identifiers, flags, env vars
- Technical terms and proper nouns
Diff review against the original. Reject the rewrite if protected tokens changed, facts disappeared, or instructions became ambiguous.
Report measured savings with this shape:
signal-compress|target=GEMINI.md|chars 2400→980|est_tok 600→245|save 59%|fidelity pass
Output Rules
When returning compressed text, output only the compressed file contents. No preamble, no summary, no wrapper fence.
When reporting a completed file workflow, use one line:
signal-compress|target={path}|chars {old}→{new}|est_tok {old}→{new}|save {pct}%|fidelity {pass|fail}
If compression is unsafe:
SIGNAL_DRIFT: <one-line reason>
Fidelity Gate
A compression win counts only when:
- Every protected token is unchanged.
- All actionable instructions remain present.
- Headings stay navigable.
- Any code, paths, flags, errors, and version numbers remain verbatim.
- The compressed file can replace the original without changing agent behavior.
Related
1---2name: signal-compress3description: Compress memory files, prompts, rules, handoff notes, and project docs into SIGNAL-shaped prompt-token-friendly text while preserving code, paths, identifiers, errors, versions, and technical terms. Use when user types /signal-compress, "compress this memory", "shrink this prompt", "compress project rules", or asks to reduce input/prompt tokens.4---56# ⚡ signal-compress — Input Compression78Reduce prompt tokens before the agent reads the same prose every turn. Preserve technical substance; compress prose only.910---1112## Invocation Triggers1314Activate when user says any of:15- `/signal-compress`16- `"compress this memory"`, `"shrink this prompt"`, `"compress project rules"`17- `"compress CLAUDE.md"`, `"compress GEMINI.md"`, `"compress AGENTS.md"`18- `"reduce input tokens"`, `"make this rules file shorter"`1920Targets can be memory files, project rules, prompts, handoff notes, README-like prose, or pasted text.2122---2324## Behavior25261. **Back up first** when a file path is provided:27 ```powershell28 powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\signal-compress.ps1 -Path .\GEMINI.md29 ```30 The helper only creates `<name>.original.<ext>` and prints the prompt/review steps.31322. **Compress prose only** using [`templates/signal-compress-prompt.md`](../templates/signal-compress-prompt.md).33343. **Protect exact tokens**:35 - Fenced code blocks and shell commands36 - Inline code, file paths, line numbers, URLs37 - Quoted errors, stack traces, logs38 - Version numbers, dates, identifiers, flags, env vars39 - Technical terms and proper nouns40414. **Diff review** against the original. Reject the rewrite if protected tokens changed, facts disappeared, or instructions became ambiguous.42435. **Report measured savings** with this shape:44 ```text45 signal-compress|target=GEMINI.md|chars 2400→980|est_tok 600→245|save 59%|fidelity pass46 ```4748---4950## Output Rules5152When returning compressed text, output only the compressed file contents. No preamble, no summary, no wrapper fence.5354When reporting a completed file workflow, use one line:55```text56signal-compress|target={path}|chars {old}→{new}|est_tok {old}→{new}|save {pct}%|fidelity {pass|fail}57```5859If compression is unsafe:60```text61SIGNAL_DRIFT: <one-line reason>62```6364---6566## Fidelity Gate6768A compression win counts only when:69- Every protected token is unchanged.70- All actionable instructions remain present.71- Headings stay navigable.72- Any code, paths, flags, errors, and version numbers remain verbatim.73- The compressed file can replace the original without changing agent behavior.7475---7677## Related7879- [`docs/signal-compress.md`](../docs/signal-compress.md)80- [`docs/benchmark-methodology.md`](../docs/benchmark-methodology.md)81- [`scripts/signal-compress.ps1`](../scripts/signal-compress.ps1)