[BUG] Regression after v2.1.112: silent CLI exits on Windows, not fully fixed by NODE_OPTIONS
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?
Claude Code CLI exits silently back to the shell during active sessions on Windows. No error message, no stack trace, no stderr output — the session just disappears. This happens randomly: during idle time, during tool calls, during long responses, and in longer sessions with heavy plugin/MCP use.
Multiple teammates are affected across different Windows machines. Version 2.1.112 is stable for everyone; every version we've tried after 2.1.112 reproduces this silent-exit behavior for a subset of users.
What Should Happen?
Claude Code CLI should remain running through the session without silent termination. If a fatal error occurs, it should surface an error message, stack trace, or non-zero exit code the user can act on — not drop silently back to the shell.
Error Messages/Logs
No error output produced. Session terminates silently — nothing written to stderr, no crash log in ~/.claude/projects/, no JavaScript error trace. Windows Event Viewer occasionally shows Node.js OOM events for some users, but not for all affected users.
Steps to Reproduce
- Install Claude Code on Windows 11 (any version after 2.1.112)
- Enable multiple plugins: skill-creator, claude-code-setup, figma, playwright, atlassian, superpowers, codex
- Start a session and use it actively with tool calls, skill invocations, and MCP server interactions
- Expected: session stays alive
- Actual: after a variable period (minutes to longer), the CLI silently exits back to the shell prompt — no error, no warning
Exact trigger is non-deterministic. Reproduces for multiple users on different machines with similar plugin loadouts. Downgrading to v2.1.112 fully eliminates the issue.
Claude Model
Multiple
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.112
Claude Code Version
2.1.114 and 2.1.116
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Partial workaround (works for some users only):
Adding NODE_OPTIONS=--max-old-space-size=8192 to ~/.claude/settings.json env block resolves crashes for some affected users. This suggests Node heap OOM is one contributing factor. However, it does NOT resolve the issue for all affected users, indicating a second regression beyond memory pressure.
Team mitigation:
Pinned to v2.1.112 and set DISABLE_AUTOUPDATER=1. Fully resolves the issue across all affected machines.
Affected models: Opus, Sonnet (both reproduce).
Plugins enabled on affected machines: skill-creator, claude-code-setup, figma, playwright, atlassian, superpowers, codex.
Related issues (similar ground, but don't fully explain this regression):
- #5388 — JS heap OOM during MCP operations
- #25926 — unbounded message accumulation
- #18011 — V8 OOM on extended sessions
- #48942 — skills sync memory leak
- #34526 — silent exit on Windows background process
Ask:
- Confirm whether a known regression was introduced after v2.1.112
- Guidance on collecting actionable diagnostics from affected machines (no crash log is generated — Node exits silently)
9 Comments
Update: recommended workaround stack does NOT resolve the bug on latest versions.
Second affected teammate on v2.1.114+ already had all three mitigations applied in
~/.claude/settings.json:Still hit the regression mid-session. Failure mode this time was TUI renderer corruption — raw ANSI escape sequences dumped as literal text, forcing Ctrl+C to recover back to PowerShell (screenshot attached).
This confirms the hypothesis from the original report: at least two separate regressions after v2.1.112:
Only mitigation that works across all affected teammates: pin to v2.1.112 and disable the auto-updater:
Environment for this occurrence:
Happy to provide additional diagnostic output if you can suggest what would help — Node still exits without writing any crash log.
<img width="1904" height="561" alt="Image" src="https://github.com/user-attachments/assets/6ad62f29-88c2-497c-b030-5337ba7b57c6" />
@bcherny @ThariqS @chrislloyd
Same bug, fresh receipts from the v2.1.121 → v2.1.126 era. v2.1.124 is currently the most stable target.
Filed #55424 yesterday for what is almost certainly the same bug — github-actions duplicate detector linked the two. Posting my findings here too because this issue has the
regressionlabel and dates back further (since v2.1.112), so it's the better surface for triage.Versions tested under sustained load
Workload pattern: long-running Sonnet sub-agents (10-30+ minute runtime) dispatched via Task tool, doing dense Bash subprocess chains (50+ tool uses common). Crash counts under that workload:
If you're hitting this bug today, stay on v2.1.124. v2.1.126 is significantly worse.
Diagnostic fingerprint — universal "cleanup-skipped" signature
Every silent exit observed in my testing leaves the parent PowerShell stuck in SGR mouse-tracking mode (mode 1006). Visible artifact at the bare prompt is a stream of
[<row>;<col>;<button>Mescape sequences — every mouse movement over the now-CC-less terminal dumps raw escape codes to stdin instead of being handled.Mechanism: CC sends
CSI ?1006hon session start to enable mouse reporting, but dies before sendingCSI ?1006lto disable it. Cleanup handler is not running.This artifact is not specific to any single failure mode. Every error visible on screen across two days of testing — including the silent-model-tier-downgrade bug at #54426 and other failures not separately filed — left the same artifact. That means the cleanup path is being skipped across multiple abrupt-termination causes, not just whichever specific termination this issue is about.
Implication for the maintainer: even before the root cause of the silent exit is found, wiring TTY-state cleanup to a robust atexit/signal handler (so it runs on panics, SIGKILLs, host process kills — not just on graceful exits) would eliminate the user-visible artifact across the entire bug class. Cheap defensive fix, broad benefit.
Workload correlation
Things that strongly correlate with crashes (across 8+ instances I observed in 24 hours):
cd <path> && python <script>.py 2>&1 | grep ...style with bash&&chaining)The OP's observation that this happens during idle, tool calls, AND long responses lines up. The common factor isn't the activity type — it's the accumulated session weight.
Re: NODE_OPTIONS workaround
I have not tested the NODE_OPTIONS workaround mentioned in the OP. Operator's Windows system runs at default Node memory limits. The pattern of crash + cleanup-skip suggests something more than memory pressure — process termination without atexit-handler execution is consistent with SIGKILL (e.g., OOM-killer or external) or unhandled native exceptions, not graceful Node-side OOM.
Filing context
This is the Auto Mode product surface — Anthropic's officially-supported autonomous-execution mode. Operator runs multi-agent workflows for autonomous overnight pipeline operation. Bug surfaces under sustained autonomous load, not under interactive use, which may be why it's been hard to reproduce in development environments.
Correction to my prior comment in this thread: v2.1.124 is NOT stable. Disregard the "stay on v2.1.124" guidance.
A fresh window opened on v2.1.124 just crashed within minutes of session start with the same ANSI mouse-tracking artifact I described. My "7+ hours stable" observation window was simply a quiet stretch — when I extended the test, v2.1.124 crashes too.
Updated honest read:
This issue's framing of "silent CLI exits since v2.1.112" is consistent — the bug is older than the recent release chain and not specific to any one version in the tested range. v2.1.126 may amplify it, but no rollback target in the v2.1.112 → v2.1.126 era gets fully out of the bug under sustained autonomous load.
Also new: this latest crash hit an Opus 4.7 (1M context) max-effort session, which is the first Opus instance I've observed crash. So Opus is also vulnerable, not just Sonnet sub-agents.
The defensive TTY-cleanup-on-all-exit-paths recommendation in my prior comment still stands — it's the broadest-benefit fix even before the silent-exit root cause is found.
One more useful triage data point: bug exists across runtimes (Bun AND Node).
Operator who's been hitting this on Node v2.1.121-126 was previously on Bun and experienced silent CLI exits with the same shape — that's what caused the switch to Node in the first place. Same Windows host, same workload class, different runtime. Bug followed her across the runtime swap.
Implication for triage: the bug is almost certainly NOT in the JS runtime layer. Rules out Node-specific theories (heap GC, V8 internals, NODE_OPTIONS-tunable memory limits) — Bun has different GC, different memory model, different event-loop, and still produced the same silent exit. Failure surface is in shared code: the native binary (
claude-code-win32-x64/claude.exe), TTY-state handling, child-process management, Windows console-host interaction, or signal-handler wiring — all of which are runtime-agnostic.The OP's note that NODE_OPTIONS workaround "didn't fully fix" lines up with this — if the bug isn't in Node's heap path, no Node-side option is going to fully resolve it.
Cross-runtime stability would be a useful regression-test target if it isn't already in the test matrix.
Great analysis @ThatDragonOverThere !
I hope the team looks into this soon. Thanks! @chrislloyd @ThariqS @bcherny
Thanks for reporting. can i ask for a crash dump?
First enable Windows Error Reporting LocalDumps:
Then attach the .dmp from
%LOCALAPPDATA%\CrashDumps.Closing for now — we still need a bit more information to move forward. 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.