Interactive mode silently exits when working directory is $HOME
Resolved 💬 3 comments Opened Feb 2, 2026 by sirozzy Closed Feb 6, 2026
Bug Description
Claude Code interactive mode silently exits (exit code 0) immediately after rendering the welcome screen when the current working directory is $HOME (e.g., /root on a Linux server).
Non-interactive mode (claude -p 'hello') works fine from the same directory.
Steps to Reproduce
- SSH into a Linux server (Debian 10, kernel 4.19, Virtuozzo/OpenVZ VPS)
cd ~(ensure$PWD == $HOME)- Run
claude - Welcome screen renders, input prompt appears briefly
- Claude exits immediately with exit code 0 — no error message, no debug log entry about the exit
Expected Behavior
Interactive REPL should stay open and accept input.
Actual Behavior
The process exits silently with code 0 right after the REPL mounts. Debug logs show no error — the last entries are AutoUpdaterWrapper and REPL mounted, then nothing.
Workaround
Starting Claude from any subdirectory of $HOME works fine:
mkdir -p ~/workspace && cd ~/workspace && claude # works
cd ~ && claude # exits immediately
Environment
- Claude Code v2.1.29 (also reproduced with 2.1.22 and 2.1.19)
- Debian 10 (Buster), kernel 4.19.0
- glibc 2.28
- Node.js v22.22.0
- Virtuozzo/OpenVZ container
- Installed via npm (
@anthropic-ai/claude-code)
Debugging Done
strace -fshows no signal causing the exit — process exits cleanly- Debug logs (
~/.claude/debug/latest) show startup completes normally, REPL mounts, then no further entries - No
.claudeproject-level config conflict (renaming~/.claude/projects/-rootdid not help) - tmux does not help
- Setting
HOMEto a different directory and running from the same path works - The issue is specifically
$PWD == $HOME
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗