Claude Code v2.1.319: background MCP tasks, auto-denied permission prompts#

Published by

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

Claude Code 2.1.319, the build after 2.1.318, moves an MCP tool call that a server runs as a task to the background right away and tells Claude the result when it finishes. Its notes also cover a permissions.denyInsteadOfPrompting setting that denies a tool call which would wait on a prompt so the turn continues, and a new CLAUDE_CODE_DISABLE_FEATURE_FLAGS switch that stops feature-flag fetching while telemetry stays on.[1]

MCP tasks run in the background in the terminal#

When an MCP server runs a tool call as a task, Claude Code moves it to the background as soon as it starts and reports the result to Claude once the task finishes.[1] CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND makes Claude Code wait for the task inside its tool call, and CLAUDE_CODE_DISABLE_MCP_TASKS=1 turns MCP tasks off. These work in the terminal without feature-flag fetching, so Bedrock, Vertex, Foundry, LLM-gateway, and DISABLE_TELEMETRY sessions get them.[1]

Deny a permission prompt and keep the turn going#

With permissions.denyInsteadOfPrompting set, a tool call that would raise a permission prompt is denied at once, the model is told, and the turn carries on. It applies in terminal sessions, subagents, and agent teams, and matches what --permission-prompts none does for claude -p.[1] Allow rules, the permission mode, auto mode's classifier, and PermissionRequest hooks still decide first. When a run hits a streak of these denials in a row, the turn ends.

Feature-flag fetching and auto mode's server check#

CLAUDE_CODE_DISABLE_FEATURE_FLAGS stops Claude Code from fetching feature flags while leaving telemetry on; every flag then uses its built-in default.[1] It sits next to the existing DISABLE_GROWTHBOOK for the same effect. Auto mode's safety check now runs on the server, and in a session that can't reach it (telemetry or feature flags off, or behind some LLM gateways) actions are asked about or denied with no fallback to the built-in classifier. CLAUDE_CODE_AUTO_MODE_SERVER controls that path, and Bedrock, Vertex, and Foundry are unchanged.[1]

The Claude apps gateway: JSON logs, spend, pooled budgets#

On the Claude apps gateway, CLAUDE_GATEWAY_LOG_FORMAT=json writes operational log lines as JSON with severity, time, and message fields, for collectors that read the level from a field.[1] /usage now shows today, this-week, and this-month spend for developers behind a gateway who have no spend limit, and admin.pooled_conflict_rule with admin.pooled_priority_order set which pooled group budget pays first for a developer who belongs to several groups.[1]

Fixes to /diff, slash commands, and permission checks#

/diff no longer shows "Diff unavailable" when a git repository has a file or folder named HEAD at its top level, and the pane no longer opens blank in sessions where 64 or more turns edited files.[1] Slash commands typed after a leading space, tab, or newline now run. A request that kept failing with a 401 no longer refreshes your login on every retry and triggers 401s in your other sessions, and claude -p in auto mode now exits 1 when its actions were refused because no safety check was available. Three fixes close gaps in permission checks: a sed command could skip the check in accept-edits and auto mode, a crafted environment prefix could hide part of a Bash command, and creating a worktree could escape the sandbox.[1]

New environment variables#

VariableWhat It Does
CLAUDE_CODE_DISABLE_FEATURE_FLAGSStops Claude Code from fetching feature flags while leaving telemetry on; every flag then uses its built-in default. It has the same effect as the older DISABLE_GROWTHBOOK, and either one is named when a session reports why a server-gated capability is off.
CLAUDE_GATEWAY_LOG_FORMATSet to json on the Claude apps gateway to write operational log lines as JSON with severity, time, and message fields. Any other value keeps the default bracketed text output. It pairs with CLAUDE_GATEWAY_LOG_LEVEL, which filters those lines by level.

When the server-side check can't be reached#

Several of this release's changes share one condition: a session that can't reach Anthropic's server-side checks, because telemetry or feature-flag fetching is off, a gateway sits in the path, or a headless run has nobody to prompt. MCP tasks fall back to each flag's built-in default, auto mode asks or denies where its server check isn't reaching the session, and permissions.denyInsteadOfPrompting turns a prompt no one can answer into a denial that keeps the turn moving. A locked-down CI runner or a gateway deployment can set these and get the same decision on every run without the flag service.

The controls for the terminal MCP-task behavior and the auto-mode server switch, CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND and CLAUDE_CODE_AUTO_MODE_SERVER, were already in the 2.1.318 build; 2.1.319's notes are where their behavior is written down. The two variables this build introduces, CLAUDE_CODE_DISABLE_FEATURE_FLAGS and CLAUDE_GATEWAY_LOG_FORMAT, both tune what a session sends to or fetches from Anthropic.

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

Sources#

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

Previous Claude Code analysis: v2.1.318 (November 4, 2026)

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

Get the weekly digest

New Claude Code, Codex, Gemini CLI and OpenCode guides and release analyses, once a week, plus occasional notes.

One email a week plus occasional notes. Confirm by email; unsubscribe from any issue. Privacy