feat(hooks): PostCompact hook should fire in the new session context to enable agent ACK/handoff signals
Summary
After /compact triggers context compaction, there is no hook event that fires within the new session's context. This prevents agents from sending ACK messages, handoff signals, or post-compact state updates via MCP tools.
Current behavior
/compactfires thecompaction-dr-hook(a shell command) before or during the compact event- The new session starts fresh and awaits a human prompt to activate
- Agents cannot self-initiate any post-compact signal — no MCP tool calls are possible until a human message arrives
- The result: no automated ACK that the handoff was clean, no ability to call tools like
rowan_send,rowan_checkin, etc. from the agent immediately after resuming
Expected behavior
A PostCompact hook (or equivalent) that fires at the start of the new session, giving the agent an opportunity to:
- Call MCP tools (e.g., send a handoff ACK, update a context store, notify a channel)
- Run shell commands with access to the compacted summary
- Self-identify as a post-compact session so other hooks/logic can branch accordingly
Why this matters
In multi-agent orchestration setups, compact events are coordination points. When Rowan (Claude Code on macOS) compacts, downstream agents (Campion, Conductor, Perpetua) cannot know if the session recovered cleanly or dropped work. A PostCompact hook that fires in the new session context would close this gap mechanically, without requiring human intervention.
Workaround attempted
Extending the existing compaction hook to curl an MCP HTTP endpoint — but this requires MCP servers to expose HTTP APIs and is fragile. A native hook firing in the new session context is the clean solution.
Environment
- Claude Code (latest)
- macOS (rowan-den, Mac Mini M4)
- Multi-agent setup using MCP servers for inter-agent messaging
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗