-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Summary
Copilot CLI hooks are missing a preCompact event type that exists in Claude Code. This creates a gap for workflows that need to refresh context before token compaction (like Gas Town projects).
Background
Claude Code's .claude/settings.json supports a PreCompact hook that runs before context compaction:
{
"hooks": {
"PreCompact": [
{
"type": "command",
"command": "gt prime --hook"
}
]
}
}This is critical for projects like Gas Town where agents (mayor, deacon, refinery, witness, crew, polecats) need to:
- Inject fresh context via
gt prime --hookon session start (sessionStart) - Refresh that context right before compaction (
PreCompact) to ensure accurate state before tokens are compressed
Problem
Copilot CLI currently supports:
sessionStartsessionEnduserPromptSubmittedpreToolUsepostToolUseerrorOccurred
But NOT preCompact. This means agents running in Copilot CLI have stale context after compaction, which breaks multi-hour workflows.
Request
Add support for a preCompact hook event (or expose the internal compaction_start event) in Copilot CLI's .github/hooks/*.json configuration format, matching Claude Code's behavior.
Impact
- Enables Gas Town and similar systems to work reliably with Copilot CLI for long sessions
- Maintains parity with Claude Code's hook ecosystem