claude-code - 💡(How to fix) Fix [BUG] SessionStart hook output is not visible to the user — only injected as internal context

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…

Error Message

Error Messages/Logs

No error — the hook reports "startup hook success" but its output is only injected into system-reminder context, never displayed to the user.

Code Example

{
    "hooks": {
      "SessionStart": [
        {
          "hooks": [
            {
              "type": "command",
              "command": "cat path/to/checklist.md",
              "timeout": 10,
              "statusMessage": "Loading workspace state..."
            }
          ]
        }
      ]
    }
  }

  2. Open a new Claude Code session
  3. Observe: no output is shown to the user
  4. The model has the context but cannot present it until the user types

### What Should Happen?

The hook's output (or a configurable portion of it) should be printed to the user's terminal/screen when the session starts, similar to how a shell login message works. The model can still receive the
  context internally, but the user should also see it.

### Error Messages/Logs
RAW_BUFFERClick to expand / collapse

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?

This creates a problem: the user has no visibility into the loaded state. The model receives the context silently, but cannot "speak first" — it must wait for user input before responding. This results in:

  1. User opens a session and sees nothing
  2. User must type something to trigger the model to present the hook's content
  3. The hook's context is processed twice (once on load, once when the user asks)

Expected behavior

The hook's output (or a configurable portion of it) should be printed to the user's terminal/screen when the session starts, similar to how a shell login message works. The model can still receive the context internally, but the user should also see it.

Current behavior

  • Hook runs successfully (startup hook success)
  • Output goes to system-reminder context only
  • Nothing is displayed in the user's terminal/UI
  • Model cannot initiate a response without user input

Reproduction

  1. Configure a SessionStart hook in .claude/settings.json:
{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "cat path/to/checklist.md",
            "timeout": 10,
            "statusMessage": "Loading workspace state..."
          }
        ]
      }
    ]
  }
}

2. Open a new Claude Code session
3. Observe: no output is shown to the user
4. The model has the context but cannot present it until the user types

### What Should Happen?

The hook's output (or a configurable portion of it) should be printed to the user's terminal/screen when the session starts, similar to how a shell login message works. The model can still receive the
context internally, but the user should also see it.

### Error Messages/Logs

```shell
No error — the hook reports "startup hook success" but its output is only injected into system-reminder context, never displayed to the user.

Steps to Reproduce

  1. Configure a SessionStart hook in .claude/settings.json:

{ "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "cat path/to/checklist.md", "timeout": 10, "statusMessage": "Loading workspace state..." } ] } ] } }

  1. Open a new Claude Code session
  2. Observe: no output is shown to the user on screen
  3. The model has the context internally but cannot present it until the user types something
  4. When the user asks, the model processes the context again (double token cost)

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

Last Working Version

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

The core issue is also about token efficiency. The SessionStart hook loads context into the model's system prompt on every session start, consuming tokens. But since the user cannot see this output, they inevitably ask "what's the status?" — which forces the model to process and repeat the same context again. This results in double token consumption for the same information.

The hook's purpose is to provide a session summary on startup. If the model already has this loaded, it should either:

  • Display it to the user automatically (so they don't need to ask), or
  • Allow the model to generate an initial response without waiting for user input

Current flow (wasteful):

  1. Hook loads checklist → tokens consumed (invisible to user)
  2. User asks "what's the status?" → tokens consumed again
  3. Model repeats what it already had → redundant

Ideal flow:

  1. Hook loads checklist → displayed to user on screen OR model responds immediately
  2. No duplicate processing needed

This is especially relevant for users who rely on SessionStart hooks for project state management across sessions.

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 [BUG] SessionStart hook output is not visible to the user — only injected as internal context