| name | compress |
| description | Compress the session conversation when context approaches the limit. |
| argument-hint | [--tokens-before=<n>] [--tokens-after=<n>] [--runtime=<id>] |
| user-invocable | true |
| disable-model-invocation | false |
/compress
Canonical algorithm
- Read
tokens_before (required; missing/zero degrades to status=needs_user) and tokens_after (defaults to a no-op when omitted; clamped so a pass can only shrink the context).
- Build the per-runtime compression directive (cache-control wiring) for the target
runtime (defaults to claude-code, the only runtime with a caller-side cache-control marker). An unknown runtime degrades to status=needs_user.
- Append the canonical
compression_emitted event carrying the token deltas and the realised ratio so the telemetry projector can chart context pressure over a session.
The model summarisation fan-out lives behind the runtime adapter's cache-control hook; the skill records the requested compression.
Pre-flight checklist
Decision surfaces
A missing/zero tokens_before or an unknown runtime degrades to status=needs_user, which routes the operator to an AskUserQuestion prompt for the missing input rather than emitting a compression event against an unresolved runtime.
Output contract
Skill envelope with header.skill = "/compress". Body carries tokens_before, tokens_after, ratio, runtime, and cache_control_applied.