Context Compression
Preserve
- user goal, acceptance criteria, scope, and explicit authority;
- user corrections and preferences;
- verified facts with source paths/links and freshness;
- decisions, rationale, rejected alternatives, and invariants;
- files/state changed, backups, commands, test results, and failures;
- active task graph, dependencies, risks, blockers, and next actions.
Remove repeated prose, superseded speculation, raw logs already stored in artifacts, completed low-value narration, and source text that can be reopened by pointer.
Method
- Inventory current instructions, conversation, files, tool outputs, and external state.
- Separate verified fact, inference, proposal, and unresolved question.
- Write a compact handoff with exact paths, counts, commands, hashes/timestamps where relevant.
- Check every critical claim against its source. Mark stale/external facts that need refresh.
- Include negative knowledge: failed approaches and why they failed.
- State the next dependency-ready step and its completion test.
- After transfer/compaction, reopen the handoff and current artifacts; verify mutable state before acting.
Handoff template
Goal and done definition:
Scope / authority / do-not-do:
Verified current state:
Decisions and rationale:
Artifacts and backups:
Validation run and results:
Failures/attempts not to repeat:
Open risks/blockers:
Next actions in dependency order:
Do not claim a host-specific compact/rewind/clear command exists. Use the active host's actual mechanism when available.
1---2name: context-compression3description: Compress long task context into a verified handoff that preserves goals, authority, constraints, decisions, evidence, artifacts, failures, and next steps.4license: MIT5---67# Context Compression89## Preserve1011- user goal, acceptance criteria, scope, and explicit authority;12- user corrections and preferences;13- verified facts with source paths/links and freshness;14- decisions, rationale, rejected alternatives, and invariants;15- files/state changed, backups, commands, test results, and failures;16- active task graph, dependencies, risks, blockers, and next actions.1718Remove repeated prose, superseded speculation, raw logs already stored in artifacts, completed low-value narration, and source text that can be reopened by pointer.1920## Method21221. Inventory current instructions, conversation, files, tool outputs, and external state.232. Separate verified fact, inference, proposal, and unresolved question.243. Write a compact handoff with exact paths, counts, commands, hashes/timestamps where relevant.254. Check every critical claim against its source. Mark stale/external facts that need refresh.265. Include negative knowledge: failed approaches and why they failed.276. State the next dependency-ready step and its completion test.287. After transfer/compaction, reopen the handoff and current artifacts; verify mutable state before acting.2930## Handoff template3132```markdown33Goal and done definition:34Scope / authority / do-not-do:35Verified current state:36Decisions and rationale:37Artifacts and backups:38Validation run and results:39Failures/attempts not to repeat:40Open risks/blockers:41Next actions in dependency order:42```4344Do not claim a host-specific compact/rewind/clear command exists. Use the active host's actual mechanism when available.