[FEATURE] PostCompaction hook stage for long-running skills
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When a conversation is compacted (context truncated), skill instructions from earlier in the conversation are lost. This causes Claude to deviate from skill protocols after compaction.
Proposed Solution
Add a PostCompaction hook stage that fires after context compaction completes.
Use cases:
- Re-inject active skill instructions into the conversation
- Log/alert that compaction occurred during a long-running operation
- Restore state markers needed for skill continuity
Example hook configuration:
{
"hooks": {
"PostCompaction": [
{
"hooks": [
{
"type": "command",
"command": "check-active-skill.sh",
"timeout": 5
}
]
}
]
}
}
Alternative Solutions
You need to monitor when compaction occurs and then re-instruct the team lead to re-read the skill to ensure they have the details.
Priority
High - Significant impact on productivity
Feature Category
Interactive mode (TUI)
Use Case Example
Example scenario:
- User invokes /my-team-review skill that orchestrates 6 agents over multiple QA rounds
- Skill instructions define a strict protocol (e.g., "never commit without permission", "always run cross-review before consolidation")
- After 10+ rounds, context compaction occurs
- Post-compaction, Claude only has a summary - the full skill instructions are gone
- Claude proceeds to violate the protocol (e.g., commits without permission, skips required steps)
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗