Vibe Coding
Register Both Stop and SubagentStop Hooks — SubagentStop Has Open Session ID Bug (Issue #7881)
SubagentStop only fires on tool-spawned subagents (not the main agent), so registering both Stop and SubagentStop is required to reliably catch all agent completions. Critical caveat: GitHub issue #7881 (open as of March 2026) documents that SubagentStop cannot identify which specific subagent triggered it because all subagents share session IDs — making per-subagent identity impossible without workarounds such as embedding a unique marker string in the subagent prompt and parsing it from the hook's captured output.
Source
↳ Follow the thread