Claude Code v2.1.306: MCP-heavy session errors, cloud headless logins#

Published by

Part of the Claude Code Version Tracker series. | Official Env Vars | Official Changelog

Claude Code v2.1.306 is a small release over v2.1.305 that corrects two misleading errors. Sessions with many MCP tools no longer show a real API failure as "prompt is too long" or run an unneeded compaction, and claude -p inside a cloud session no longer reports "Not logged in" when it starts without the session's environment variables.[1]

A provider error in MCP-heavy sessions no longer reads as "prompt is too long"#

The changelog scopes this fix to sessions with many MCP tools.[1] This build adds a check to the tool-search retry path: a 400 or 422 response whose message names deferred tools now resends the request without them, logged as [ToolSearch] HTTP <status>; sending the request again without deferred tools. Before the change, that same response surfaced as "prompt is too long" and pulled an unneeded compaction behind it.[1] The retry condition is narrow: it excludes billing errors and the model's refusal-fallback path, so only a provider or gateway rejection of the deferred-tools request triggers the resend.

Cloud claude -p no longer reports "Not logged in"#

claude -p inside a cloud session now receives the session's environment variables, so it no longer reports "Not logged in".[1] This build removes an all-or-nothing parse that discarded the entire session environment when any one line was not a plain VAR=value assignment, which had left print mode without the variables it needed to stay logged in.

Unannounced marketplace parse and cache-removal messages#

This release also carries two plugin-marketplace messages that the changelog does not name:

MessageWhat it reports
Failed to parse marketplace file at ...Shown at both the fetch and the read paths when a plugin marketplace manifest cannot be parsed; the catalog is reported as having an invalid manifest.
Left the cache files of removed marketplace ... in placeA warning logged when a marketplace is removed but its on-disk cache files could not be deleted; the removal itself still completes.

Each error now names its real cause#

The common thread is diagnosis. A provider rejecting a deferred-tools request used to surface as a token-limit message and drag a compaction along with it, and a cloud claude -p that lost its environment read as a login problem, so both pointed you at the wrong fix. v2.1.306 makes the retry path and the environment parse report what actually happened: an MCP-heavy session that hits a rejected request retries instead of trimming context, and a headless cloud run that cannot see its environment is a loading failure rather than a credentials one. The marketplace messages extend the same move to plugin catalogs, where a parse failure is now named rather than swallowed.

Sources#

  1. Claude Code Official Changelog, v2.1.306 release notes

This analysis is conducted for educational and research purposes under fair use principles. All trademarks and software referenced belong to their respective owners.


Previous Claude Code analysis: v2.1.305 (October 20, 2026)

All 77 Claude Code analyses: Claude Code Version Tracker · Official Claude Code changelog