Skip to content

[BUG] SessionEnd hook system message does not appear in the terminal screen #9090

Description

@theahura

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The documentation for hooks states:

All hook types can include these optional fields:

{
  "continue": true, // Whether Claude should continue after hook execution (default: true)
  "stopReason": "string", // Message shown when continue is false

  "suppressOutput": true, // Hide stdout from transcript mode (default: false)
  "systemMessage": "string" // Optional warning message shown to the user
}

Where systemMessage is a warning message shown to a user. The systemMessage does not output to the claude session. The documentation may be rather unclear about this; if this is WAI, it would be fantastic to have some kind of mechanism for every hook (but especially the SessionEnd hook) to output logs to the terminal itself.

What Should Happen?

If the systemMessage field is set, based on the documentation, the text in that field should show up on screen.

Error Messages/Logs

Steps to Reproduce

Create a hook that uses SessionEnd, that outputs to stdout a json like

{
  systemMessage: 'hello world'
}

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.0.9

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions