Skip to content
← Back to release · 2.1.259
New features / v2.1.259

Unattended permission handling

CHANGELOG · original

Added --permission-prompts none for unattended headless hosts: anything that would prompt is denied automatically while the active permission mode (including auto mode) keeps deciding
Open official changelog ↗

Documentation

Documentation excerpt

Turn off permission prompts in unattended runs

Pass --permission-prompts none when nobody is available to answer permission prompts, for example in a scheduled job. The flag matters most when your run has a permission host: an Agent SDK app with a canUseTool callback, or an MCP tool you pass with --permission-prompt-tool. Without the flag, your run waits for that host to answer each permission request.

With the flag, your run doesn't consult the host or wait on it. Anything that would prompt is denied unless a PermissionRequest hook allows it, Claude is told that nobody can approve the request and not to retry it, and the run continues. In a -p run with no host, these requests are denied either way, and the flag also tells Claude not to retry them. Permission rules, PermissionRequest hooks, and the permission mode you set still decide every call first; Claude Code denies only the requests that nothing else resolves.

This example runs an unattended task in auto mode. The classifier reviews each action as usual, and Claude Code denies anything that would have fallen back to a prompt:

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

With --permission-prompts none, Claude Code removes the tools that need an answer from a person, such as AskUserQuestion, so Claude can't call them. Any MCP elicitation request that no Elicitation hook answers is cancelled.

With --output-format stream-json, denials appear as permission_denied system messages, and the final result message lists them in permission_denials.

The --permission-prompts flag requires Claude Code v2.1.259 or later. Earlier versions reject it with an unknown-option error.

Documentation snapshot · 2026-09-23

Change details