claude-code - 💡(How to fix) Fix [DOCS] Stop and SubagentStop hook input docs omit `background_tasks` and `session_crons` [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#60692Fetched 2026-05-20 03:51:59
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4
RAW_BUFFERClick to expand / collapse

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 receive stop_hook_active, agent_id, agent_type, agent_transcript_path, and last_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 receive stop_hook_active and last_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 Stop and SubagentStop to show the new fields
  • add the same fields to the code-site Agent SDK TypeScript and Python StopHookInput / SubagentStopHookInput definitions
  • 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:

PageLine(s)Context
https://code.claude.com/docs/en/hooks1752-1765SubagentStop input lists only stop_hook_active, agent_id, agent_type, agent_transcript_path, and last_assistant_message
https://code.claude.com/docs/en/hooks1894-1907Stop input lists only stop_hook_active and last_assistant_message
https://code.claude.com/docs/en/agent-sdk/typescript1398-1425StopHookInput and SubagentStopHookInput omit background_tasks and session_crons
https://code.claude.com/docs/en/agent-sdk/python2047-2076StopHookInput 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [DOCS] Stop and SubagentStop hook input docs omit `background_tasks` and `session_crons` [1 participants]