[BUG] SessionStart Hook in Project Settings Crashes All Agent View Background Sessions

Resolved 💬 2 comments Opened May 18, 2026 by deanjrobertson00 Closed May 27, 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?

Every agent view background session crashes immediately when hooks in settings.json fire.
Workaround is to remove SessionStart hooks from project .claude/settings.json when using agent view.

What Should Happen?

Claude with Agent View session starts normally.

Error Messages/Logs

exit 1 before init — …at uSK (/$bunfs/root/src/entrypoints/cli.js:9092:233) at async SKO (/$bunfs/root/src/entrypoints/cli.js:19558:68) at async h4O (/$bunfs/root/src/entrypoints/cli.js:19595:313) Bun v1.3.14 (macOS arm64)


Daemon log pattern — supervisor spawns worker, worker crashes within ~50ms, repeated for every session:


[bg] bg spare spawned host pid=XXXXX
[bg] bg claimed-spare XXXXXXXX (fleet)
[bg] bg spare spawned host pid=XXXXX
[bg] bg settled XXXXXXXX (crashed)

Steps to Reproduce

  1. Add any SessionStart hook to a project .claude/settings.json, e.g.:
"hooks": {
  "SessionStart": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "echo test"
        }
      ]
    }
  ]
}
  1. Run claude agents from that project directory
  2. Dispatch any session

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.143

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

What I Ruled Out

  • Not the hook script content — even echo test as the command reproduces it
  • Not the matcher field — removed it, still crashes
  • Not a path/quoting issue — tested with absolute paths and simple commands
  • Not the global settings — clearing ~/.claude/settings.json entirely fixes it
  • Removing the hook entirely fixes the issue immediately

View original on GitHub ↗

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