[BUG] Claude Code CLI hangs forever on Bash()/shell commands in WSL (even with correct user/permissions, native Linux path)

Status Closed — not planned
Maintainer reply None cached
Activity 11 comments · opened Aug 3, 2025 · closed Jan 24, 2026

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

  1. 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.
  2. Ensure user has full sudo rights (david ALL=(ALL:ALL) ALL in /etc/sudoers, also in the sudo group).
  3. Confirm that ~/.local/bin is in the user’s PATH and that claude runs from any location.
  4. Open a terminal, change to a native Linux folder (e.g. /home/david/testclaude).
  5. Start claude CLI, ask it to run a simple shell command (e.g. df -h or ls).
  6. 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.d rules 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/c to /home/david does 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.

View original on GitHub ↗

11 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/4077
  2. https://github.com/anthropics/claude-code/issues/619
  3. https://github.com/anthropics/claude-code/issues/4849

If your issue is a duplicate, please close it and 👍 the existing issue instead.

🤖 Generated with Claude Code

308twin · 1 year ago

same problem

skerit · 1 year ago

A simple bash command like pwd && ls -la | head -10 can 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 ls is especially the issue

PureLo · 1 year ago

same 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" />

PureLo · 12 months ago
same to me  一样 [env]  [环境] 5.15.167.4-microsoft-standard-WSL2 Distributor ID: Ubuntu   发行商 ID: Ubuntu Description: Ubuntu 22.04.5 LTS 描述: Ubuntu 22.04.5 LTS Release: 22.04  版本:22.04 Codename: jammy  代号:jammy <img alt="Image" width="1377" height="351" src="https://private-user-images.githubusercontent.com/65882628/477414952-80a509c6-c678-45e9-9a23-1c6315e68e50.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTY2OTQ5OTgsIm5iZiI6MTc1NjY5NDY5OCwicGF0aCI6Ii82NTg4MjYyOC80Nzc0MTQ5NTItODBhNTA5YzYtYzY3OC00NWU5LTlhMjMtMWM2MzE1ZTY4ZTUwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA5MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwOTAxVDAyNDQ1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZmYWY2NDZiOTQxMGExYTc5ZjMzOWNkNWIwNjE5OWRmYjEzMTAzZTg1NjA2ZmVhMWNhNmEyNGYzMjFlZTlkNDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.dltiDLvZyVi3WcysGUfEIQIG1X7k1yY0mEjts2hbS-w">

I just solved it.
The reason is that I loading fish in /etc/profile.

cat /etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

# fish

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.

pomazanbohdan · 10 months ago
  • 2.0.15 (Claude Code)
  • Linux ASUS370 6.6.87.2-microsoft-standard-WSL2 # 1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
  • zsh
github-actions[bot] · 8 months ago

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.

beeGiaLe · 8 months ago

<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.

github-actions[bot] · 7 months ago

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.

marcindulak · 7 months ago

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.

github-actions[bot] · 7 months ago

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.