Claude Code supports different permission modes that control how much autonomy Claude has:
Permission Modes
claude # Default: asks before writes
claude --dangerously-skip-permissions # YOLO mode: no confirmations
claude --allowedTools "Read,Glob,Grep" # Only allow specific tools
When to Use Each
Default mode - Most of the time. Claude asks before editing files, running commands, etc.
Restricted tools - When you want Claude to only research, not modify. Great for code exploration:
claude --allowedTools "Read,Glob,Grep,Bash(git log*)"
Skip permissions - Only for disposable environments like CI, Docker containers, or throwaway worktrees where nothing matters if it breaks.
Per-Tool Permissions
You can also allow specific tools with glob patterns:
claude --allowedTools "Edit,Write,Bash(npm test*),Bash(npm run lint*)"
This lets Claude edit files and run tests/lint, but blocks any other bash commands.