The Claude Code Changelog
All Episodes
Fixing Unattended Agent Stalls with denyInsteadOfPrompting

Fixing Unattended Agent Stalls with denyInsteadOfPrompting

0:00|0:00

Discover how Claude Code 2.1.319 prevents unattended agents from stalling with the new permissions.denyInsteadOfPrompting setting. Learn how to configure it properly alongside explicit allow rules, and catch up on smaller quality-of-life additions like background MCP tasks.


Chapter 1

Deny Instead of Prompting in Claude Code 2.1.319

Lachlan Reed

Ever kicked off a background agent, gone to make a coffee, and come back to find it sitting there, waiting on a permission prompt nobody was around to answer? Yeah. This is The Claude Code Changelog, brought to you by Jellypod AI, and today's the fix for that.

James Turner

It's Claude Code 2.1.319, released November 6, 2026. The new setting is permissions.denyInsteadOfPrompting. Set it to true, and any tool call that would wait on a permission prompt gets denied right away. Claude is told about the denial, and the turn keeps going.

Lachlan Reed

Now, we've had something like this before, the headless flag, claude dash p, permission prompts none. That showed up back in 2.1.259. But it only worked in print mode. This new setting covers interactive terminal sessions, subagents, and agent teammates too.

James Turner

Right, and that connects to our earlier episodes on write boundaries and silent auth expirations. Same theme, really. Enforcement that doesn't depend on a human being present.

James Turner

Here's how you turn it on. In your user settings file, ~/.claude/settings.json, add a permissions block with denyInsteadOfPrompting set to true. Or for a single run, pass it inline: claude p, your prompt, then settings, and a JSON string with permissions, denyInsteadOfPrompting, true. One catch. It must be a real boolean. A write-up from Developers Digest tested it, and when they passed the string yes, 2.1.319 refused to load that whole settings source. That means hooks and permission rules in that source stop applying too. So a typo costs you more than one setting.

Lachlan Reed

Oh, that's nasty. A tiny typo and your guardrails vanish.

Lachlan Reed

Now the order of operations matters. Allow rules, deny rules, your permission mode, the auto mode classifier, and PermissionRequest hooks all decide first. This setting only ever denies. It never allows anything. So the move is to pair it with explicit allow rules. In the Developers Digest test, a touch command was denied with only the setting on, and ran fine once an allow rule for that exact command was added. Then after a run, check permission_denials in the JSON output to see what Claude wanted and couldn't do.

James Turner

And the security property is the good part. It's read from user settings, the settings flag, and managed settings. Project and local settings are ignored. So a repo you cloned can't flip it on or off behind your back, and an organization can force it on through managed settings.

James Turner

Gotchas, though. With this on, Claude's question tool and plan mode tools aren't offered to the model at all. MCP requests for input get cancelled unless an Elicitation hook answers. Agent SDK apps using canUseTool or permission prompt tool are skipped, so route those through PermissionRequest hooks. And a run of consecutive refusals ends the turn. The threshold isn't documented, so don't rely on a number. Also, that write-up only tested print mode with the setting. Interactive sessions and subagents come from the changelog and schema, not their own runs.

Lachlan Reed

And versus dontAsk? dontAsk replaces your permission mode, and it's meant for locked down CI with an exact allowlist. This one sits on top of whatever mode you run, auto mode included, and only catches calls that would have prompted.

James Turner

A few smaller things in 2.1.319. MCP tool calls that run as tasks now move to the background in the terminal, and Claude gets told when they finish. Set CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND to wait instead. There's also CLAUDE_CODE_DISABLE_FEATURE_FLAGS, which stops flag fetching without turning off telemetry.

Lachlan Reed

And slash tasks now has an Earlier in this session row, so you can reopen a finished subagent and message it, even after a restart. One more: with telemetry or feature flags off, auto mode now asks or denies calls the server can't check, instead of falling back to the built in classifier. Set CLAUDE_CODE_AUTO_MODE_SERVER to zero if you want the old behavior. That's the update.