Claude CLI Hangs or Becomes Unresponsive in WSL (Intermittent Issue)
This is amazing except for a few issues, I hope there is some session memory coming.
Environment
-
Platform (select all that apply):
- [x] Other: WSL (Windows Subsystem for Linux)
- [x] Claude CLI
- [x] VS Code Terminal
-
Claude CLI version:
-
Host OS: Windows 11
-
WSL Distro: Ubuntu 22.04
-
Terminal: VS Code integrated terminal (running in WSL)
Note: I’m relatively new to working in WSL, and Claude CLI was functioning without issue when I first started using it. The hanging behavior began recently. I haven’t significantly changed my setup, so I’m unsure if this is a regression, a WSL-related compatibility issue, or something environmental.
Bug Description
Claude CLI intermittently hangs during usage in WSL. It starts fine and responds to input, but at a random point in the session, it will stop responding entirely. The process remains running, but no output is returned, and no error message is shown. This issue is disruptive and makes it difficult to maintain consistent workflows.
Steps to Reproduce
- Start a Claude CLI session inside WSL (Ubuntu 22.04) via the VS Code terminal.
- Begin a normal interaction — requesting code, asking questions, etc.
- After a few prompts, Claude suddenly stops responding.
- Run pkill on the Claude CLI process — this temporarily fixes the issue.
- Start a new session — the issue will usually return after some time.
- Occasionally, multiple Claude processes are found running simultaneously in the background.
Expected Behavior
Claude CLI should maintain consistent responsiveness throughout the session. If the session ends, times out, or encounters an error, it should return a message or log rather than silently hanging.
Actual Behavior
- Claude responds normally for the first few prompts.
- Then it suddenly stops responding, without logging any error or ending the session.
- Running pkill on Claude CLI temporarily resolves the issue.
- Multiple Claude CLI sessions are sometimes left running in the background.
- The issue occurs intermittently and unpredictably, even after restarting WSL, rebooting, or reinstalling the CLI.
Additional Context
- I’ve tried rebooting WSL, restarting VS Code, reinstalling the Claude CLI, switching networks, and limiting session complexity — none have resolved the issue.
- I didn’t have this problem early on; it appeared only after some time using WSL.
- A clearer error message, timeout warning, or a self-healing session process would be extremely helpful.
- I’m happy to provide logs, CLI output, or run test scenarios to help diagnose.
@vanman2024 We released a new version yesterday that might have fixed this. Could you please let me know if you're still seeing it after an update?
Hello Andrew,
I will take keep an eye on it. It was very frustrating to say the least. I love this tool so much best on the market by far I think and if this is only the beginning of it damn can't wait to see what comes in the future.
Is there a roadmap I could look at? One of the biggest challenges I am facing right now when the session ends is keeping the context and persistence or what last happened.
Any suggestions on how I could extend the functionality?
Thanks
From: Andrew Badr @.> Sent: Wednesday, March 26, 2025 9:49 AM To: anthropics/claude-code @.> Cc: vanman2024 @.>; Mention @.> Subject: Re: [anthropics/claude-code] Claude CLI Hangs or Becomes Unresponsive in WSL (Intermittent Issue) (Issue #619)
@vanman2024https://github.com/vanman2024 We released a new version yesterday that might have fixed this. Could you please let me know if you're still seeing it after an update?
— Reply to this email directly, view it on GitHubhttps://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BLWU4R6EBDJD75VNSRL636L2WLLBDAVCNFSM6AAAAABZZS2X3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJVGA4DCMJTHE. You are receiving this because you were mentioned.Message ID: @.***>
[reverie]reverie left a comment (anthropics/claude-code#619)https://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139
@vanman2024https://github.com/vanman2024 We released a new version yesterday that might have fixed this. Could you please let me know if you're still seeing it after an update?
— Reply to this email directly, view it on GitHubhttps://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BLWU4R6EBDJD75VNSRL636L2WLLBDAVCNFSM6AAAAABZZS2X3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJVGA4DCMJTHE. You are receiving this because you were mentioned.Message ID: @.***>
Hi Andrew, unfortunately, it continues to cut out during the session. Essentially, Claude just freezes and doesn't resume. I attempted everything to extend the sessions with WSL, but it actually worsens the situation when I do that.
Additionally, I don't have access to the Claude memory files when using the slash command either.
From: Andrew Badr @.> Sent: Wednesday, March 26, 2025 9:49 AM To: anthropics/claude-code @.> Cc: vanman2024 @.>; Mention @.> Subject: Re: [anthropics/claude-code] Claude CLI Hangs or Becomes Unresponsive in WSL (Intermittent Issue) (Issue #619)
@vanman2024https://github.com/vanman2024 We released a new version yesterday that might have fixed this. Could you please let me know if you're still seeing it after an update?
— Reply to this email directly, view it on GitHubhttps://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BLWU4R6EBDJD75VNSRL636L2WLLBDAVCNFSM6AAAAABZZS2X3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJVGA4DCMJTHE. You are receiving this because you were mentioned.Message ID: @.***>
[reverie]reverie left a comment (anthropics/claude-code#619)https://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139
@vanman2024https://github.com/vanman2024 We released a new version yesterday that might have fixed this. Could you please let me know if you're still seeing it after an update?
— Reply to this email directly, view it on GitHubhttps://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BLWU4R6EBDJD75VNSRL636L2WLLBDAVCNFSM6AAAAABZZS2X3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJVGA4DCMJTHE. You are receiving this because you were mentioned.Message ID: @.***>
I am not sure what to do . I want to continue using the tool, but I can't in this state as I keep losing context after every restart.
From: Ryan Angel @.> Sent: Wednesday, March 26, 2025 4:40 PM To: anthropics/claude-code @.> Subject: Re: [anthropics/claude-code] Claude CLI Hangs or Becomes Unresponsive in WSL (Intermittent Issue) (Issue #619)
Hi Andrew, unfortunately, it continues to cut out during the session. Essentially, Claude just freezes and doesn't resume. I attempted everything to extend the sessions with WSL, but it actually worsens the situation when I do that.
Additionally, I don't have access to the Claude memory files when using the slash command either.
From: Andrew Badr @.> Sent: Wednesday, March 26, 2025 9:49 AM To: anthropics/claude-code @.> Cc: vanman2024 @.>; Mention @.> Subject: Re: [anthropics/claude-code] Claude CLI Hangs or Becomes Unresponsive in WSL (Intermittent Issue) (Issue #619)
@vanman2024https://github.com/vanman2024 We released a new version yesterday that might have fixed this. Could you please let me know if you're still seeing it after an update?
— Reply to this email directly, view it on GitHubhttps://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BLWU4R6EBDJD75VNSRL636L2WLLBDAVCNFSM6AAAAABZZS2X3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJVGA4DCMJTHE. You are receiving this because you were mentioned.Message ID: @.***>
[reverie]reverie left a comment (anthropics/claude-code#619)https://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139
@vanman2024https://github.com/vanman2024 We released a new version yesterday that might have fixed this. Could you please let me know if you're still seeing it after an update?
— Reply to this email directly, view it on GitHubhttps://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BLWU4R6EBDJD75VNSRL636L2WLLBDAVCNFSM6AAAAABZZS2X3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJVGA4DCMJTHE. You are receiving this because you were mentioned.Message ID: @.***>
Seems to have improved still hangs a bit but does not freeze completely.
When will a full windows version be out?
From: Ryan Angel @.> Sent: Wednesday, March 26, 2025 4:43:18 PM To: anthropics/claude-code @.> Subject: Re: [anthropics/claude-code] Claude CLI Hangs or Becomes Unresponsive in WSL (Intermittent Issue) (Issue #619)
I am not sure what to do . I want to continue using the tool, but I can't in this state as I keep losing context after every restart.
From: Ryan Angel @.> Sent: Wednesday, March 26, 2025 4:40 PM To: anthropics/claude-code @.> Subject: Re: [anthropics/claude-code] Claude CLI Hangs or Becomes Unresponsive in WSL (Intermittent Issue) (Issue #619)
Hi Andrew, unfortunately, it continues to cut out during the session. Essentially, Claude just freezes and doesn't resume. I attempted everything to extend the sessions with WSL, but it actually worsens the situation when I do that.
Additionally, I don't have access to the Claude memory files when using the slash command either.
From: Andrew Badr @.> Sent: Wednesday, March 26, 2025 9:49 AM To: anthropics/claude-code @.> Cc: vanman2024 @.>; Mention @.> Subject: Re: [anthropics/claude-code] Claude CLI Hangs or Becomes Unresponsive in WSL (Intermittent Issue) (Issue #619)
@vanman2024https://github.com/vanman2024 We released a new version yesterday that might have fixed this. Could you please let me know if you're still seeing it after an update?
— Reply to this email directly, view it on GitHubhttps://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BLWU4R6EBDJD75VNSRL636L2WLLBDAVCNFSM6AAAAABZZS2X3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJVGA4DCMJTHE. You are receiving this because you were mentioned.Message ID: @.***>
[reverie]reverie left a comment (anthropics/claude-code#619)https://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139
@vanman2024https://github.com/vanman2024 We released a new version yesterday that might have fixed this. Could you please let me know if you're still seeing it after an update?
— Reply to this email directly, view it on GitHubhttps://github.com/anthropics/claude-code/issues/619#issuecomment-2755081139, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BLWU4R6EBDJD75VNSRL636L2WLLBDAVCNFSM6AAAAABZZS2X3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJVGA4DCMJTHE. You are receiving this because you were mentioned.Message ID: @.***>
I also use WSL with Claude Code. After longer interactions, it becomes unresponsive. I started Googling for the issue, and here I am.
Just as an FYI, after running wsl --terminate Ubuntu about 50 times, I shutdown Docker Desktop (which was also using my Ubuntu instance). I haven't had a hang since...
UPDATE: Stopping and restarting Docker Desktop allows Claude to get "unhung" for a while
UPDATE 2: I believe that this might be tied to Docker entering "Resource Saver" mode. I've disabled it, and am hoping that ultimately solves the problem...
I was testing this today, and it happen on 3 different machines. Two windows 11 and One windows 10. @sdukehart-omnesoft thanks for this as I just went in and hit the play bottom in the bottom left of docker desktop, as it was in saver mode. As soon as I did this, the wsl interface immediately responded.
So it seems that needs to be disabled in docker desktop - in case someone see this from searching for this issue.
Hey, yes I can confirm this. Disable the Save resources switch in docker desktop and a restart completly fixes the extrem annoying hangs of the claude code cli under WSL 2.
Same Issue in Windows App. Tool becomes unresponsive & shows Loading icon always Also tried clearing Cache and Restart, But No Result.
I've run across this problem as well. Windows 10 with WSL2. I don't have Docker Desktop installed so believe there may be something else going on.
I hit this every day while typing...it just hangs for 20-30 seconds @reverie
I am using it in my windows machine and when I run the claude code in the vs code terminal, the input area hangs for like 2-3 mins and then it becomes useable. Its so frustrating each time I run claude code it just hangs like crazy.
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.
Workaround that works for me:
The only reliable solution I've found is to disable Windows PATH injection in WSL2 by setting appendWindowsPath = false in .wslconfig:
# %USERPROFILE%\.wslconfig
[interop]
appendWindowsPath = false
Then restart WSL:
wsl --shutdown
I know the official troubleshooting docs recommend against this because it "breaks the ability to easily call Windows executables from WSL", but in my experience this is the only way to get Claude Code working consistently without hangs.
The trade-off is you can no longer call Windows executables directly from WSL (like explorer.exe, etc.), but Claude Code becomes stable.
Workaround that works for me:
The only reliable solution I've found is to disable Windows PATH injection in WSL2 by setting
appendWindowsPath = falsein.wslconfig:%USERPROFILE%.wslconfig
[interop] appendWindowsPath = false Then restart WSL:
wsl --shutdown I know the official troubleshooting docs recommend against this because it "breaks the ability to easily call Windows executables from WSL", but in my experience this is the only way to get Claude Code working consistently without hangs.
The trade-off is you can no longer call Windows executables directly from WSL (like
explorer.exe, etc.), but Claude Code becomes stable.
Thanks for this adding the command didn't work for me due to the WSL / VScode integration. So just updated my Ubuntu path to not include the windows paths which seemed to have worked so far.
TLDR
Fix : Add this to .bashrc
# Claude Code WSL2 fix
export PATH=$(echo "$PATH" | tr ':' '\n' | grep -v 'WindowsPowerShell' | tr '\n' ':' | sed 's/:$//')
With powershell in PATH
https://github.com/user-attachments/assets/7382c7ba-8f24-45e1-b3e2-38dc60ab1ea0
Without powershell in PATH
https://github.com/user-attachments/assets/d503bcca-fcac-467b-baac-1485f693ea94
Rambling
Okay so I went down the rabbit hole because this bug has been driving me nuts for months.
this from @garacio did not work for me
# %USERPROFILE%\.wslconfig
[interop]
appendWindowsPath = false
but this workaround by @dwbcodes
So just updated my Ubuntu path to not include the windows paths which seemed to have worked so far.
put me on the right track.
First I did like him and filtered all windows /mnt/c paths post shell using
export PATH=$(echo "$PATH" | tr ':' '\n' | grep -v '/mnt/c/' | tr '\n' ':' | sed 's/:$//')
and it fixed it, but this expectedly broke invoking windows binaries natively, so I went on a wild goose chase of writing custom interlop like
# local var was required in my case or path args would not pass properly otherwise
explorer() {
local target=$(wslpath -aw "${1:-.}")
(cd /mnt/c && $CMD /c start "" "$target") 2>/dev/null
}
alias x='explorer'
cursor() {
local target=$(wslpath -aw "${1:-.}")
(cd /mnt/c && $CMD /c "$WINLOCALAPPDATA\Programs\cursor\resources\app\bin\cursor.cmd" "$target") 2>/dev/null &
}
code() {
local target=$(wslpath -aw "${1:-.}")
(cd /mnt/c && $CMD /c "$WINLOCALAPPDATA\Programs\Microsoft VS Code Insiders\bin\code-insiders.cmd" "$target") 2>/dev/null &
}
agy() {
local target=$(wslpath -aw "${1:-.}")
(cd /mnt/c && $CMD /c "$WINLOCALAPPDATA\Programs\Antigravity\bin\antigravity.cmd" "$target") 2>/dev/null &
}
which works, but then I thought why not use a good old bisect to find the culprit, and isolated it to this path
/mnt/c/Windows/System32/WindowsPowerShell/v1.0
excluding this single path from my arch (btw) $PATH makes claude code responsive.
To be honest, it is not a fix, it is a dirty hack, but, this is what we have! Thank you, @zdaar, for more clear workaround