Crash: React hook dependency array undefined when opening new session while another is running
Description
Claude Code crashes with a React internal error when opening a new terminal session while an existing Claude Code session is already running. The crash occurs in the existing session immediately after the new session is opened.
Environment
- Claude Code version: 2.1.19
- OS: macOS 15.3 (Darwin 25.2.0)
- Architecture: arm64 (Apple Silicon)
- Runtime: Bun
Steps to Reproduce
- Open a terminal and start a Claude Code session
- While the first session is still running, open a new terminal
- Start a new Claude Code session in the second terminal
- The first session crashes immediately
Error Message
ERROR undefined is not an object (evaluating 'N.length')
/$bunfs/root/claude:546:20560
Stack Trace
- Yq (/$bunfs/root/claude:546:20560)
- N8 (/$bunfs/root/claude:546:29630)
- <anonymous> (/$bunfs/root/claude:349:14657)
- ck (/$bunfs/root/claude:588:196)
- i90 (/$bunfs/root/claude:5925:41351)
- Q1T (/$bunfs/root/claude:5940:9596)
- e1 (/$bunfs/root/claude:546:20770)
- fq (/$bunfs/root/claude:546:39163)
- FB (/$bunfs/root/claude:546:49786)
- Kx (/$bunfs/root/claude:546:86051)
Analysis
The error occurs in the React reconciler's hook dependency comparison function (Yq is minified areHookInputsEqual). The N.length access fails because N (previous dependencies array) is undefined.
This suggests a race condition or state corruption when multiple Claude Code sessions interact with shared resources (possibly session state files, sockets, or IPC mechanisms).
Expected Behavior
Multiple Claude Code sessions should be able to run concurrently without crashing each other.
Workaround
Killing all Claude Code processes and restarting resolves the issue:
pkill -f claude
claudeThis issue has 3 comments on GitHub. Read the full discussion on GitHub ↗