Claude Code Warns When Memory Usage Turns Critical
Claude Code 2.1.274 added a visible warning when memory usage turns critical, along with steps for freeing memory or restarting safely. Long-running sessions, especially ones juggling multiple subagents or large contexts, can push a machine's memory close to its limit, sometimes leading to a crash or a frozen terminal with no warning. The same release also stopped background commands being killed under merely mild memory pressure.
Key Takeaways
- Claude Code now warns visibly when memory usage turns critical, instead of letting a session silently degrade or crash.
- The warning comes with concrete recovery steps, including freeing memory or restarting the session safely.
- The same 2.1.274 release stopped background commands being killed under mild memory pressure; they are now stopped only when memory is critically low, and the debug log says why.
- It targets long-running sessions with multiple subagents or large contexts, which are the most likely to approach a machine's memory limit.
- Memory pressure is a recurring theme in Claude Code's release history, with leak fixes shipping repeatedly through 2026, including an agent-view image-retention leak fixed in 2.1.208 in July 2026.
- It is a proactive UX addition rather than a bug fix, giving users warning before a crash rather than only fixing crashes after the fact.
Claude Code Now Warns Before Memory Runs Out
Claude Code 2.1.274 added a visible warning when memory usage turns critical, along with steps for freeing memory or restarting safely.
Why this matters
Long-running sessions, especially ones juggling multiple subagents or large contexts, can push a machine's memory close to its limit, sometimes leading to a crash or a frozen terminal with no warning. Memory pressure has been a recurring theme in Claude Code's release history, with memory-leak fixes shipping repeatedly through 2026 — including an agent-view leak where pasted images were retained for the screen's lifetime, fixed in 2.1.208 in July 2026.
What changed
Rather than letting a session silently degrade or crash when memory runs critically low, Claude Code now surfaces a clear, visible warning at the point memory usage becomes critical, along with concrete steps a user can take, such as freeing memory or restarting the session safely, before things fail outright.
The same release also refined how memory pressure affects background work: background commands were previously stopped after 30 idle minutes on machines under merely mild memory pressure, and are now stopped only when memory is critically low, with the debug log recording why.