Follow Discord
Sweep 10 Nov 2026 · 02:18Z Build v2.1.322 539 read Stable v2.1.311 Latest v2.1.322 Next v2.1.322 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.321 ·

New setting tunes memory cleanup for claude mcp serve

CLAUDE_CODE_MCP_SERVE_GARBAGE_COLLECTIONS controls when mcp serve frees unused memory, and slow cleanups switch it off

Use it now Notable New Features
JSON All of v2.1.321
Use it nowTier: how much it should matter to you
5Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
MCPArea: what it touches
New FeaturesKind: in v2.1.321,
What probably matters to youSection of the release

Unclear It is unclear whether the default cleanup schedule applies when the variable is not set.

What

mcp serve runs Claude Code as an MCP server, so other programs can use its tools. A new environment variable, CLAUDE_CODE_MCP_SERVE_GARBAGE_COLLECTIONS, controls garbage collection there, which is the step that frees memory the program no longer uses. It takes comma-separated parts:

  • first: listen, rest, skip or never, for the first collection
  • later: young or full, for collections after that
  • rest_delay_ms: a delay in milliseconds
  • min_growth_mib: a minimum memory growth in MiB
  • between_growth_mib: memory growth in MiB between collections

The defaults are first listen, later full, 1500 ms, 16 MiB and 8 MiB, and they apply only when a built-in check that is on by default passes. If a collection blocks for more than 250 ms, Claude Code stops running further ones. This needs Bun's JavaScriptCore support.

Why

People running mcp serve for long stretches get a way to manage its memory use, with a safety stop if cleanup starts slowing the server down.

Read from
Names in the bundleclaude mcp serve
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtIt is unclear whether the default cleanup schedule applies when the variable is not set.

See this entry in the whole of v2.1.321 →

Feedback