[BUG] - Native installation v2.1.15 interactive mode exits immediately on WSL (Ubuntu 20.04)
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?
After migrating from npm to native installation on WSL, the interactive mode (TUI) renders the welcome screen but immediately exits with code 0. The non-interactive mode (-p flag) works correctly.
What Should Happen?
When running claude in interactive mode, the TUI (Terminal User Interface) should remain open and wait for user input. The user should be able to type prompts, interact with the interface, and the session should only end when the user explicitly exits (using /exit, Ctrl+C, or similar).
The interactive mode should behave the same as it does with the npm installation, which works correctly on the same WSL environment.
Error Messages/Logs
Steps to Reproduce
Install Claude Code using native installer: curl -fsSL https://claude.ai/install.sh | sh
Run claude in any directory
The welcome screen appears briefly then exits immediately back to shell prompt
Expected behavior:
Interactive mode should remain open and wait for user input.
Actual behavior:
The TUI renders completely (welcome banner, prompt, tips) but exits immediately with code 0.
Diagnostic findings:
Non-interactive mode works fine:
bash$ claude -p "hello, respond only 'works'"
works
2. `strace` output shows clean exit with no errors:
15201 exit_group(0)
15201 +++ exited with 0 +++
TTY detection is correct:
bash$ [ -t 0 ] && echo "stdin is TTY" || echo "stdin is NOT TTY"
stdin is TTY
$ [ -t 1 ] && echo "stdout is TTY" || echo "stdout is NOT TTY"
stdout is TTY
No aliases or shell configurations interfering:
bash$ type claude
claude is hashed (/home/user/.local/bin/claude)
$ alias claude 2>/dev/null
(empty)
$ grep -r "claude" ~/.bashrc ~/.zshrc ~/.profile ~/.inputrc 2>/dev/null
(empty)
Resetting configuration (~/.claude.json) did not help.
Tested with clean environment - same issue:
bash$ env -i HOME="$HOME" PATH="/home/user/.local/bin:/usr/local/bin:/usr/bin:/bin" TERM=xterm-256color claude
Still exits immediately
Workaround:
Reverting to npm installation resolves the issue:
bashrm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
npm install -g @anthropic-ai/claude-code
The npm version (2.1.15) works correctly in interactive mode on the same WSL environment.
Additional context:
Previously had both npm and native installations simultaneously (removed npm version before testing)
claude doctor showed correct native installation after migration
No error logs found in ~/.claude/logs/ or ~/.local/share/claude/logs/
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Claude Code v2.1.15
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Environment:
OS: WSL 1 / Ubuntu 20.04 on Windows
Claude Code version: 2.1.15 (native)
Terminal: Windows Terminal, Ubuntu WSL terminal, PhpStorm terminal (all affected)
Shell: bash
Terminal size: 30 rows × 120 columns
11 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I have the same issue after switching to the native version, after a reboot.
WSL 1, Ubuntu 22.04.5 LTS, v2.1.15
The npm version works just fine.
Can you check if this works in 2.1.17?
2.1.17 still suffers from the same defect, at least on Windows. Claude is unusable in VS Code because of this and the broken plug-in (which makes non-terminal mode unusable).
Still bugged
I experienced this exact same thing today. npm install works but not on native. I downgraded the native to 2.0.42 and it worked but then it auto updated and the crashes came back. Nothing appears to be out of sorts in the debug log.
I'm having the same issues with Claude native in Powershell. It was working fine until the 2.1.15 debacle. I got that AVX error when it auto updated to 2.1.15 and since then I've not gotten the windows native to work again, even rolling back to older versions. I've tried completely removing Claude and all it's files and installing various native versions. Same issue, just crashes immediately with no errors or logs that I can find.
I can however get the NPM install to work just fine. I've been using the NPM v.2.1.15 the last few days and this morning I attempted to do Claude install latest and native 2.1.19 is still suffering from the same issues. I installed NPM v2.1.19 and it's working fine.
Experiencing the same issue on a different WSL/Ubuntu version with additional findings.
Environment:
WSL2 / Ubuntu 24.04 (Windows host)
Node.js: v22.18.0 (via nvm, Linux binary)
Shell: bash
Tested on v2.1.33, v2.1.39, v2.1.41, and v2.1.47 — all freeze with native binary
Same symptoms: Native installer TUI renders welcome screen but keyboard input is completely dead. claude -p works fine. Reverting to npm installation (npm install -g @anthropic-ai/claude-code) fixes it immediately in the same terminal session.
Additional finding — auto-migration keeps re-breaking it: Even after reverting to npm and setting "autoUpdates": false in ~/.claude.json, the npm package contains migration code that periodically switches "installMethod" back to "native" and reinstalls the native binary to ~/.local/bin/claude. This re-triggers the freeze without any user action. The "autoUpdatesProtectedForNative" flag in .claude.json also resets itself to true.
Current workaround: npm installation with "installMethod" manually set to "npm", native binary paths blocked (symlink ~/.local/bin/claude back to the npm binary, ~/.local/share/claude set to read-only to prevent native version downloads).
Things that did NOT fix it: version rollback, config reset (rm -rf ~/.claude), clean PATH (stripping all /mnt/c/ Windows paths), stty sane && reset, script -q /dev/null -c claude, different TERM values, computer restart, uninstalling the Windows native installation.
With npm being deprecated, this is becoming a blocker for WSL2 users since the only working install method is being phased out.
I found that the cause was I was force-enabling sandbox. Of course I would prefer to keep sandbox enabled. Once I set sandbox.enabled to false it works.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
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.