Anthropic Releases Claude Code v2.1.319 with Background MCP Tasks, Gateway Updates, and Diff Fixes
What changed
Anthropic has released Claude Code version 2.1.319, introducing changes to asynchronous tool execution, gateway configuration, permission controls, and session diff rendering.
- Background MCP Tasks: Model Context Protocol (MCP) server tool calls running as tasks in the terminal now move to the background immediately, notifying Claude upon completion. Developers can set the
CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUNDenvironment variable to force Claude Code to block and wait inside the tool call. The release also fixes connection failures and empty responses for older MCP servers using legacy handshakes. - Auto Mode and Gateway Behavior: When telemetry or feature flags are disabled behind an LLM gateway, uncheckable server calls are denied or prompted rather than falling back to the local classifier. Setting
CLAUDE_CODE_AUTO_MODE_SERVER=0preserves local classifier fallback. SettingCLAUDE_CODE_AUTO_MODE_SERVER=1forces server-side auto mode checks even ifCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASis set. Amazon Bedrock, Google Cloud Vertex AI, and Palantir Foundry integration behavior remains unchanged. - Permission and Flag Controls: A new
permissions.denyInsteadOfPromptingsetting automatically denies tool calls that would otherwise wait on user permission prompts, allowing terminal sessions, subagents, and teammates to continue without manual intervention. Developers can also setCLAUDE_CODE_DISABLE_FEATURE_FLAGSto block feature-flag fetching while maintaining telemetry. - Claude Apps Gateway Upgrades: Gateway operators gain JSON-formatted operational logging (
CLAUDE_GATEWAY_LOG_FORMAT=json), custom browser and login screen notices vialogin_notice, pooled budget prioritization (admin.pooled_conflict_ruleandadmin.pooled_priority_order), and spend metrics on/usagefor uncapped users. Startup warnings now flag model ID conflicts across policies as well as configurations missingdesktopHomeahead of Claude Desktop’s November 10 update. - Developer Workflow and Performance Tools: Added
/claude-api latency-optimizeto identify latency bottlenecks in API code and test settings against test evaluations. The/tasksview includes an “Earlier in this session” list for reopening finished subagents. Session authentication warnings now alert developers whenant auth logincredentials bill usage directly to a Claude Console organization, and a fix resolves repeated 401 authorization refresh failures. - Bug Fixes: Resolved an issue where
/diffopened blank in sessions where 64 or more turns edited files. Fixed/diffand claude.ai diff viewing failures caused by a top-level repository file or directory namedHEAD. Fixed slash commands executed with leading spaces, tabs, or newlines being passed as plain text.
Why it matters
Moving long-running MCP tool executions to background tasks prevents terminal agent workflows from blocking prompt loops. For teams running custom enterprise gateways, structured JSON logs simplify integration with observability pipelines, building on previous enterprise governance updates in Claude Code v2.1.295 and self-hosted runner settings added in Claude Code v2.1.311.
The fix to /diff resolves UI failures during extended editing sessions with 64 or more file-modifying turns, ensuring developers can inspect changes across long-running autonomous workflows.
What to do next
- Update the CLI: Install v2.1.319 using your package manager or CLI update path.
- Adjust Auto Mode Gateway Settings: If running Claude Code behind an LLM gateway with telemetry disabled, set
CLAUDE_CODE_AUTO_MODE_SERVER=0if you require local classifier fallback. - Configure Unattended Execution: Set
permissions.denyInsteadOfPromptingin configurations where subagents or teammates should fail fast on prompt-bound tools rather than hang. - Enable JSON Logging: Set
CLAUDE_GATEWAY_LOG_FORMAT=jsonon Claude apps gateways to ingest operational log fields (severity,time,message) into central log aggregators. - Caveats: In cloud sessions, timers started via
/loopwill stop if their container stops. Note that Amazon Bedrock, Vertex AI, and Foundry deployments do not require theCLAUDE_CODE_AUTO_MODE_SERVER=0workaround for auto mode behavior.
Sources
Share Article
If this article helped you, please share it with others!