[BUG] Segmentation fault when running multiple Claude Code instances in parallel
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?
Claude Code crashes with segmentation fault when running multiple instances in parallel (e.g., in git worktrees workflow).
What Should Happen?
Claude Code should run stably in parallel instances without crashes.
Error Messages/Logs
[1] 7182 segmentation fault claude
Steps to Reproduce
- Set up multiple git worktrees for parallel development
- Run Claude Code in 2+ terminals simultaneously (in different worktree directories) that actively create subagents with different models (Opus/Sonnet/Haiku)
- Work normally in each instance
- Eventually (~1 in 10-15 sessions), one instance crashes with segfault
The crash occurs:
- With or without
--dangerously-skip-permissionsflag - Randomly during session (not tied to specific command)
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.19
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Environment
- Claude Code version: 2.1.19
- Node.js version: v20.13.1
- OS: macOS 13.6.6 (Ventura)
- Architecture: x86_64 (Intel Mac)
- Kernel: Darwin 22.6.0
Workaround
Restart Claude Code and use /resume to continue the session. This works reliably.
Additional Context
Using Claude Code with git worktrees workflow where 2-8 parallel instances may run simultaneously in different terminal tabs. Each instance works in its own worktree directory.
No crash logs found in ~/Library/Logs/DiagnosticReports/.
Possible Cause
Race condition in shared resource access (possibly ~/.claude directory, config files, or socket connections) when multiple instances run concurrently.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗