Automatic context summarization for long-running sessions. Use when context is approaching limits, summarizing completed work, preserving critical information, or managing token budgets.
60
71%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.claude/skills/context-compactor/SKILL.mdThe canonical home for this skill is context-compactor in fernandezbaptiste/Skrillz
Automatically summarizes and compacts context when approaching token limits while preserving critical information.
from scripts.compactor import ContextCompactor
compactor = ContextCompactor()
if compactor.should_compact(context, limit=100000):
compacted = compactor.compact(context)compacted = compactor.compact(context)
# Preserves: architectural decisions, bugs, current state
# Discards: stale tool outputs, redundant messages┌─────────────────────────────────────────────────────────────┐
│ PRESERVATION PRIORITY │
├─────────────────────────────────────────────────────────────┤
│ │
│ MUST PRESERVE (Never remove) │
│ ├─ Architectural decisions │
│ ├─ Unresolved bugs and blockers │
│ ├─ Current feature state │
│ ├─ Recent file changes (last 5) │
│ └─ Error patterns and solutions │
│ │
│ CAN SUMMARIZE (Compress to summary) │
│ ├─ Completed features (list of IDs) │
│ ├─ Resolved errors (brief mention) │
│ └─ Historical decisions (key points) │
│ │
│ CAN DISCARD (Remove entirely) │
│ ├─ Redundant tool outputs │
│ ├─ Stale search results │
│ ├─ Superseded messages │
│ └─ Verbose logging │
│ │
└─────────────────────────────────────────────────────────────┘| Context Type | Limit | Action |
|---|---|---|
| < 50% | Normal | No action |
| 50-75% | Warning | Prepare for compaction |
| 75-90% | Compact | Trigger compaction |
| > 90% | Critical | Aggressive compaction |
references/COMPACTION-STRATEGY.md - Detailed strategyreferences/TOKEN-BUDGETS.md - Budget managementscripts/compactor.py - Core ContextCompactorscripts/importance_scorer.py - Message scoringscripts/summarizer.py - Content summarizationscripts/token_estimator.py - Token counting93ed392
Canonical home
since Sep 12, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.