Skip to content

Crash: React hook dependency array undefined when opening new session while another is running #20685

Closed as duplicate

Description

@xavierchoi

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

  1. Open a terminal and start a Claude Code session
  2. While the first session is still running, open a new terminal
  3. Start a new Claude Code session in the second terminal
  4. 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
claude

Activity

  1. github-actions commented on Jan 24, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [Bug] Previous session becomes unresponsive when opening new session in same project #13268
    2. [Bug] Multiple Claude Code instances freeze on macOS due to file locking conflict #13287
    3. Bug: Multi-Session Hang - Only Latest CLI Session Works (WSL2 + OAuth) #13448

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. added
    duplicateThis issue or pull request already exists
    and removed
    bugSomething isn't working
    has reproHas detailed reproduction steps
    platform:macosIssue specifically occurs on macOS
    on Jan 29, 2026
  3. github-actions commented on Jan 29, 2026

    @github-actions

    This issue has been automatically closed as a duplicate of #13268.

    If this is incorrect, please re-open this issue or create a new one.

    🤖 Generated with Claude Code

  4. github-actions commented on Feb 6, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  5. locked as resolved and limited conversation to collaborators on Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions