[DOCS] Hooks docs missing `last_assistant_message` in `Stop` and `SubagentStop` input schemas

Resolved 💬 3 comments Opened Feb 18, 2026 by coygeek Closed Feb 19, 2026

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

  1. Update Stop and SubagentStop input field descriptions to include last_assistant_message.
  2. Add last_assistant_message to JSON examples on code.claude.com/docs/en/hooks.
  3. Update platform.claude.com/docs/en/agent-sdk/hooks input-data field table to include the field and event scope (Stop, SubagentStop).
  4. 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_message field 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_message field from v2.1.47.

View original on GitHub ↗

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