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 --hook on session start (sessionStart)
- Refresh that context right before compaction (
PreCompact) to ensure accurate state before tokens are compressed
Problem
Copilot CLI currently supports:
sessionStart
sessionEnd
userPromptSubmitted
preToolUse
postToolUse
errorOccurred
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
Summary
Copilot CLI hooks are missing a
preCompactevent 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.jsonsupports aPreCompacthook 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:
gt prime --hookon session start (sessionStart)PreCompact) to ensure accurate state before tokens are compressedProblem
Copilot CLI currently supports:
sessionStartsessionEnduserPromptSubmittedpreToolUsepostToolUseerrorOccurredBut NOT
preCompact. This means agents running in Copilot CLI have stale context after compaction, which breaks multi-hour workflows.Request
Add support for a
preCompacthook event (or expose the internalcompaction_startevent) in Copilot CLI's.github/hooks/*.jsonconfiguration format, matching Claude Code's behavior.Impact