skills/compactor/SKILL.md
Unified context management and session continuity skill. Combines total-recall, strategic-compact, /ledger, and session continuity. Runs in background to preserve critical context across compaction and sessions.
npx skillsauth add nhouseholder/nicks-claude-code-superpowers compactorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The single context/continuity skill. Replaces total-recall, strategic-compact, /ledger.
This is the #1 cause of sessions getting stuck at 145k+ context. Follow this decision tree:
| Situation | Action | |-----------|--------| | First time context is low | Compact — fidelity loss is minimal | | After 2+ compactions in a session | HANDOFF — write handoff.md, start new session | | After 3+ compactions in a session | STRONGLY RECOMMEND new session — context quality degrades significantly | | Complex multi-step task still in progress | HANDOFF — too much state to survive compaction | | User has given detailed requirements this session | HANDOFF — requirements MUST survive intact | | Debugging session with deep context | HANDOFF — root cause analysis needs full detail | | Before spawning large agent on heavy context | Compact first, then spawn — prevents "continue" being impossible |
Never use extended context to fight compression. It burns per-minute rate limits. Handoff to a new session instead.
At logical boundaries (after completing a task, before switching topics, after significant code changes):
# Capture current state
git status --short
git log --oneline -5
pwd
Save a compact state snapshot to thoughts/ledgers/CONTINUITY_$(date +%Y-%m-%d_%H%M).md:
# Continuity Ledger — [Project] — [Date Time]
## Current Task
[What we're working on right now]
## Key Decisions Made
- [Decision 1]: [rationale]
- [Decision 2]: [rationale]
## Critical Context (survives compaction)
- [File paths that matter]
- [Variables/constants that must not change]
- [Patterns/conventions in use]
- [Open questions pending]
## Anti-Patterns to Avoid
- [Specific to this session/project]
## Next Action
[Exactly where to pick up]
Before EVERY compaction, save a checkpoint file. This is the difference between safe compaction and lossy compaction.
Write to ~/.claude/projects/<project>/memory/pre_compact_checkpoint.md (overwritten each time):
# Pre-Compact Checkpoint — <timestamp>
## What we were doing
<1-2 sentence summary of current task>
## Key numbers / data computed this session
<Any stats, counts, P/L figures, measurements — these WILL be lost in compaction>
## Decisions made
<Approach choices, user preferences stated this session, "we decided X because Y">
## Current progress
<What's done, what's next, any blockers>
## Files modified this session
<List of files changed and why>
After compaction, the first thing to do is re-read this file. It costs ~200 tokens to read but saves thousands in re-discovery.
When NOT to checkpoint (skip the file, just compact):
When context approaches limits:
Identify what to keep:
Identify what to discard:
Create compact summary:
When the decision table above says HANDOFF:
Write handoff.md in project memory (~/.claude/projects/<project>/memory/handoff.md):
# Handoff — [Project] — [Date Time]
## Objective
[What we're trying to achieve]
## Current Status
[Where we are, what's done, what's pending]
## Key Decisions
- [Decision]: [rationale]
## Files Modified
- [path]: [what changed]
## Failed Approaches
- [What we tried and why it didn't work]
## Resume Instructions
[Exactly what to do next, step by step]
Commit to GitHub (from /tmp clone if iCloud repo)
Notify user: "Context compression incoming — handoff prepped. Start new session and say 'read handoff.md and continue'"
Update current_work.md too
# Find most recent ledger for this project
ls -t thoughts/ledgers/ 2>/dev/null | head -3
# Read project CLAUDE.md, AGENTS.md
# Read recent handoffs
git log --oneline -10
Memory saves are batched with compaction events — not saved after every task.
| Event | Save action |
|---|---|
| Before compaction | Write checkpoint file to disk + engram_mem_save key findings + brain-router_brain_save critical facts |
| Session end | engram_mem_session_summary (comprehensive) + final brain-router_brain_save |
| Major decision mid-session | engram_mem_save + brain-router_brain_save only — no disk file needed |
| NEVER | Do NOT write to mempalace during save rhythm. It's read-only. Checkpoint/ledger files handle verbatim storage. |
Each project maintains:
thoughts/ledgers/ — session continuity fileshandoffs/ — end-of-session summariesdocs/superpowers/specs/ — design decisionsdocs/superpowers/plans/ — implementation plans~/.claude/anti-patterns.md — recurring mistakes across all projects~/.claude/projects/*/memory/MEMORY.md — project-specific long-term memory| Phase Transition | Compact? | Why | |-----------------|----------|-----| | Research → Planning | Yes | Research context is bulky; plan is the distilled output | | Planning → Implementation | Yes | Plan is in TodoWrite or a file; free up context for code | | Implementation → Testing | Maybe | Keep if tests reference recent code; compact if switching focus | | Debugging → Next feature | Yes | Debug traces pollute context for unrelated work | | Mid-implementation | No | Losing variable names, file paths, and partial state is costly | | After a failed approach | Yes | Clear the dead-end reasoning before trying a new approach | | Already compacted once | No — use auto-handoff instead | Compounding fidelity loss |
| Persists | Lost |
|----------|------|
| CLAUDE.md instructions | Intermediate reasoning and analysis |
| TodoWrite task list | File contents you previously read |
| Memory files (~/.claude/memory/) | Multi-step conversation context |
| Git state (commits, branches) | Tool call history and counts |
| Files on disk | Nuanced user preferences stated verbally |
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
tools
Suggest /ultraplan for complex planning tasks on Claude Code CLI (2.1.91+ only). Research preview.
tools
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.
tools
UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.