A CI job has nobody to click "yes". A prompt there is a hang.
dontAsk is a permission mode that denies every call that would otherwise prompt. Pair it with an exact allowlist and the run can only do what you named.
claude -p "run the test suite" --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read"
What still runs without approval: file reads in your working directories, read-only Bash commands, actions matching your allow rules, and calls approved by a PreToolUse hook. Everything else is denied and the session never waits for input.
That is the opposite of --dangerously-skip-permissions, and I like it for exactly that reason. The run fails loudly on something unexpected instead of doing it.
The mental model is a whitelist with a trapdoor. Whatever you list runs, and whatever you forgot is denied, not asked about. That makes the allowlist the single place to look when a job does less than you hoped, and it makes the failure mode a clear "permission denied" rather than a stuck process nobody notices for hours.
dontAsk never shows up in the Shift+Tab cycle. You set it with the flag. In project settings, defaultMode honors every value except auto and bypassPermissions, so dontAsk can live there.
Further reading: Permission modes – Claude Code docs, Run Claude Code programmatically – Claude Code docs, On this site: deny Read(./.env) so Claude never opens your secrets, On this site: .claude/settings.local.json overrides the team file just for you