brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: --permission-mode dontAsk denies instead of waiting in unattended runs

CLI
~/tips/tip-claude-dontask-unattended

claude -p "run the test suite" --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read"

Makes an unattended Claude Code run deny anything not on your allowlist instead of waiting.

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

More CLI tips printf 'GET /\r\n' | hexdump -C hexdump -C -s 512 -n 64 disk.img wget --limit-rate=2m https://example.com/big-file.iso wget --spider https://example.com/file.zip rg 'apiKey' -g '!*.min.js' -g '!package-lock.json' All CLI tips (46) All topics

Link