DontAsk Mode - Claude Code
Only pre-approved tools allowed. Fully non-interactive for CI.
DontAsk mode runs Claude Code with zero prompts. Any tool not on your allow list simply fails - no dialog, no escalation.
What it does
You pre-configure which tools and patterns are allowed. Claude either uses them or fails the turn. No human is in the loop. This is the headless-CI mode, designed for workflow runs, schedulers, and automated pipelines where waiting for a prompt would hang the job.
When to use it
- GitHub Actions, GitLab CI, or cron-scheduled Claude Code runs.
- Routines that run on infrastructure with no attached terminal.
- Batch jobs where a hang is worse than a clean failure.
- Automations that should fail loudly on unexpected tool needs.
Gotchas
- Over-tight allow lists break the job for legitimate needs. Err on the side of explicit lists, not bypass.
- Logs matter - you can't see the prompt, so make sure failures write enough detail to debug.
- Combine with bare mode for deterministic runs when hooks and skills might interfere.
Official docs: https://code.claude.com/docs/en/permission-modes.md#allow-only-pre-approved-tools-with-dontask-mode
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
Was this helpful?




