Agent Upstart

Cool things people are building with agents — and practical help getting the most out of them.

Playbooks · Coding tasks

Claude Code 2.1.319: unattended runs stop stalling

Written November 7, 2026

A new setting denies permission prompts instead of waiting on them, and MCP tasks run in the background. What changes for overnight jobs.

The stall

An unattended Claude Code job — an overnight run, a scheduled job, a CI step — dies quietly at a permission prompt nobody is there to answer. The job does not fail loudly; it waits. Claude Code 2.1.319, released November 6, 2026, adds a switch for exactly that case, and changes how slow MCP calls behave while it is at it.

What changed

The headline is the denyInsteadOfPrompting setting under permissions: a tool call that would wait on a permission prompt is denied and the turn continues, in terminal sessions, subagents, and agent teams. Turn it on for a job nobody watches, and a prompt becomes a denial instead of a hang. A denied call still means the work it would have done does not happen — the setting changes the failure from waiting to skipping, so the job needs a way to notice what was skipped.

MCP tasks move to the background. When an MCP server runs a tool call as a task, Claude Code moves it to the background right away and reports the result when it finishes, so a slow MCP call no longer blocks the session. The off-switch is the CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND environment variable, which makes Claude Code wait for an MCP task inside its tool call instead. A related change turns MCP tasks on in the terminal without feature-flag fetching, with CLAUDE_CODE_DISABLE_MCP_TASKS=1 to turn them off.

Auto mode's safety check moves server-side behind gateways. With telemetry or feature flags off, including behind LLM gateways, calls the server cannot check are asked about or denied, with no fallback to the built-in classifier; set CLAUDE_CODE_AUTO_MODE_SERVER=0 to keep using it. Bedrock, Vertex, and Foundry are unchanged. Behind a gateway, CLAUDE_CODE_AUTO_MODE_SERVER=1 turns on the server-side check even with experimental betas disabled.

Two smaller changes matter for scripts. claude -p in auto mode used to exit 0 when its actions were refused because no safety check was available; text and JSON output now exit 1, so a script can tell a refused run from a clean one. And /claude-api latency-optimize finds where Claude API code makes people wait and tries faster settings against an eval.

The security fixes in the same release

The release notes list a long set of fixes. They include a sandbox escape when creating a worktree, a Bash permission bypass where a crafted environment prefix could hide part of a command from permission checks, and a case where a sed command could skip the permission check in accept-edits and auto mode. These are fixed in 2.1.319; they are not live vulnerabilities to work around, they are reasons to update before the next unattended run.

Running a job nobody watches

For an overnight job on 2.1.319, the shape is: turn on denyInsteadOfPrompting, let MCP tasks run in the background, and read the transcript and the exit code when the job ends instead of assuming a clean exit means complete work. Check the transcript for denied tool calls — those are the steps the job skipped — and check whether any backgrounded MCP task's result arrived, since a task that reports back late leaves its result out of the work that followed.

Behind a gateway, remember the safety check is server-side, not local. A job that behaves differently behind a gateway than on a direct connection is behaving as the release describes, not misconfigured: the check happens where the server can reach it.

Limits

Related playbooks

Sources

Back to: Coding playbooks hub · Also: Claude Code subagent status: 99% cheaper, still watched · Claude Code sign-in expiry: the fork effort · Run parallel subagents in Claude Code