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)
17 Comments
Same issue for me. On windows
Same they broke claude in 2.1.0
Devs need to stop vibe coding
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)
opic-ai/claude-code/cli.js:3091:4240)
-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)`
mac tahoe, same issue
Claude desktop guided me here that Cli has issue. Wow!
me too
<img width="479" height="187" alt="Image" src="https://github.com/user-attachments/assets/37c0d546-ca61-4aba-bffc-bb33e9659baa" />
Temp workaround, downgrade:
bun i -g @anthropic-ai/claude-code@2.0.74You 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!
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?
similar on Windows, I updated the file to remove the date part and then made the file read-only
To restore after they release a fix:
sudo chmod 755 ~/.claude/cache
rm -rf ~/.claude/cache
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?
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
Messing with
~/.claude/cacheand downgrading didn't resolve the issue for me (on MacOS), but I got it working by patchingcli.js- it's in~/.nvm/versions/node/v24.8.0/lib/node_modules/@anthropic-ai/claude-code/cli.jsor similar depending on your Node install (it will be in the stack trace whenclaudecrashes).Find
and replace with
Fixed! Restart to update.
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.