SessionStart hook with type 'prompt' causes error

Resolved 💬 5 comments Opened Jan 27, 2026 by wcj-camfit Closed Feb 28, 2026

Description

When configuring a SessionStart hook with type: "prompt", Claude Code displays an error:

SessionStart:startup hook error

The hook is matched (confirmed via debug logs) but execution fails for prompt type hooks.

Steps to Reproduce

  1. Add the following to .claude/settings.json:
"hooks": {
  "SessionStart": [
    {
      "hooks": [
        {
          "type": "prompt",
          "prompt": ".claude/hooks/welcome.md"
        }
      ]
    }
  ]
}
  1. Start a new Claude Code session
  2. Error appears: SessionStart:startup hook error

Expected Behavior

The prompt should be loaded and executed without error, similar to how command type hooks work.

Actual Behavior

Error message SessionStart:startup hook error appears immediately on session start.

Debug Output (claude -d hooks)

Found 1 hook matchers in settings
Matched 1 unique hooks for query "startup" (1 before deduplication)

The hook is found and matched, but execution fails.

Additional Context

  • type: "command" hooks work without error (but don't display output to user)
  • UserPromptSubmit with type: "prompt" appears to work as a workaround
  • This behavior is consistent across multiple attempts and configuration changes

Environment

  • OS: macOS Darwin 24.6.0 (Apple Silicon)
  • Claude Code: Latest version

View original on GitHub ↗

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