[BUG] Claude Code 2.1.30/2.1.31 silently exits on startup with code 0 on Linux 4.18.0
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 versions 2.1.30 and 2.1.31 silently exit immediately after startup with exit code 0. Version 2.1.19 works correctly. No error message is displayed.
Environment
- OS: Linux 4.18.0 (RHEL/CentOS)
- Node: v18.20.8
- Install method: Native installer
- Working version: 2.1.19
- Broken versions: 2.1.30, 2.1.31
Behavior
The process completes its full startup sequence, renders the welcome screen and REPL prompt, then silently exits with code 0 within ~1 second.
--version and --help work fine. Only interactive mode is affected.
Debug logs
Debug logs (~/.claude/debug/) confirm startup completes through [REPL:mount] REPL mounted, disabled=false, UI renders, and then the process exits with no error or crash logged.
Tested
- Different terminal sizes (18 rows to 40+ rows)
- Different TERM values (TERM=xterm-256color)
- Explicit stdin (< /dev/tty)
- Minimal environment (env -i HOME=$HOME PATH=$PATH TERM=$TERM)
- autoUpdates: false in .claude.json
All produce the same result.
Workaround
Pinned to 2.1.19 by setting the immutable flag on the versions directory to prevent the auto-updater from re-downloading broken versions:
chattr +i /root/.local/share/claude/versions/
Note: autoUpdates: false in .claude.json did not prevent the auto-updater from running.
What Should Happen?
Claude should not automatically exit on startup.
Error Messages/Logs
Steps to Reproduce
Simply start claude with the command : "claude"
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.19
Claude Code Version
2.1.31
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
9 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Although similar in behaviour, the issue seems different than the other similar ones found. In my case, 2.1.19 works perfectly well. And I cannot reproduce the issue with 2.1.19...
I'm having the same problem with RHEL 8.10. I think there might be a typo in the original report, though. The last working version is 2.1.29 rather than 2.1.19. This doesn't appear to be a duplicate issue.
I didn't try all previous versions - simply used the last 'stable' version and it worked. One workaround that I found in these forums and that work for me is to init Git in the project folder. Weirdly enough, it solves the issue.
Same issue, since 2.1.29, native installer, Rocky 8.10. Run with clean terminal env too, issue still persists.
The issue does not happen if there is a git repository in the current directory. If I just run
git initthenclaudethen the session does not exit prematurely.Same problem here.
cat /etc/redhat-release
Rocky Linux release 8.10 (Green Obsidian)
uname -a
Linux homelab-01 4.18.0-553.109.1.el8_10.x86_64 #1 SMP Tue Mar 3 16:05:15 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Initializing
git initworks fine! Thanks @netgullYou should no longer see this premature exit on Claude Code 2.1.76.
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.