SessionStart HTTP hooks silently fail (other "command only" events work fine)

Resolved 💬 4 comments Opened Mar 2, 2026 by nhuerta Closed Apr 30, 2026

Environment

  • Claude Code version: 2.1.63
  • OS: macOS (Darwin 23.5.0, arm64)
  • Shell: bash

Description

HTTP hooks (type: "http") configured for SessionStart never fire. The HTTP request never reaches the server. All other hook events — including ones the docs also list as "command only" like SessionEnd, Notification, and SubagentStart — work correctly with HTTP hooks.

Steps to reproduce

  1. Run a local HTTP server on port 3333 with request logging enabled
  2. Configure SessionStart as an HTTP hook in ~/.claude/settings.json:

``json
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "http",
"url": "http://localhost:3333/hook"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "http",
"url": "http://localhost:3333/hook"
}
]
}
]
}
}
``

  1. Start a new Claude Code session
  2. Exit the session

Expected behavior

Both SessionStart and SessionEnd HTTP requests arrive at the server.

Actual behavior

  • SessionEnd arrives correctly: POST /hook with hook_event_name: "SessionEnd"
  • SessionStart never arrives — no request at all

The hook is loaded (confirmed via /hooks menu). The server is running (confirmed by other events arriving). The request simply never gets sent.

Workaround

Using a type: "command" hook with curl works:

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "curl -s -X POST http://localhost:3333/hook -H 'Content-Type: application/json' -d '{\"hook_event_name\":\"SessionStart\"}'"
          }
        ]
      }
    ]
  }
}

Likely cause

The CHANGELOG for v2.1.48 mentions:

"Improved startup performance by deferring SessionStart hook execution, reducing time-to-interactive by ~500ms."

The deferred execution path likely doesn't dispatch HTTP hooks, only command hooks.

Note on docs vs behavior

The hooks reference lists SessionStart under "Events that only support type: command hooks." However, other events on that same list (SessionEnd, Notification, SubagentStart, SubagentStop, PreCompact) do work with HTTP hooks. SessionStart is the only one that actually enforces the restriction. See related issue for the docs inconsistency.

View original on GitHub ↗

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