[BUG] `claude agents` does not use `claude` binary in path, but rather tries to identify path
Resolved 💬 6 comments Opened May 14, 2026 by secustor Closed May 14, 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 using claude agents session can not be spawend and are failing with
'[worker crashed (ENOENT: no such file or directory, posix_spawn
'/opt/homebrew/Cellar/<name of our private ClaudeCode cask>/2.1.140/libexec/claude') — respawning…]
Note that ClaudeCode tries to find the binary in the Cellar ( Formulas ) instead of Caskroom ( Casks )
What Should Happen?
claude agents should simply use claude from PATH or preferable use argv[0] to spawn subsessions.
Error Messages/Logs
No further logs are given as `claude agents` has no `--debug` option
Steps to Reproduce
- Download the npm archive for an architecture e.g
https://registry.npmjs.org/@anthropic-ai/claude-code-darwin-x64/-/claude-code-darwin-x64-2.1.141.tgz - Extract it
- Run
packages/claude agents - Trigger a new session
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.141
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗