Claude Code v2.1.311: ultrathink at xhigh, 1M Context Fix
Claude Code v2.1.311 makes ultrathink run at xhigh effort in the terminal, fixes the 'Usage credits required for 1M context' stop, and changes JSON escaping.
Claude Code v2.1.311 has 92 changelog entries: 56 fixes, 16 improvements, 15 changes, and 5 additions. Several of the changes touch settings and scripts: ultrathink now runs its turn at xhigh effort in the interactive terminal, model names drop the [1m] suffix where it has no effect, JSON output escapes more characters, and Claude Code on Bedrock, Mantle, Vertex and Foundry loads model settings from a signed file. Among the fixes, standard-context sessions no longer stop with “Usage credits required for 1M context”, SubagentStop hooks run once when a subagent finishes instead of about twice a minute, and two improvements cut startup time.
v2.1.311 follows v2.1.310, and v2.1.312 shipped a day later.
Changed Behavior Worth Noting
ultrathink Runs Its Turn at xhigh
In the interactive terminal, ultrathink now runs its turn at xhigh effort on Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1 through Anthropic’s API. Typed while Claude is working, it raises the effort for the rest of that turn. The rainbow highlight now appears only where the keyword can raise effort, and not when the word is quoted or part of a file path. For what the effort levels mean, see Ultracode & Effort Levels.
[1m] Dropped Where It Has No Effect
Model names and IDs now drop the [1m] suffix and its label on models where the suffix has no effect. The suffix is still accepted, so a configuration that includes it keeps working, but a script that reads model names or IDs should no longer expect it on those models.
JSON Output Escapes More Characters
With --output-format json or stream-json, Claude Code now writes DEL, C1 control and Unicode format characters inside strings as \uXXXX escapes. Parsed values are unchanged, so code that parses the JSON sees the same strings; only tools that compare or search the raw text can see a difference.
Model Settings from a Signed File on Bedrock, Mantle, Vertex and Foundry
Claude Code on Bedrock, Mantle, Vertex and Foundry now loads model settings from a signed file on downloads.claude.ai. Set CLAUDE_CODE_MODEL_CATALOG=off to turn this off.
DISABLE_COMPACT Can Only Turn Compaction Off
DISABLE_COMPACT in settings files and in a mod’s $.env.set can now only turn compaction off, not back on. Two fixes also concern it: agent teammates no longer compact their history when DISABLE_COMPACT is set, and the rewind menu no longer offers “Summarize from here” and “Summarize up to here” when it is set.
VS Code Follows Its Own Telemetry Setting
While VS Code’s telemetry setting is off, the extension now starts Claude Code sessions with DISABLE_TELEMETRY set, so they send no usage metrics or error reports and fetch no feature flags.
Other Changes
- Startup warnings about permission rules in settings files now show once per user until the rule changes.
- Sessions that set
CLAUDE_CODE_SYNC_SKILLSwith feature-flag fetching off now reuse a claude.ai skills list up to 10 minutes old that another session on the machine fetched. /code-reviewnow tells Claude to put the effort level first and usemaxonly when asked.- Cowork cloud sessions now ignore an
agentnamed by a plugin or your settings. When one was named, those sessions lost their connectors and most tools after a restart. claude purgenow says it deletes data only on this computer, not anything stored by Anthropic.- In agent view, Ctrl+D now matches the prompt: on an empty input, pressing it twice exits.
- In fullscreen lists, clicks on scrollbar arrows and bars now act when the mouse button is released, so moving off the scrollbar before letting go cancels the click.
- In VS Code, the session list side bar now loads Web sessions when the Web tab is first opened, not at startup.
- Claude Tag admin settings now show a lock instead of # for private Slack channels that your own Slack account can see.
What’s New
- Self-hosted runner:
--hold-idle-fileand--max-hold-min. Two newself-hosted-runneroptions keep an idle session while your host reports processes it left running. - Explanatory output style tip. A tip for the Explanatory output style now appears when you ask Claude for explanations.
- VS Code: syntax coloring and a hook status. Code blocks in Claude’s replies get syntax coloring in light, dark and high contrast dark themes. Slow UserPromptSubmit hooks now show a “Running UserPromptSubmit hooks” spinner status, with a screen reader announcement.
- Claude Tag: a Skills view. Claude Tag analytics gains a Skills view showing how often Claude runs each attached skill in Slack channels and which go unused, with Usage links in admin settings.
Context, Compaction and Usage
- “Usage credits required for 1M context.” Standard-context sessions stopped with this message when a request ran over 200K tokens. Claude Code now compacts the conversation and continues.
- Stale memory files. Right after automatic compaction, Claude saw stale MEMORY.md and CLAUDE.md content when those files had been edited earlier in the session.
- Missing summaries. When the model’s reply has no summary in it, Claude Code now usually asks for the summary once more before it replaces the conversation.
- Prompt cache misses.
/usagenow shows large prompt-cache misses under “What’s contributing to your limits usage?”, and/effortnow warns about a prompt cache miss in plan mode when the plan model differs from the session model. /teleport./teleportandclaude --teleportnow warn when a compacted cloud session loads from its last compaction, so the messages it summarized aren’t in the local copy.- Subscription message. Claude Pro and Max subscribers were told to ask their admin when their subscription couldn’t be used. The message now points to billing settings.
Hooks, Subagents and Agent Teams
SubagentStophooks ran about twice a minute for each running subagent instead of once when it finishes.- MCP tools in subagents. Subagents could not use MCP tools from servers that finished connecting after the subagent started.
- Worktrees. A subagent’s isolated worktree was removed while a background subagent it started was still working in it.
- Auto mode. Background agents in auto mode that wait on their own shells started a new main conversation turn on every wake.
- Agent teams task lists. Sessions showed an empty task list when coming back with
--resume,--continue,/resumeor--session-id, including after/clearor a crash, and/branchwrote to the original session’s list. - Repeated skill runs. A finished
/code-review, or another skill that runs in a subagent, ran a second time when a cloud or background session restarted. - Duplicate messages. ↑ in an agent’s chat tab recalled a message that was still waiting to be delivered, so resending it sent a second copy.
Startup, Speed and Requests
- Startup time. Pro and Max accounts skip two network requests on launches within an hour of the last check, and launches whose only arguments are options and their values, such as
claude --model opus, start faster. - Long CLAUDE.md list items. A very long list item in a CLAUDE.md file caused long freezes at startup and after reading or editing files.
- Large edits. Write and Edit stalled for up to 5 seconds after they ran, and reported 0 lines changed, when changing thousands of lines in a file.
- Interrupts. Interrupting Claude did not take effect until a timeout while an MCP server had not answered a resource read or a skill was still downloading.
- Retries. Claude Code retried requests the API marked not to retry, which could hold a turn for minutes or, in unattended retry mode (
CLAUDE_CODE_RETRY_WATCHDOG), indefinitely. - Long thinking. Long hidden thinking was cut off as idle on Google Vertex AI, Microsoft Foundry and Claude Platform on AWS, where the endpoint sends thinking progress updates.
- Clearer errors. The “Connection dropped” API error now says where to look first: the proxy or gateway in use, else VPN or firewall. This applies to the Anthropic API only; Bedrock, Vertex and Foundry are unchanged. A refused pasted sign-in code now says the code may have expired or been used, and to sign in again.
MCP, Plugins and the Linux Sandbox
claude mcp add,claude mcp removeand/mcpnamed the current folder instead of the project entry in~/.claude.jsonthat holds a local-scope server when run below a repository root.claude mcp listandclaude mcp getshowed the error code twice on failed-connection lines, for exampleENOENT: ENOENT: …./mcpshowed a remote server as failed after “Clear authentication” when the server works without sign-in, and showed “authenticated” for a remote server that Claude Code sends no credentials to.- A
--plugin-dirfolder of plugins loaded as one plugin when an empty.mcp.jsonwas at its top. - On Linux, sandboxed Bash commands failed with
bwrap: Can't create filewhen a--plugin-dirfolder was also an added directory andpermissions.blockReadsOutsideWorkingDirectorieswas on.
Tools, Files and Transcripts
- Shell commands that reach their timeout now show the output so far and say the command is still running in the background.
- The Bash tool description claimed the working directory always persists between calls, and the environment block named a shell commands don’t run in, such as fish when the Bash tool uses zsh.
- The @ file picker ignored
.ignore/.rgignorenegation rules that re-include git-ignored files. - The Write tool’s file preview skipped rows and miscounted hidden lines when a line was wider than the terminal.
- Pasting text that mentions an image file, such as
! open /tmp/shot.pngor/review look at /tmp/shot.png, attached the image and dropped its path from the prompt. - A lone backslash in quotes or brackets, like
"\"or(\), disappeared from Claude’s responses. claude -pand SDK sessions saved transcript messages out of order or kept messages that were taken back.- For artifacts with several views, Claude now routes each view on the link’s
#nameand no longer says the address bar stays the same as you switch views. When choosing between a page and a document, the Artifact tool now makes explainers and visual or interactive work artifact pages, and keeps documents for writing people keep editing or pass around. - Before messaging a Slack channel you didn’t name, Claude now checks the channel’s topic for posting rules.
Background Sessions, Remote Control and Cloud
- A background session that crashed between turns was not restarted while it was attached, pinned, or had a scheduled task or wake-up set.
- The “background service did not respond” error suggested the disabled
claude daemon restart. It now suggestsclaude daemon stop --anyand says that ends background sessions. claude respawn <id>started the background service before reporting that no background session matches the id.- Messages shown when a background session’s process exits no longer promise a restart that isn’t coming, and they say how to resume the session.
- Status line links stayed plain text in background sessions after you opened them from a terminal that supports links.
- Remote Control sessions stayed on “Connecting” for about two minutes when a network proxy blocked a startup request.
- Messages that Claude sends to a cloud or Remote Control session appeared as your own message in the Claude mobile apps.
- Claude was not told the cause when a file attached to a message sent over Remote Control or to a cloud session could not be saved because the disk was full, or that a message’s attachments past the first 20 were left out.
- In Cowork cloud sessions, WebFetch and WebSearch hung on a stalled response. An unfinished request now fails after 300 seconds.
- Routines in Anthropic-hosted environments stayed locked after their owner left the organization and rejoined. The owner can now turn them back on.
- A failed routine API token delete or regenerate showed nothing if the edit dialog had already closed. It now shows an error toast.
- Cloud environment dialogs, including the admin dialog, accepted duplicate names. They now refuse a name another listed environment already has.
Terminal UI and Accessibility
- The
/rewindconfirmation said the conversation “will be forked” when the later messages are removed from it, and a/rewindwarning wrongly said manual and Bash edits are never affected by a code restore. /idesaid the VS Code extension was installed before the install finished or when it failed, and said it had installed the JetBrains plugin when nothing was installed.- The diff pane opened by itself after an edit in wide fullscreen terminals when it had nothing to show.
- The feedback draft card showed its 1/2/0 and Esc shortcuts while the prompt had text, when those keys act on the prompt instead of the card.
- In screen reader mode, plan approval sent feedback you had dismissed with Escape. Deleting a rule in
/permissionsnow says “Deleted allow rule …” right away, and Claude’s questions are listed as “Questions: Color (answered), Pages”, without arrows or symbols.
VS Code and JetBrains
- Custom skills and custom slash commands sent from the VS Code or JetBrains panel left out the open file or selected lines that ordinary messages include (anthropics/claude-code#102799).
- The extension host froze while the login shell ran its start-up files to read PATH on macOS and Linux.
- Clicking an image in a tool result, or closing its preview, also opened the result’s text in an editor tab.
- Voice dictation kept recording after a message was sent with the Send button. Sending now stops dictation first, as pressing Enter already did.
Self-Hosted Runner, Claude Tag and Code Review
- Self-hosted runner. A session failed to start when a rate limit (HTTP 429, or a git wrapper that exits 75) blocked an added read-only repository. It now starts without that repository.
- Claude Tag. In routines that run in a new session, a run with nothing to report can now end without posting a throwaway message to the channel.
- Code Review. A review whose session fails to start because of a transient server fault is now retried once automatically, and its check run says so. When the model still can’t analyze a change on the automatic retry, the check run now says no further automatic review will start.
The release contains 92 changes in total; see the full changelog for every item.
How to Update
- Check your installed version:
claude --version - Update in place:
claude update