Silent exit (code 0) on non-git directories on RHEL 8
Description
Claude Code 2.1.39 silently exits with code 0 (no error message) approximately 3 seconds after starting from any non-git directory on RHEL 8. Starting from a git directory works fine.
Environment
- OS: RHEL 8 (
4.18.0-553.104.1.el8_10.x86_64) - Claude Code: 2.1.39
- Terminal: 210x49
- Installation: Native, fresh install
Reproduction
mkdir /tmp/claude-test && cd /tmp/claude-test && claude
# → exits silently with code 0 after ~3 seconds
Workaround:
mkdir /tmp/claude-test && cd /tmp/claude-test && git init && claude
# → works fine
Debug log
The debug log (~/.claude/debug/<session>.txt) shows the full startup completes successfully, but then the session voluntarily exits:
[DEBUG] [REPL:mount] REPL mounted, disabled=false
[DEBUG] Trust not accepted for current directory - skipping plugin installations
[DEBUG] No CLAUDE.md/rules files found
...
[DEBUG] Released PID lock for 2.1.39
The showSetupScreens() step completes in ~350ms — too fast for any user interaction. It appears the trust/onboarding prompt for non-git directories either doesn't render or auto-dismisses, causing Claude to interpret it as "trust not accepted" and exit.
For comparison, when starting from a git directory, showSetupScreens() takes ~1700ms (actual user interaction with the trust prompt) and the session starts normally.
Additional context
- This does not reproduce on Manjaro (works fine even from
/) - Happens with or without another Claude session running
- Every non-git directory is affected, not just specific ones
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗