CLI crashes with 'Invalid Version' when parsing changelog with date in parentheses

Resolved 💬 17 comments Opened Jan 7, 2026 by omryn Closed Jan 7, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Description

Claude Code CLI v2.1.0 crashes on startup with "Invalid Version: 2.1.0 (2026-01-07)" error when parsing the changelog.

Error

ERROR  Invalid Version: 2.1.0 (2026-01-07)

file:///Users/.../node_modules/@anthropic-ai/claude-code/cli.js:869:8900

- iT (file:///.../cli.js:869:8900)
- SJ8 (file:///.../cli.js:869:14028)
- Object.dJ8 (file:///.../cli.js:869:14584)
-  (file:///.../cli.js:3091:4240)
-    at Array.sort (<anonymous>)

Root Cause

The changelog at ~/.claude/cache/changelog.md contains version headers in the format:

## 2.1.0 (2026-01-07)

The changelog parsing function eH1 extracts versions using:

let J = Y.split(" - ")[0]?.trim() || "";

This only handles the VERSION - DATE format, but the actual changelog uses VERSION (DATE) format with parentheses. When semver tries to parse "2.1.0 (2026-01-07)", it fails because the parenthetical date makes it an invalid semver string.

Workaround

Patch the CLI to also strip parenthetical dates:

sed -i.bak 's/Y\.split(" - ")\[0\]?\.trim()||""/Y.split(" - ")[0]?.trim().split(" (")[0]?.trim()||""/g' ~/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js

Suggested Fix

Update the version extraction to handle both formats:

let J = Y.split(" - ")[0]?.trim().split(" (")[0]?.trim() || "";

Environment

  • Claude Code version: 2.1.0
  • Install method: bun install -g @anthropic-ai/claude-code
  • OS: macOS (Darwin 24.6.0)

View original on GitHub ↗

17 Comments

kmaxii · 6 months ago

Same issue for me. On windows

dr-manhattan-1987 · 6 months ago

Same they broke claude in 2.1.0
Devs need to stop vibe coding

tonyadamsmba · 6 months ago

The problem is Claude Code is trying to parse a version string 2.1.0 (2026-01-07) that has a date suffix, and the semver library can't handle that format. It's a bug in Claude Code itself

`file:///Users/tonyadamsmbamapmatix/.nvm/versions/node/v22.18.0/lib/node_modules/@anthropi
c-ai/claude-code/cli.js:869:8900

-iT (file:///Users/tonyadamsmbamapmatix/.nvm/versions/node/v22.18.0/lib/node_modules/@ant
hropic-ai/claude-code/cli.js:869:8900)
-SJ8 (file:///Users/tonyadamsmbamapmatix/.nvm/versions/node/v22.18.0/lib/node_modules/@an
thropic-ai/claude-code/cli.js:869:14028)
-Object.dJ (file:///Users/tonyadamsmbamapmatix/.nvm/versions/node/v22.18.0/lib/node_modul
es/@anthropic-ai/claude-code/cli.js:869:14584)

  • (file:///Users/tonyadamsmbamapmatix/.nvm/versions/node/v22.18.0/lib/node_modules/@anthr

opic-ai/claude-code/cli.js:3091:4240)

  • at Array.sort (<anonymous>)

-de2 (file:///Users/tonyadamsmbamapmatix/.nvm/versions/node/v22.18.0/lib/node_modules/@an
thropic-ai/claude-code/cli.js:3091:4224)
-VA9 (file:///Users/tonyadamsmbamapmatix/.nvm/versions/node/v22.18.0/lib/node_modules/@an
thropic-ai/claude-code/cli.js:3091:13453)
-GY (file:///Users/tonyadamsmbamapmatix/.nvm/versions/node/v22.18.0/lib/node_modules/@ant
hropic-ai/claude-code/cli.js:743:20692)
-V8 (file:///Users/tonyadamsmbamapmatix/.nvm/versions/node/v22.18.0/lib/node_modules/@ant
hropic-ai/claude-code/cli.js:743:39055)
-Ae (file:///Users/tonyadamsmbamapmatix/.nvm/versions/node/v22.18.0/lib/node_modules/@ant
hropic-ai/claude-code/cli.js:743:49661)`

admmoises · 6 months ago

mac tahoe, same issue

nirus · 6 months ago

Claude desktop guided me here that Cli has issue. Wow!

itorz7 · 6 months ago

me too

<img width="479" height="187" alt="Image" src="https://github.com/user-attachments/assets/37c0d546-ca61-4aba-bffc-bb33e9659baa" />

benmarten · 6 months ago

Temp workaround, downgrade: bun i -g @anthropic-ai/claude-code@2.0.74

TrentonCasonSORS · 6 months ago

You can also make the cache directory read only as well:
rm -rf ~/.claude/cache && mkdir ~/.claude/cache && chmod 000 ~/.claude/cache

This blocks the changelog download entirely. Claude Code starts fine without it.

benmarten · 6 months ago
You can also make the cache directory read only as well: rm -rf ~/.claude/cache && mkdir ~/.claude/cache && chmod 000 ~/.claude/cache This blocks the changelog download entirely. Claude Code starts fine without it.

This worked (although I needed sudo) - How to restore this after? Thx!

nickolay-kondratyev · 6 months ago

I have attempted to downgrade but it appears the previous way to stop Claude from auto-updates, does not work anymore

Has this configuration changed to some new method?

>claude config set -g autoUpdaterStatus disabled
error: unknown option '-g'
stevehansen · 6 months ago
You can also make the cache directory read only as well: rm -rf ~/.claude/cache && mkdir ~/.claude/cache && chmod 000 ~/.claude/cache This blocks the changelog download entirely. Claude Code starts fine without it.

similar on Windows, I updated the file to remove the date part and then made the file read-only

TrentonCasonSORS · 6 months ago
> You can also make the cache directory read only as well: rm -rf ~/.claude/cache && mkdir ~/.claude/cache && chmod 000 ~/.claude/cache > This blocks the changelog download entirely. Claude Code starts fine without it. This worked (although I needed sudo) - How to restore this after? Thx!

To restore after they release a fix:

sudo chmod 755 ~/.claude/cache
rm -rf ~/.claude/cache

nickolay-kondratyev · 6 months ago

Very curious how this was able to get through the release process, seems like this was an issue due to testing done without the change log changes on internal version. Can the release process be adjusted to download and try the final bundled Claude Code prior to releasing it to production?

tonyadamsmba · 6 months ago

Easy fix. just change the date (## 2.1.0 (2026-01-07)) to ## 2.1.0 - 2026-01-07

go to mac hd, users, open your user. press command shift (.) to open hidden files.
open .claude > cache
The changelog at ~/.claude/cache/changelog.md

GriffinSchneider · 6 months ago

Messing with ~/.claude/cache and downgrading didn't resolve the issue for me (on MacOS), but I got it working by patching cli.js - it's in ~/.nvm/versions/node/v24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.js or similar depending on your Node install (it will be in the stack trace when claude crashes).

Find

B=A.trim().match(Q.loose?KsA

and replace with

B=A.trim().replace(' (2026-01-07)', '').match(Q.loose?KsA
bcherny collaborator · 6 months ago

Fixed! Restart to update.

github-actions[bot] · 6 months ago

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.