[DOCS] Hooks docs are outdated for `TeammateIdle`/`TaskCompleted` JSON decision control
Documentation Type
Incorrect/outdated documentation
Documentation Location
https://code.claude.com/docs/en/hooks
Section/Topic
Decision control semantics for TeammateIdle and TaskCompleted hook events.
Current Documentation
The current docs explicitly state:
TeammateIdle hooks use exit codes only, not JSON decision control.
TaskCompleted hooks use exit codes only, not JSON decision control.
What's Wrong or Missing?
Changelog v2.1.64 states that TeammateIdle and TaskCompleted now support JSON control payloads with:
{"continue": false, "stopReason": "..."}
to stop the teammate, matching Stop hook behavior. The current docs still describe exit-code-only behavior, which is now outdated and can mislead users implementing hook handlers.
Suggested Improvement
Update both sections to document JSON decision control support:
- Accepted JSON schema (
continue,stopReason). - Behavior parity with
Stophooks. - Backward compatibility with existing exit-code workflows.
- Updated examples for both events (JSON + exit-code variant).
Impact
High - Prevents users from using a feature
Additional Context
Affected Pages:
| Page | Line(s) | Context |
|------|---------|---------|
| https://code.claude.com/docs/en/hooks | 1240, 1288 | Both sections say these events use exit codes only and not JSON decision control |
| https://code.claude.com/docs/en/hooks-guide | 1-220 | Guide does not describe JSON control for these two events |
| https://platform.claude.com/docs/en/agent-sdk/hooks | n/a | Agent SDK cross-reference |
Total scope: 3 pages affected
Source: Changelog v2.1.64
- Fixed
TeammateIdleandTaskCompletedhooks to support{"continue": false, "stopReason": "..."}to stop the teammate, matchingStophook behavior.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗