claude-code - 💡(How to fix) Fix [BUG] SessionStart Hook in Project Settings Crashes All Agent View Background Sessions

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

Fix Action

Fix / Workaround

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.

  1. Run claude agents from that project directory
  2. Dispatch any session

Code Example

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)

---

"hooks": {
  "SessionStart": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "echo test"
        }
      ]
    }
  ]
}
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?

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

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 in Project Settings Crashes All Agent View Background Sessions