You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hooks v2 currently covers before/after message and tool events. Power users automating around the CLI need more lifecycle events, matching what other agent CLIs expose.
What
Add these hook events (same JSON-on-stdin protocol as existing hooks):
subagent_start / subagent_stop — when delegate_task spawns/finishes a subagent (payload: persona, prompt summary, background flag, result status)
pre_compact — before compaction runs (payload: trigger auto|manual, estimated tokens); non-blocking
(Note: session_start/session_end are tracked separately in Add session_start/session_end hook events #9 — this issue covers the remaining events; coordinate if you take both.)
post_tool_failure — when a tool execution errors (payload: tool name, error) — distinct from the existing after-tool event
Only before_tool stays blocking; all new events are fire-and-forget.
Where to start
Hook dispatch lives in src/screens/repl.ts — follow the existing event pattern
Why
Hooks v2 currently covers before/after message and tool events. Power users automating around the CLI need more lifecycle events, matching what other agent CLIs expose.
What
Add these hook events (same JSON-on-stdin protocol as existing hooks):
subagent_start/subagent_stop— whendelegate_taskspawns/finishes a subagent (payload: persona, prompt summary, background flag, result status)pre_compact— before compaction runs (payload: trigger auto|manual, estimated tokens); non-blocking(Note:
session_start/session_endare tracked separately in Add session_start/session_end hook events #9 — this issue covers the remaining events; coordinate if you take both.)post_tool_failure— when a tool execution errors (payload: tool name, error) — distinct from the existing after-tool eventOnly
before_toolstays blocking; all new events are fire-and-forget.Where to start
src/screens/repl.ts— follow the existing event patternsrc/tools/index.ts(delegate_task) /src/tools/background.tssrc/agent/compaction.tscall sitesAcceptance criteria