claude-code - 💡(How to fix) Fix [Bug] REPL silently exits to PowerShell prompt mid-turn on dense subprocess chains [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56358Fetched 2026-05-06 06:30:16
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×5

Error Message

Symptom: REPL process disappears silently. Parent PowerShell tab survives, dropping to bare PS C:...> prompt. No error, no traceback, no recovery banner. Recovery via claude --continue works but loses the in-progress turn, requiring a manual "continue" prompt to resume the agent.

Fix Action

Fix / Workaround

Bug Description Summary: REPL silently exits to bare PowerShell prompt mid-turn on 2.1.128, continuation of regression #55424 / #55562 past v2.1.126. Environment:

Claude Code 2.1.128 (native, win32-x64, commit d6caed183d5f) Install path: C:\Users<user>.local\bin\claude.exe Windows 11 Host shell: PowerShell 7.6.1 CLAUDE_CODE_USE_POWERSHELL_TOOL=1 set and confirmed

Symptom: REPL process disappears silently. Parent PowerShell tab survives, dropping to bare PS C:...> prompt. No error, no traceback, no recovery banner. Recovery via claude --continue works but loses the in-progress turn, requiring a manual "continue" prompt to resume the agent. Trigger pattern: Dense subprocess chains in a single turn, specifically Edit/Update operations interleaved with PowerShell tool calls. Crash typically lands mid-Update during model "Transmuting" phase. Frequency: Variable. Ran stable ~1 hour, then crashed mid-Update. Was crashing on nearly every turn before setting CLAUDE_CODE_USE_POWERSHELL_TOOL=1, so that env var partially mitigates but does not fix. References:

#55424 (original report, v2.1.121, expected to be addressed by v2.1.126 PowerShell host rework) #55562 (confirms regression persists 2.1.114 through 2.1.126) This report extends the band: still reproducing on 2.1.128 with PowerShell tool primary.

Workarounds attempted:

Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 → reduced frequency, did not eliminate Channel: on latest (2.1.128); stable (2.1.119) is inside the regression band so not a downgrade option

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description Summary: REPL silently exits to bare PowerShell prompt mid-turn on 2.1.128, continuation of regression #55424 / #55562 past v2.1.126. Environment:

Claude Code 2.1.128 (native, win32-x64, commit d6caed183d5f) Install path: C:\Users<user>.local\bin\claude.exe Windows 11 Host shell: PowerShell 7.6.1 CLAUDE_CODE_USE_POWERSHELL_TOOL=1 set and confirmed

Symptom: REPL process disappears silently. Parent PowerShell tab survives, dropping to bare PS C:...> prompt. No error, no traceback, no recovery banner. Recovery via claude --continue works but loses the in-progress turn, requiring a manual "continue" prompt to resume the agent. Trigger pattern: Dense subprocess chains in a single turn, specifically Edit/Update operations interleaved with PowerShell tool calls. Crash typically lands mid-Update during model "Transmuting" phase. Frequency: Variable. Ran stable ~1 hour, then crashed mid-Update. Was crashing on nearly every turn before setting CLAUDE_CODE_USE_POWERSHELL_TOOL=1, so that env var partially mitigates but does not fix. References:

#55424 (original report, v2.1.121, expected to be addressed by v2.1.126 PowerShell host rework) #55562 (confirms regression persists 2.1.114 through 2.1.126) This report extends the band: still reproducing on 2.1.128 with PowerShell tool primary.

Workarounds attempted:

Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 → reduced frequency, did not eliminate Channel: on latest (2.1.128); stable (2.1.119) is inside the regression band so not a downgrade option

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.128
  • Feedback ID: d4d3a660-32ad-4618-9bdc-2eb48cca17c3

Errors

[]

extent analysis

TL;DR

The issue can be mitigated by setting the CLAUDE_CODE_USE_POWERSHELL_TOOL=1 environment variable, which has been shown to reduce the frequency of the REPL silently exiting.

Guidance

  • The crash typically occurs during dense subprocess chains in a single turn, specifically Edit/Update operations interleaved with PowerShell tool calls, suggesting that the issue may be related to the interaction between Claude and PowerShell.
  • Setting CLAUDE_CODE_USE_POWERSHELL_TOOL=1 has been shown to reduce the frequency of the issue, but not eliminate it, indicating that this may be a partial workaround.
  • The issue has been reported to persist across multiple versions, including 2.1.114 through 2.1.128, suggesting that a more fundamental fix may be required.
  • Recovery via claude --continue works but loses the in-progress turn, requiring a manual "continue" prompt to resume the agent, which may be a useful temporary workaround.

Notes

The issue appears to be related to the interaction between Claude and PowerShell, and the CLAUDE_CODE_USE_POWERSHELL_TOOL=1 environment variable may be a useful mitigation strategy. However, a more fundamental fix may be required to fully resolve the issue.

Recommendation

Apply workaround: setting CLAUDE_CODE_USE_POWERSHELL_TOOL=1 has been shown to reduce the frequency of the issue, and may be a useful temporary solution until a more fundamental fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING