[BUG] Invalid Version: 2.1.0 (2026-01-07) /$bunfs/root/claude:810:8909
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?
Title: Invalid Version error when running Claude Code in Windsurf IDE
Description:
Running Claude Code inside Windsurf IDE throws a semver parsing error on startup.
Error:
ERROR Invalid Version: 2.1.0 (2026-01-07)
Root Cause:
The version string 2.1.0 (2026-01-07) is being passed to the semver library, but the date suffix in parentheses makes it invalid. Semver expects the format X.Y.Z without additional text.
Environment:
Claude Code version: 2.1.0
IDE: Windsurf
OS: Windows with WSL2
Stack trace excerpt:
RO (/$bunfs/root/claude:810:8909)
Aq0 (/$bunfs/root/claude:810:14035)
Jq0 (/$bunfs/root/claude:810:14587)
The error originates in the SemVer constructor when parsing the version string.
Expected behavior:
Claude Code should either strip the date suffix before parsing, or use a version string without the date appended.
What Should Happen?
When Claude Code reads or constructs its version string, it should pass only the semver-compliant portion (2.1.0) to the semver library for parsing/comparison operations.
The date suffix (2026-01-07) can be retained for display purposes (e.g., in --version output or logs), but must be stripped before any semver operations like:
Version comparison
Version validation
Range checking
Possible fixes:
Strip the date before parsing - Use a regex like /^(\d+\.\d+\.\d+)/.exec(versionString)[1] to extract just the semver portion before passing to the semver library
Store separately - Keep the version (2.1.0) and build date (2026-01-07) as separate values, only combining them for display
Use semver build metadata - If the date needs to be part of the version string, use the semver-compliant format: 2.1.0+20260107 (build metadata after + is ignored in comparisons)
Error Messages/Logs
ERROR Invalid Version: 2.1.0 (2026-01-07)
/$bunfs/root/claude:810:8909
Stack trace:
- RO (/$bunfs/root/claude:810:8909)
- Aq0 (/$bunfs/root/claude:810:14035)
- Jq0 (/$bunfs/root/claude:810:14587)
- <anonymous> (/$bunfs/root/claude:3022:4324)
- at sort (unknown)
- tYD (/$bunfs/root/claude:3022:4310)
- P6D (/$bunfs/root/claude:3022:13859)
- _4 (/$bunfs/root/claude:690:20692)
- Qf (/$bunfs/root/claude:690:39063)
- ms (/$bunfs/root/claude:690:49670)
Error occurs in SemVer constructor when parsing version string:
class RO{constructor(H,$){
// ...
if(!A)throw TypeError(`Invalid Version: ${H}`);
// ...
}}
The semver library expects format "X.Y.Z" but receives "2.1.0 (2026-01-07)" which fails the regex validation against the FULL or LOOSE semver patterns.
Steps to Reproduce
- Install Windsurf IDE
- Install Claude Code CLI (
npm install -g @anthropic-ai/claude-codeor via the recommended installation method) - Open Windsurf IDE
- Open the integrated terminal within Windsurf
- Run
claudeto start Claude Code - Error immediately appears on startup before the interactive prompt loads
Note: The issue appears to be specific to running Claude Code within Windsurf's integrated terminal environment. Claude Code may work correctly when run directly from a standalone WSL2/terminal session outside of Windsurf.
Claude Model
Other
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.0 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗