[DOCS] Hooks docs missing `last_assistant_message` in `Stop` and `SubagentStop` input schemas
Documentation Type
Incorrect/outdated documentation
Documentation Location
https://code.claude.com/docs/en/hooks
https://platform.claude.com/docs/en/agent-sdk/hooks
Section/Topic
Hook input field documentation for Stop and SubagentStop
Current Documentation
code.claude.com currently says:
- SubagentStop receives:
stop_hook_active,agent_id,agent_type,agent_transcript_path - Stop receives:
stop_hook_active
The JSON examples for both events omit last_assistant_message.
platform.claude.com hook field table also does not list last_assistant_message for Stop/SubagentStop.
What's Wrong or Missing?
Claude Code v2.1.47 added a last_assistant_message field to Stop and SubagentStop hook inputs so hooks can access final assistant output text directly without parsing transcript files.
Current docs still describe pre-2.1.47 inputs, so hook authors may miss the new field and continue using brittle transcript parsing.
Suggested Improvement
- Update
StopandSubagentStopinput field descriptions to includelast_assistant_message. - Add
last_assistant_messageto JSON examples oncode.claude.com/docs/en/hooks. - Update
platform.claude.com/docs/en/agent-sdk/hooksinput-data field table to include the field and event scope (Stop,SubagentStop). - Clarify behavior for edge cases:
- whether it can be empty/null
- whether formatting is plain text vs markdown
- any truncation limits
Impact
High - Prevents users from using a feature
Additional Context
Affected Pages:
| Page | Line(s) | Context |
|------|---------|---------|
| https://code.claude.com/docs/en/hooks | 1088-1101 | SubagentStop input fields/example omit last_assistant_message |
| https://code.claude.com/docs/en/hooks | 1113-1123 | Stop input fields/example omit last_assistant_message |
| https://platform.claude.com/docs/en/agent-sdk/hooks | 263-283 | Hook-specific field table omits last_assistant_message |
Release note reference (v2.1.47):
- "Added
last_assistant_messagefield to Stop and SubagentStop hook inputs, providing the final assistant response text so hooks can access it without parsing transcript files"
Dedup check:
- Open issue #19125 covers older SubagentStop schema drift (agent fields), not the new
last_assistant_messagefield from v2.1.47.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗