[BUG] CLI crashes on startup with ERROR is not defined on v2.1.217

Status Open
Reported on v2.1.217
Maintainer reply None cached
Activity 0 comments · opened Jul 22, 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?

Bug Report: CLI crashes on startup with ERROR is not defined on v2.1.217
Summary

Claude Code v2.1.217 fails to start on Linux, crashing immediately with an unnamed is not defined ReferenceError before any UI renders. The crash occurs in every context tested: inside the IDE integrated terminal, in a plain system terminal, with a clean config, and with no IDE process running. Downgrading to v2.1.200 resolves the issue completely.

An aggravating factor: the auto-updater silently re-installs v2.1.217 over a manual downgrade, causing the bug to reappear across all terminals without any user action.

Environment
Claude Code version: 2.1.217 (broken), 2.1.200 (works)
OS: Fedora Linux
Install method: native installer (~/.local/share/claude/versions/, symlinked from ~/.local/bin/claude)
IDE: Cursor

Error output

$ claude
  ERROR   is not defined
 /$bunfs/root/src/entrypoints/cli.js:41374:21099
 - <anonymous> (/$bunfs/root/src/entrypoints/cli.js:41374:21099)
 - useMemo (/$bunfs/root/src/entrypoints/cli.js:3233:106806)
 - <anonymous> (/$bunfs/root/src/entrypoints/cli.js:3221:22795)
 - qrl (/$bunfs/root/src/entrypoints/cli.js:41374:21091)
 - ms (/$bunfs/root/src/entrypoints/cli.js:3233:21375)
 - KA (/$bunfs/root/src/entrypoints/cli.js:3233:40475)
 - Pq (/$bunfs/root/src/entrypoints/cli.js:3233:51402)
 - bX (/$bunfs/root/src/entrypoints/cli.js:3233:89075)
 - she (/$bunfs/root/src/entrypoints/cli.js:3233:88021)
 - ihe (/$bunfs/root/src/entrypoints/cli.js:3233:87841)
 - async dVS (/$bunfs/root/src/entrypoints/cli.js:42444:5097)

Note that the error message contains no symbol name — just is not defined with a leading blank. This makes the failure impossible to diagnose from the user side. --debug produces identical output with no additional detail.

How it started
The CLI was working normally. On opening the IDE, the Claude Code extension prompted for re-authentication. After logging in again, the CLI auto-updated to 2.1.217 and stopped launching entirely — first in the IDE terminal, then in every terminal.

Fix / workaround
claude install 2.1.200

The CLI launches normally on 2.1.200.

Secondary issue: auto-updater re-installs the broken version
After successfully downgrading to 2.1.200 and confirming the CLI worked in a system terminal, opening the IDE caused the CLI to silently update back to 2.1.217. The bug then reappeared in all terminals, including the system terminal that had just been working — making it look like a nondeterministic failure rather than a version issue.

Version directory after this happened:

$ ls -la ~/.local/share/claude/versions/
2.1.200
2.1.215
2.1.216
2.1.217   <- reinstalled automatically

Setting DISABLE_AUTOUPDATER=1 and re-installing 2.1.200 produced a stable working state, including inside the IDE terminal.

Suggestion: the updater should not silently overwrite a version the user explicitly installed via claude install <version>, or should at minimum surface that an update occurred.

Suggested fixes

  • Fix the underlying ReferenceError in the useMemo path at startup on 2.1.217
  • Include the missing symbol name in the error output — ERROR is not defined with no identifier gives users nothing to work with, and --debug adds no information
  • Treat a manual claude install <version> as a version pin, or warn before the auto-updater replaces it

What Should Happen?

Claude Code should have started normally for me to use it

Error Messages/Logs

Steps to Reproduce

Steps to reproduce

  1. Run Claude Code v2.1.217 on Fedora Linux (native installer)
  2. Run claude from any directory
  3. Crash occurs immediately, before any UI renders

What was ruled out
Each of the following was tested and did not fix the problem on 2.1.217:

  • claude update
  • Removing ~/.claude.json and ~/.claude/.credentials.json to force a clean login
  • Removing ~/.claude/statsig and ~/.claude/local
  • Full config wipe: rm -rf ~/.claude ~/.claude.json ~/.cache/claude-cli-nodejs
  • Running with env -u CLAUDE_CODE_SSE_PORT claude (the only Claude-related env var present)
  • Deleting ~/.claude/ide/*.lock
  • Killing all IDE processes and running from a plain GNOME Terminal
  • Running from outside the project directory (no project-local .claude/ config involved)
  • Removing a stale duplicate npm-global install at /usr/bin/claude (v2.1.112), leaving a single native install

The crash reproduces with a completely clean config, no IDE running, a single installation, and from an arbitrary working directory.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.200

Claude Code Version

2.1.217

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Cursor

Additional Information

_No response_

View original on GitHub ↗