CLI flags set the behavior of a specific run and split by purpose just like everything else in Claude Code. First you distinguish the run forms: an interactive session with the claude command, a non-interactive run claude -p and subcommands like mcp, doctor, agents, project, auth, plugin and update. The form determines which flags make sense at all. This reference groups the most-used flags; the full and exact list for your version is in the official CLI reference and via claude --help.
The context and permission flags are the most important for security. --permission-mode sets the mode for the run, --allowedTools and --disallowedTools give pointed tool control with the permission-rule syntax, --add-dir gives access to an additional directory, --dangerously-skip-permissions enables bypass (and is named dangerous deliberately). --settings, --setting-sources, --mcp-config, --agents, --plugin-dir and --plugin-url control which configuration is picked up - especially together with --bare, which disables auto-discovery, and --safe-mode for diagnostics.
The automation flags determine determinism. --output-format chooses text, json or stream-json; --json-schema constrains structured output; --max-turns and --max-budget-usd cap turns and cost; --continue and --resume control session continuity; --verbose and --debug reveal diagnostics. Separately stand --worktree for an isolated tree, --background for a background session and --remote-control for remote control of local work. Below is a map of the key flags and subcommands by group.
As with commands, a flag's presence in the reference does not replace a check. Flags, models and their behavior change between versions, so before wiring a flag into a script or CI you check claude --help and the official reference - especially those with the words dangerously, skip or bypass. The exact --allowedTools syntax matches the permission rules from the corresponding chapter; when in doubt it is better to verify the actual behavior once with a narrow run than to build automation on an assumption.
| Group | Flag / form | Purpose |
|---|---|---|
| Run forms | claude / claude -p | Interactive session / non-interactive run |
| subcommands |
| mcp, doctor, agents, project, auth, plugin, update, remote-control |
| Permissions/context | --permission-mode | Mode for the run (plan, acceptEdits, dontAsk, ...) |
|---|
| --allowedTools / --disallowedTools | Pointed control (permission-rule syntax) |
| --add-dir | Access to an additional directory |
| --dangerously-skip-permissions | Bypass permissions (dangerous, isolation only) |
| Configuration | --bare / --safe-mode | No auto-discovery / diagnostic mode |
|---|
| --settings / --setting-sources | Explicit settings / limiting sources |
| --mcp-config / --agents / --plugin-dir | Explicit MCP, agents, plugin |
| Automation | --output-format / --json-schema | text|json|stream-json; structured output |
|---|
| --max-turns / --max-budget-usd | Cap on turns and cost |
| --continue / --resume | Session continuity |
| --verbose / --debug | Run diagnostics |
| Parallelism | --worktree / --background | Isolated tree / background session |
|---|