Omniscio

OmniscioGuidesDeny instead of prompting

Claude Code: deny instead of prompting

A permission prompt is a conversation with a person. When nobody is at the terminal, that conversation never ends and the session waits. This setting replaces the wait with a decision: refuse the call and carry on.

Last checked against Anthropic's documentation on November 26, 2026. By the Omniscio team. Updated .

What the setting does

Set permissions.denyInsteadOfPrompting to true and a tool call that would otherwise wait on a permission prompt is denied instead, while the turn continues. Anthropic describes it for a session nobody is watching: the work does not stop forever on a question no one will answer.

The key requires Claude Code v2.1.319 or later, and the one-run flag below requires v2.1.259 or later; claude --version prints what you have. Its default is unset, which is the ordinary behaviour: a call that needs approval prompts you. Setting it to false is the same as leaving it unset, so a second source that sets true still wins.

It applies in -p runs, interactive terminal sessions, the VS Code extension, local Desktop sessions, subagents and agent teams.

How to set it

Put the key under permissions in your user settings file, in managed settings, or in a file you pass with --settings. Those are the only sources Anthropic honours.

The example below also sets defaultMode to auto, which changes every new session. Drop that line if you only want the deny behaviour; the setting works with whichever permission mode you use, not only auto mode.

{
  "permissions": {
    "defaultMode": "auto",
    "denyInsteadOfPrompting": true
  }
}

A repository cannot set it. Anthropic's scope line puts the key in user settings, managed settings and --settings only, which keeps a clone from turning your approval prompts into denials.

What still decides a call

The setting is a last resort, not a blanket ban. A call goes ahead when an allow rule approves it, when your permission mode approves it, or when auto mode's classifier approves it. Only a call that nothing else resolves is denied.

To approve calls from code, Anthropic points at a PermissionRequest hook. That is the supported way to allow most of what would otherwise prompt, while the setting remains the floor for everything the hook does not answer.

What else it stops

With the setting on, Anthropic lists four other requests for an answer that Claude Code stops making:

  • Question and plan tools. Claude Code withholds AskUserQuestion, EnterPlanMode and ExitPlanMode, so a session in plan mode cannot exit it by itself. The one exception is a teammate spawned inside an agent team, which keeps EnterPlanMode and ExitPlanMode.
  • MCP elicitation. An elicitation request is cancelled unless an Elicitation hook answers it.
  • Permission hosts. Claude Code does not ask your canUseTool callback or a tool passed with --permission-prompt-tool. Some calls are denied before any hook is asked, such as a critical-path removal in auto mode that no ask rule covers.
  • The classifier billing notice. Where the notice about billed classifier requests would open a dialog, Claude Code does not show it and denies the actions that need those requests.

What still waits

Two dialogs are outside the setting. A session can still wait on the workspace trust dialog and on project MCP server approval, so Anthropic's advice is to answer both before you leave the session running. Start the session once yourself, accept the trust prompt for the folder, and answer the project server approval prompt when the session starts.

If the session is blocked on one of those, the setting has done its job on the tool calls and cannot help with the rest: the wait is a question about the folder or a server, not a permission request for a call.

What the denial looks like

The denial Claude reads can open with this text:

Permission for this tool use was denied. It requires approval, and this session has no approval surface

In stream-json output, a run that emits a permission_denied message reports this decision_reason:

no approval surface in this session; permission request denied automatically

In auto mode with the setting on, the turn ends after 20 calls in a row that the classifier blocked or a safety check refused, and you see this message:

20 actions were refused and no work went ahead in between, so Claude stopped.

A -p run reports that turn as error_during_execution.

One run instead of every session

For a single non-interactive run, pass --permission-prompts none with -p. The flag lasts for one run: your run does not consult the permission host or wait on it, anything that would prompt is denied unless a PermissionRequest hook allows it, and Claude is told that nobody can approve the request and not to retry it.

claude -p "Update the dependency pins and run the tests" --permission-mode auto --permission-prompts none

With --output-format stream-json, the denials appear as permission_denied system messages and the final result lists them in permission_denials. Anthropic requires v2.1.259 or later for the flag.

Common mistakes

  • Putting it in the project's settings file. Anthropic honours the key only from user, managed and --settings sources, so a project or local value does nothing.
  • Expecting it to answer every dialog. Workspace trust and project MCP server approval still wait for a person.
  • Expecting Claude to ask you a question. AskUserQuestion is left out while the setting is on.
  • Expecting plan mode to finish on its own. ExitPlanMode is left out too, so a session in plan mode cannot leave it by itself.
  • Thinking false overrides a managed true. false behaves like unset, and a call is still denied when another of these sources sets true.
  • Confusing it with dontAsk. dontAsk is a permission mode of its own; this key works with the mode you are in.

How do I know it is working?

  • A call you know needs approval is refused with the denial text above, and the turn continues instead of hanging.
  • In a -p run with --permission-prompts none and --output-format stream-json, the final result lists the denied calls in permission_denials.
  • Confirm it in the settings file you set it in.

Where these answers come from

Common questions

What does permissions.denyInsteadOfPrompting do?

A tool call that would otherwise wait on a permission prompt is denied instead, and the turn continues. It is built for a session nobody is watching, so the work does not sit forever on a question no one will answer. Anthropic requires Claude Code v2.1.319 or later.

Which settings file can set it?

User settings, managed settings, or a file passed with --settings. A repository cannot set it: the key's documented scope is user, managed and --settings only, so a cloned repo cannot turn your approval prompts into denials.

Does it turn off every permission prompt?

No. It denies the calls that nothing else approves, so allow rules, the permission mode, auto mode and a PermissionRequest hook still decide first. A session can also still wait on the workspace trust dialog and on project MCP server approval, so answer those before you leave it running.

What is the difference from dontAsk mode?

dontAsk is a permission mode of its own, while denyInsteadOfPrompting is a setting that works with the permission mode you are already in. For one non-interactive run, the matching switch is the --permission-prompts none flag rather than this setting.