Compact
Replace a sprawling history with a tight, faithful summary that preserves everything future steps depend on and drops everything they don't.
When to use
- The thread is long and you can feel earlier context being lost or repeated.
- Context utilization is high and you need room to keep working.
- You're about to start a substantial new phase and want a clean, accurate baseline.
- The user explicitly asks to "compact", "summarize where we are", or "condense".
When NOT to use
- The conversation is short — compacting adds a lossy layer for no gain.
- You need exact original wording (verbatim quotes, legal/spec text). Offload those to a file instead (see
scratchpad).
- You're permanently leaving the work for someone/something else — write a
handoff brief, which is richer and standalone.
The method (numbered, concrete — the heart)
- Pin the goal. State the original objective in one or two sentences. Everything else is judged by whether it serves this.
- Harvest decisions. List every decision made and why. A decision without its rationale gets re-litigated later — keep the reason.
- Capture constraints. Record hard requirements, rejected approaches (and why they were rejected), and any "do NOT do X" rules. Rejected paths are as valuable as chosen ones.
- Snapshot state. What is the current concrete status — files changed, steps done, what's verified vs. assumed, what's in flight.
- List open questions / next steps. The unresolved threads and the immediate next actions, ordered.
- Discard the noise. Drop resolved back-and-forth, dead ends already abandoned, tool output already acted on, and pleasantries. Keep conclusions, not the deliberation that reached them.
- Preserve pointers, not payloads. Replace long artifacts with a reference ("schema in
/path/file.md", "full error in scratchpad") rather than re-pasting them.
- Replace and continue. Present the compacted summary as the new working baseline, then proceed from it — don't keep dragging the old history alongside.
What good looks like
- A reader could resume the task from the summary alone with no loss of decisions or constraints.
- It's a fraction of the original length but contains every rationale and rejected-path note.
- It separates settled (decisions, constraints) from open (questions, next steps).
- It points to external files for bulky exact-text artifacts instead of inlining them.
Anti-patterns
- Compression without rationale — listing what was decided but not why, guaranteeing re-debate.
- Dropping rejected approaches — the agent happily re-tries the thing that already failed.
- Re-pasting big blobs — defeating the purpose by carrying the bulk into the summary.
- Editorializing — adding interpretation or optimism the original didn't contain.
- Compacting too early or too often — each pass is lossy; don't grind detail away needlessly.
Example (short, vivid)
Before: 60 turns debating auth libraries, three abandoned attempts, a long stack trace, and the eventual fix.
After:
Goal: Add SSO login to the dashboard.
Decided: Use library X (Y rejected — no SAML; Z rejected — unmaintained). Tokens stored httpOnly.
Constraints: Must support existing LDAP; do NOT touch the legacy session table.
State: auth/sso.ts implemented + unit-tested; integration test pending. Login works locally.
Open: Does staging IdP allow our redirect URI? Next: wire callback route, then test on staging.
1---2name: compact3description: Distills a long conversation or working document down to its load-bearing essence — decisions, constraints, open questions, and current state — while discarding resolved chatter and noise, so a long-running task stays coherent without exhausting the context window. Use this skill when the user says "compact this", "summarize where we are", "condense the thread", or "let's reset and continue"; when a conversation has grown long and unwieldy; when context is filling up before a big next step; or whenever earlier turns are crowding out the signal the task actually needs.4---56# Compact78Replace a sprawling history with a tight, faithful summary that preserves everything future steps depend on and drops everything they don't.910## When to use11- The thread is long and you can feel earlier context being lost or repeated.12- Context utilization is high and you need room to keep working.13- You're about to start a substantial new phase and want a clean, accurate baseline.14- The user explicitly asks to "compact", "summarize where we are", or "condense".1516## When NOT to use17- The conversation is short — compacting adds a lossy layer for no gain.18- You need exact original wording (verbatim quotes, legal/spec text). Offload those to a file instead (see `scratchpad`).19- You're permanently leaving the work for someone/something else — write a `handoff` brief, which is richer and standalone.2021## The method (numbered, concrete — the heart)221. **Pin the goal.** State the original objective in one or two sentences. Everything else is judged by whether it serves this.232. **Harvest decisions.** List every decision made and *why*. A decision without its rationale gets re-litigated later — keep the reason.243. **Capture constraints.** Record hard requirements, rejected approaches (and why they were rejected), and any "do NOT do X" rules. Rejected paths are as valuable as chosen ones.254. **Snapshot state.** What is the current concrete status — files changed, steps done, what's verified vs. assumed, what's in flight.265. **List open questions / next steps.** The unresolved threads and the immediate next actions, ordered.276. **Discard the noise.** Drop resolved back-and-forth, dead ends already abandoned, tool output already acted on, and pleasantries. Keep conclusions, not the deliberation that reached them.287. **Preserve pointers, not payloads.** Replace long artifacts with a reference ("schema in `/path/file.md`", "full error in scratchpad") rather than re-pasting them.298. **Replace and continue.** Present the compacted summary as the new working baseline, then proceed from it — don't keep dragging the old history alongside.3031## What good looks like32- A reader could resume the task from the summary alone with no loss of decisions or constraints.33- It's a fraction of the original length but contains every rationale and rejected-path note.34- It separates *settled* (decisions, constraints) from *open* (questions, next steps).35- It points to external files for bulky exact-text artifacts instead of inlining them.3637## Anti-patterns38- **Compression without rationale** — listing what was decided but not why, guaranteeing re-debate.39- **Dropping rejected approaches** — the agent happily re-tries the thing that already failed.40- **Re-pasting big blobs** — defeating the purpose by carrying the bulk into the summary.41- **Editorializing** — adding interpretation or optimism the original didn't contain.42- **Compacting too early or too often** — each pass is lossy; don't grind detail away needlessly.4344## Example (short, vivid)45Before: 60 turns debating auth libraries, three abandoned attempts, a long stack trace, and the eventual fix.4647After:48> **Goal:** Add SSO login to the dashboard.49> **Decided:** Use library X (Y rejected — no SAML; Z rejected — unmaintained). Tokens stored httpOnly.50> **Constraints:** Must support existing LDAP; do NOT touch the legacy session table.51> **State:** `auth/sso.ts` implemented + unit-tested; integration test pending. Login works locally.52> **Open:** Does staging IdP allow our redirect URI? Next: wire callback route, then test on staging.