[DOCS] Hooks docs are outdated for `TeammateIdle`/`TaskCompleted` JSON decision control

Resolved 💬 2 comments Opened Mar 4, 2026 by coygeek Closed Mar 7, 2026

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:

  1. Accepted JSON schema (continue, stopReason).
  2. Behavior parity with Stop hooks.
  3. Backward compatibility with existing exit-code workflows.
  4. 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 TeammateIdle and TaskCompleted hooks to support {"continue": false, "stopReason": "..."} to stop the teammate, matching Stop hook behavior.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗