[BUG] Claude Code segfaults on startup when Anthropic API is unreachable (should fail gracefully)

Resolved 💬 5 comments Opened Mar 18, 2026 by madcap66 Closed Apr 17, 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?

Claude Code (v2.1.78 and v2.1.76) crashes with Segmentation fault (core dumped) on startup — including claude --version — when the Anthropic API is experiencing issues. Proven by running sudo unshare -n sudo -u $USER ~/.local/share/claude/versions/2.1.76 --version which works perfectly, while the same command with network access segfaults. The binary should display a connection error, not crash.

What Should Happen?

A human-readable error message like "Unable to connect to Anthropic API. Check your connection or visit status.claude.com" and a non-zero exit code. claude --version should never require network access at all.

Error Messages/Logs

$ claude --version
Segmentation fault (core dumped)

# From dmesg:
2.1.78: claude: potentially unexpected fatal signal 11.
CPU: 0 PID: 3128 Comm: claude Not tainted 6.6.87.2-microsoft-standard-WSL2 #1

# Proof it's network-related:
$ sudo unshare -n sudo -u $USER ~/.local/share/claude/versions/2.1.76 --version
2.1.76 (Claude Code)

Steps to Reproduce

  1. Have Claude Code installed via native installer on WSL2
  2. Wait for an Anthropic API outage (status.claude.com shows incident)
  3. Run claude --version
  4. Observe: Segmentation fault (core dumped)
  5. Run sudo unshare -n sudo -u $USER ~/.local/share/claude/versions/2.1.76 --version — works fine, proving the crash is caused by the network call

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.76 (worked the night before; same binary segfaults the next day during API outage)

Claude Code Version

2.1.78

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

  • Fresh reinstall did not fix it
  • Renaming ~/.claude did not fix it
  • wsl --shutdown and full Windows reboot did not fix it
  • node -e "console.log('ok')" works fine
  • Occurred during March 17-18 2026 API incidents on status.claude.com
  • glibc 2.39, CPU has AVX/AVX2 support

View original on GitHub ↗

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