CLI crashes with 'Invalid Version' when cachedChangelog contains date suffixes

Resolved 💬 3 comments Opened Jan 7, 2026 by ebueso-pn Closed Jan 11, 2026

Description

Claude Code fails to launch with the error Invalid Version: 2.1.0 (2026-01-07) at cli.js:869:8900.

Root Cause

The cachedChangelog field in ~/.claude.json contains changelog entries with version strings that include date suffixes in parentheses (e.g., ## 2.1.0 (2026-01-07)). The semver parser expects strict semver format (2.1.0) but fails on the date suffix.

Affected Code Path

The CLI's version sorting/comparison logic (cli.js around line 869) attempts to parse changelog version headers as semver, which fails when headers include date annotations.

Workaround

Remove the cachedChangelog field from ~/.claude.json:

jq 'del(.cachedChangelog)' ~/.claude.json > ~/.claude.json.tmp && mv ~/.claude.json.tmp ~/.claude.json

Suggested Fix

Any of the following would resolve the issue:

  1. Don't parse changelog version headers through the semver library
  2. Strip the date suffix before parsing (regex to extract just the version number)
  3. Use a more lenient version extraction pattern like /^##\s*(\d+\.\d+\.\d+)/

Environment

  • OS: macOS (Darwin 24.6.0)
  • Claude Code version: 2.0.76 (version that worked after clearing cache)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗