[DOCS] Stop and SubagentStop hook input docs omit `background_tasks` and `session_crons`
Documentation Type
Incorrect/outdated documentation
Documentation Location
https://code.claude.com/docs/en/hooks
Section/Topic
Stop input and SubagentStop input
Current Documentation
The docs currently say:
In addition to the common input fields, SubagentStop hooks receivestop_hook_active,agent_id,agent_type,agent_transcript_path, andlast_assistant_message."hook_event_name": "SubagentStop""stop_hook_active": false"agent_id": "def456""agent_type": "Explore""agent_transcript_path": "~/.claude/projects/.../abc123/subagents/agent-def456.jsonl""last_assistant_message": "Analysis complete. Found 3 potential issues..."In addition to the common input fields, Stop hooks receivestop_hook_activeandlast_assistant_message."hook_event_name": "Stop""stop_hook_active": true"last_assistant_message": "I've completed the refactoring. Here's a summary..."
What's Wrong or Missing?
The Claude Code v2.1.145 release entry says Stop and SubagentStop hook input now includes background_tasks and session_crons, but the current docs still show the older field lists and example payloads only.
That makes the schema documentation outdated in the main hooks page, and the code-site Agent SDK references are still missing the same fields from StopHookInput and SubagentStopHookInput. Hook authors cannot tell that these fields exist, whether they are optional, or what data shape they expose.
Suggested Improvement
Update the v2.1.145 hook input documentation so background_tasks and session_crons appear everywhere Stop and SubagentStop inputs are defined.
At minimum:
- add both fields to the prose field lists on
https://code.claude.com/docs/en/hooks - update the JSON examples for
StopandSubagentStopto show the new fields - add the same fields to the code-site Agent SDK TypeScript and Python
StopHookInput/SubagentStopHookInputdefinitions - document whether each field is always present or optional, plus the structure of each item
Impact
Medium - Makes feature difficult to understand
Additional Context
Affected Pages:
| Page | Line(s) | Context |
|------|---------|---------|
| https://code.claude.com/docs/en/hooks | 1752-1765 | SubagentStop input lists only stop_hook_active, agent_id, agent_type, agent_transcript_path, and last_assistant_message |
| https://code.claude.com/docs/en/hooks | 1894-1907 | Stop input lists only stop_hook_active and last_assistant_message |
| https://code.claude.com/docs/en/agent-sdk/typescript | 1398-1425 | StopHookInput and SubagentStopHookInput omit background_tasks and session_crons |
| https://code.claude.com/docs/en/agent-sdk/python | 2047-2076 | StopHookInput and SubagentStopHookInput omit the same fields from the class definitions and tables |
Total scope: 4 documentation sections across 3 pages
Version context: Claude Code v2.1.145
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗