context-compaction-handoff
Guardrails for resuming work after context compaction or transcript handoff blocks; prioritize the latest real user request over stale summarized tasks and verify before answering.
Best use case
context-compaction-handoff is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Guardrails for resuming work after context compaction or transcript handoff blocks; prioritize the latest real user request over stale summarized tasks and verify before answering.
Teams using context-compaction-handoff should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/context-compaction-handoff/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How context-compaction-handoff Compares
| Feature / Agent | context-compaction-handoff | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Guardrails for resuming work after context compaction or transcript handoff blocks; prioritize the latest real user request over stale summarized tasks and verify before answering.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Context Compaction Handoff Use this skill whenever the conversation includes a context-compaction summary, transcript handoff, or other generated summary block that says it is background/reference-only. ## Core rule A compaction block is background evidence, not the active instruction. Resume from the latest real user message after the compaction marker. If the latest user message conflicts with the summary's `Active Task`, the latest user message wins. ## Procedure 1. **Separate source types** - Treat explicit user messages as active instructions. - Treat compaction summaries as historical context unless the latest user asks to resume them. 2. **Locate the active request** - First scan below the compaction marker for the latest user-authored request. - If no real user request exists after the marker, fall back to the latest visible real user request immediately before the compaction block, as long as it has not already been answered. - If the compaction block says summary generation was unavailable or contains no reliable active-task section, do not treat old todos/final summaries as active; either continue the last visible unanswered user request or ask for clarification. - Never invent a task from the generated summary itself. 3. **Revalidate before acting** - If the active request asks for evidence, logs, state, or current facts, inspect the relevant sources before answering. - Do not answer from the compaction summary when the user asked for live verification. 4. **Avoid stale closeout leakage** - Do not use old todo lists, issue-closeout summaries, or prior final-response wording as the answer to a new post-compaction question. - If a todo list was reconstructed from the compaction summary, keep it separate from the latest user request unless the request explicitly matches it. ## Pitfalls - **Wrong:** A compaction says `Active Task: None`, but the pre-compaction visible user asked a new evidence-gathering question. The agent answers with a completed old closeout summary. - **Right:** The agent identifies the latest real user request, loads relevant skills, inspects the requested evidence, and answers only that request. ## References - `references/compaction-latest-user-message-guard.md` — session-specific failure mode and recovery checklist.
Related Skills
handoff
Compact the current conversation into a handoff document for another agent to pick up.
plan-review-handoff-verification
Verify a parked GitHub issue plan-review handoff across live labels, local markers, README rows, canonical review artifacts, and stale plan-body evidence before reporting next action.
large-parallel-planning-wave-environment-failure-handoff
Handle large pre-plan-review planning waves that succeed analytically but fail to persist artifacts due to quota exhaustion, sandbox write failures, or cancelled GitHub mutations.
wiki-context
Auto-query llm-wiki domains for relevant context before executing domain tasks
data-context-extractor
Generate or improve a company-specific data analysis skill by extracting tribal knowledge from analysts
skill-chain-context-optimization
Refactor large or frequently-run skills into context-efficient chains using isolated execution, file-backed handoffs, minimal summaries, and runtime-aware command substitution.
plan-exit-governance-drift-handoff
When ending a session on an iterated plan draft, audit and document approval-state drift across GitHub labels, local approval markers, README status, and latest review verdicts.
next-wave-handoff-bundle
Build a docs-only execution handoff bundle after a completed implementation wave — follow-up issue drafts, scoped authorization note, deploy checklist, operator note, copy/paste command bundle, and incremental commit hygiene.
core-context-management-windows-task-scheduler
Sub-skill of core-context-management: Windows Task Scheduler (+2).
core-context-management-validatecontextsh
Sub-skill of core-context-management: validate_context.sh (+4).
core-context-management-size-limits-mandatory
Sub-skill of core-context-management: Size Limits (MANDATORY) (+3).
core-context-management-response-format-rules
Sub-skill of core-context-management: Response Format Rules (+3).