[BUG] SubagentStop hook fires on main session/agent
Open 💬 2 comments Opened Jun 22, 2026 by Andrew-Chen-Wang
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I have a hook for Stop and SubagentStop. On Stop for the main session, not subagents have been spawned, it runs both the Stop and SubagentStop hook.
What Should Happen?
Only the stop hook should fire on the main session
Error Messages/Logs
Steps to Reproduce
- Create a test file that can print the event
- Add Stop and SubagentStop hooks to Claude Code settings
- Run something and look at events
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.178
Claude Code Version
2.1.186 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗