[BUG] Claude Code CLI hangs forever on Bash()/shell commands in WSL (even with correct user/permissions, native Linux path)
Environment
- Platform: [x] Other (Anthropic Claude Code CLI)
- Claude CLI version: 1.0.67 (
claude --version) - Operating System: Windows 11, WSL2, Debian 12 (latest, fully updated)
- Terminal: Windows Terminal, Bash (
/bin/bash)
Bug Description
When running any Bash() shell command (such as df -h, ls, pwd, etc.) via Claude Code CLI, the tool hangs forever at “Envisioning…” or “Musing…”.
This occurs even when launched from a native Linux folder (e.g. /home/david/testclaude), not just from /mnt/c or Windows-mount paths.
Other CLI tools (e.g. Gemini CLI) and native bash shell commands work perfectly in the same environment and folders. I got Claude Desktop for Windows installed: works perfectly. Also running claude in native Linux, also works perfectly. in WSL everything seems to work except ANY Bash([command]). Various uninstall reinstall via npx and also via native install...sh didnt change this.
Steps to Reproduce
- Install Claude Code 1.0.67 via the native installer (
curl -fsSL https://claude.ai/install.sh | bash) as a normal user (david), not root. - Ensure user has full sudo rights (
david ALL=(ALL:ALL) ALLin/etc/sudoers, also in thesudogroup). - Confirm that
~/.local/binis in the user’s PATH and thatclauderuns from any location. - Open a terminal, change to a native Linux folder (e.g.
/home/david/testclaude). - Start
claudeCLI, ask it to run a simple shell command (e.g.df -horls). - Observe that Claude CLI hangs forever on “Envisioning…” with no output.
Expected Behavior
Claude CLI should run the shell command and return its output promptly (as it does on native Linux).
Actual Behavior
Claude CLI hangs on “Envisioning…” or “Musing…” for all shell commands—indefinitely.
- The same commands work instantly in Gemini CLI and native shell.
- The issue persists regardless of permissions, user config, or working directory (even in
/home/david).
Additional Details
- Time sync is verified, no drift between Windows and WSL clocks.
- User has full sudo rights, and shell commands run fine manually.
- Tried full uninstall/reinstall of Claude CLI, both as user and as root (with proper cleanup).
- No custom
/etc/sudoers.drules left. - WSL2, Debian, all packages and kernel up to date.
Screenshots
<img width="945" height="941" alt="Image" src="https://github.com/user-attachments/assets/2c5c4a90-3b41-4d87-a87b-65b8dd182da8" />
<img width="1588" height="656" alt="Image" src="https://github.com/user-attachments/assets/21f7354d-f1e7-450a-bd58-b0cbc741f151" />
<img width="1007" height="334" alt="Image" src="https://github.com/user-attachments/assets/69627912-c925-4bc3-9954-2b8442e57e58" />
it works in parallel terminal in UBUNTU (but i need it to run in debian):
<img width="1214" height="932" alt="Image" src="https://github.com/user-attachments/assets/ebc6e707-5607-4180-b0ad-4cafc098aefe" />
See attached for the CLI hang in /home/david/testclaude.
Workarounds Tried
- Native shell and Gemini CLI both work
- Changing folder from
/mnt/cto/home/daviddoes not help - Restarting WSL, Windows, and reinstalling Claude CLI does not help
Request
Please investigate and provide a workaround or fix for Claude CLI shell command execution in WSL environments.
11 Comments
Found 3 possible duplicate issues:
If your issue is a duplicate, please close it and 👍 the existing issue instead.
🤖 Generated with Claude Code
same problem
A simple bash command like
pwd && ls -la | head -10can sometimes completely hang. Luckily it eventually times out after 2 minutes, but that's a long time if it this happens multiple times.*Edit: it seems like
lsis especially the issuesame to me
[env]
5.15.167.4-microsoft-standard-WSL2
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
<img width="1377" height="351" alt="Image" src="https://github.com/user-attachments/assets/80a509c6-c678-45e9-9a23-1c6315e68e50" />
I just solved it.
The reason is that I loading fish in /etc/profile.
and now, I delete it, ,and use ``
chsh -s /usr/bin/fish`` to set fish as my deafult shell.Hope it's useful to you.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
<img width="1342" height="1716" alt="Image" src="https://github.com/user-attachments/assets/192b7990-62e9-436e-8813-39c9a1ca939e" />
The command is hanging for a long time, it switches between different messages/approaches, and finally makes an assumption that it has literally executed it, but it has not.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
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.