Claude Code v2.1.306: Cloud Session Login and Large MCP Session Fixes
Claude Code v2.1.306 is a two-entry fix release: `claude -p` no longer reports "Not logged in" inside a cloud session started without its environment variables, and sessions with many MCP tools no longer mask an API error as "prompt is too long" or compact when they do not need to.
Claude Code v2.1.306 has two changelog entries, both fixes. One restores non-interactive runs inside cloud sessions; the other stops a misleading error and a wasted compaction in sessions carrying a large MCP tool surface.
What’s New
claude -p inside a cloud session no longer reports “Not logged in.” Inside a cloud session started without the session’s environment variables, claude -p reported “Not logged in” and the run failed. If you drive cloud sessions from a script or a scheduled job, this is the fix that matters: that condition no longer produces the error. The changelog does not describe the cause, and neither does this note.
An API error in a session with many MCP tools is no longer replaced by “prompt is too long.” When a session carried a large number of MCP tools, an underlying API error could surface as a context-length message instead of the real failure, and the session could compact in response to a problem that compaction would not solve. Both halves are fixed, so the reported error is now the actual one and the session keeps the context it did not need to give up.
Neither fix changes the command surface. Commands, flags, interactive commands, settings, and environment variables are unchanged from v2.1.305, which this site’s CLI reference reflects.
How to Update
- Check your installed version:
claude --version - Update in place:
claude update