[BUG] `--debug hooks` missing `Executing hook command:` logging for SessionStart hooks

Resolved 💬 5 comments Opened Dec 7, 2025 by coygeek Closed Feb 28, 2026

Preflight Checklist

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

What's Wrong?

When running claude --debug hooks, SessionStart hooks do not log the [DEBUG] Executing hook command: <command> line that identifies which specific hook script is being executed. The debug output only shows:

  1. How many hooks matched
  2. The hook outputs (without identifying which hook produced them)

This makes it impossible to determine which SessionStart hook produced which output, or to diagnose issues with specific hooks.

What Should Happen?

When running claude --debug hooks, SessionStart hooks do not log the [DEBUG] Executing hook command: <command> line that identifies which specific hook script is being executed. The debug output only shows:

  1. How many hooks matched
  2. The hook outputs (without identifying which hook produced them)

This makes it impossible to determine which SessionStart hook produced which output, or to diagnose issues with specific hooks.

Error Messages/Logs

**Actual output with `claude --debug hooks`:**


2025-12-07T22:04:39.022Z [DEBUG] Getting matching hook commands for SessionStart with query: startup
2025-12-07T22:04:39.023Z [DEBUG] Found 1 hook matchers in settings
2025-12-07T22:04:39.023Z [DEBUG] Matched 7 unique hooks for query "startup" (7 before deduplication)
2025-12-07T22:04:39.270Z [DEBUG] Hook output does not start with {, treating as plain text
2025-12-07T22:04:39.272Z [DEBUG] Hooks: Checking initial response for async: {"hookSpecificOutput": {"hookEventName": "SessionStart", "additionalContext": "Current Date and Time Information:..."}}
2025-12-07T22:04:39.272Z [DEBUG] Hooks: Parsed initial response: {...}
2025-12-07T22:04:39.272Z [DEBUG] Hooks: Initial response is not async, continuing normal processing
2025-12-07T22:04:39.275Z [DEBUG] Successfully parsed and validated hook JSON output


**Missing lines (that PostToolUse hooks have):**

[DEBUG] Executing hook command: python3 "$HOME/.claude/hooks/date-awareness/date_awareness.py" with timeout 60000ms
[DEBUG] Hook command completed with status 0: ...

Steps to Reproduce

  1. Create a ~/.claude/settings.json with multiple SessionStart hooks:
{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "echo 'Hook 1 output'"
          },
          {
            "type": "command",
            "command": "echo 'Hook 2 output'"
          }
        ]
      }
    ]
  }
}
  1. Run Claude Code with debug hooks enabled:
claude --debug hooks
  1. Observe the debug output — you'll see:
  • Matched 2 unique hooks for query "startup"
  • Hook outputs appear
  • But NO Executing hook command: lines identifying which hook is running
  1. Compare with a PreToolUse or PostToolUse hook — those correctly show [DEBUG] Executing hook command: <command> before each hook runs.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.61

Platform

Other

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • Claude Code version: 2.0.61
  • OS: macOS

Documentation reference: The hooks reference at https://docs.anthropic.com shows the expected debug output format with Executing hook command: lines, but this only works for PreToolUse/PostToolUse hooks, not SessionStart or UserPromptSubmit hooks.

Impact: Users cannot debug SessionStart hook issues because they cannot determine:

  • Which hook is currently executing
  • Which hook produced a specific output
  • Which hook failed or timed out
  • The order of hook execution

Workaround: Adding print("[HOOK] script_name starting", file=sys.stderr) to each hook script manually, but this should not be necessary when --debug hooks is specified.

View original on GitHub ↗

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