context-compressionlisted
Install: claude install-skill yeaight7/agent-powerups
# Context Compression
## When to use
Use when context approaches limits or response quality degrades (repeated mistakes, forgotten constraints, lost-in-the-middle effects) — typically after many turns of debugging or complex planning.
## Requirements / Checks
- Active session contains long stack traces, large file dumps, or multiple failed iterations.
## Workflow
1. **Diagnose bloat** — identify: redundant outputs (same file read multiple times), contradictory instructions that accumulated over turns, constraint forgetting (earlier requirements no longer respected).
2. **Draft summary** — synthesize the *current* valid state of the code or plan in 3–5 sentences.
3. **Extract anti-patterns** — list what failed and why: `"Attempted X → failed because Y"`. These are critical to prevent the next session from looping on the same mistakes.
4. **Generate handoff artifact** — write the following template to disk:
```markdown
## Goal
[One-sentence objective]
## Current state
[What is working / what is in place right now]
## Blocker / next step
[The exact next action to take]
## Anti-patterns (do not repeat)
- Tried X → failed because Y
- Tried A → blocked by B
## Key files
- `path/to/file.ts` — [what it does / why it matters]
## Open risks
- [Anything uncertain or requiring verification]
## Decisions made
- [Key tradeoffs and why alternatives were rejected]
```
5. **Restart** — tell the user to start a new chat session