Claude Code: Fixes for Hangs, Stalls and Runaway Memory
Claude Code 2.1.333 fixed a long list of hangs and memory problems. A slow git status, an unanswered token count, an HTTP MCP server that closed its stream, and busy file watching on Linux could each stall a session for minutes or grow memory by gigabytes. The fixes replace those waits with short time limits and stop the runaway growth.
Key Takeaways
- A very slow git status no longer blocks the first prompt, subagents or
claude -pfor 10 minutes, since Claude continues after 30 seconds. - Missing token count answers no longer freeze file reads, @ mentions and /context.
- HTTP MCP servers that close a stream without an answer no longer hold a tool call for up to 5 minutes.
- Linux builds that create and delete many files no longer cause gigabytes of memory growth and 100% CPU.
- claude -p now waits up to 30 seconds for a lagging reader and warns about unread output.
- Silent plugin language servers now give up after 60 seconds by default.
Waits That Used to Last 10 Minutes
Several fixes in Claude Code 2.1.333 cap waits that could freeze a session:
- The first prompt, subagents and
claude -pno longer wait up to 10 minutes whengit statusis very slow or stalls. Claude now continues after 30 seconds. - Reading a larger file, large MCP results,
@mentions and/contextno longer hang for 10 minutes or more when the token count request gets no answer. - Tool calls to HTTP MCP servers that offer no GET stream no longer hang for up to 5 minutes after the server or a proxy closes the response stream without an answer.
- A plugin's language server that exits or stays silent while starting no longer hangs a turn. An exit now fails the call at once, and a silent server's call gives up after 60 seconds by default.
!commands in cloud and headless sessions no longer hang for ten minutes when the command reads standard input.
Memory and CPU on Linux
Claude Code fixed memory growing by gigabytes and CPU staying at 100% on Linux while a build or other command creates and removes many files in the repository. A related fix stops the terminal freezing when a command removes, moves or creates many folders in a large git repository, and removes a doubled pause after sandboxed commands there.
Memory Growth Elsewhere
Claude Code also stopped unbounded memory growth when a hook in claude -p, an MCP server or a language server keeps printing large output or notifications. Other fixes cover long sessions with OpenTelemetry content logging on, language server diagnostics republished while idle, and reading several very large images at once.
Piped Output
On macOS and Linux, claude -p no longer loses the end of a successful run's piped output when the reader lags. It waits up to 30 seconds and warns if any output is unread.