Flags modify how claude starts and runs. Pass them on the command line; several can also be set permanently in settings.json (see Claude Code — Configuration). Interactive-only and print-only restrictions are noted in each table.
Session
| Flag | Purpose | Example |
|---|
--continue, -c | Load the most recent conversation in the current directory | claude -c |
--resume, -r | Resume a session by ID or name, or open the interactive picker | claude -r billing-refactor |
--fork-session | When resuming, create a new session ID (with --resume/--continue) | claude -r my-session --fork-session |
--from-pr <n|url> | Resume sessions linked to a GitHub PR | claude --from-pr 123 |
--session-id <uuid> | Use a specific session ID (must be a valid UUID) | claude --session-id 9f1c... |
--no-session-persistence | Don’t save the session to disk (print mode only) | claude -p "..." --no-session-persistence |
--add-dir <dirs...> | Add additional working directories (validates each path exists) | claude --add-dir ../shared-lib |
--worktree, -w [name] | Start in an isolated git worktree at <repo>/.claude/worktrees/<name> | claude -w experiment |
--teleport | Resume a web session in your local terminal | claude --teleport |
--remote "<task>" | Create a new web session on claude.ai with the given task | claude --remote "triage open issues" |
Models
| Flag | Purpose | Example |
|---|
--model <model> | Model alias (sonnet, opus) or full model name | claude --model claude-sonnet-4-6 |
--fallback-model <model> | Automatic fallback when the default model is overloaded (print mode only) | claude -p "..." --fallback-model sonnet |
--betas <headers> | Beta headers for API requests (API key users only) | claude --betas "feature-x" |
Permissions
| Flag | Purpose | Example |
|---|
--permission-mode <mode> | Begin in the specified permission mode (e.g. plan) | claude --permission-mode plan |
--allowedTools <list> | Tools that execute without prompting (permission rule syntax) | claude --allowedTools "Bash(git log *)" "Read" |
--disallowedTools <list> | Tools removed from the model’s context entirely | claude --disallowedTools "Task(Explore)" |
--tools <list> | Restrict which built-in tools Claude can use; "" disables all, "default" = all | claude --tools "Bash,Edit,Read" |
--permission-prompt-tool <tool> | MCP tool to handle permission prompts in non-interactive mode | claude -p ... --permission-prompt-tool mcp__auth__approve |
--allow-dangerously-skip-permissions | Make permission bypassing available without activating it; composable with --permission-mode | claude --allow-dangerously-skip-permissions |
--dangerously-skip-permissions | Skip all permission prompts — see the warning in Claude Code — Permissions | claude --dangerously-skip-permissions |
Context
| Flag | Purpose | Example |
|---|
--system-prompt <text> | Replace the entire system prompt (interactive + print) | claude --system-prompt "You are a strict reviewer" |
--system-prompt-file <path> | Replace the system prompt from a file (print only) | claude -p ... --system-prompt-file prompt.txt |
--append-system-prompt <text> | Append to the default system prompt (interactive + print) | claude --append-system-prompt "Prefer pnpm" |
--append-system-prompt-file <path> | Append system-prompt text from a file (print only) | claude -p ... --append-system-prompt-file extra.txt |
--agent <name> | Run the session as the given agent (overrides the agent setting); it runs as the main thread and can spawn subagents | claude --agent code-reviewer |
--agents <json> | Define custom subagents dynamically via JSON | claude --agents '{"reviewer":{"description":"...","prompt":"..."}}' |
--settings <path-or-json> | Load additional settings from a JSON file or string | claude --settings ./ci-settings.json |
--setting-sources <list> | Comma-separated setting sources to load (user, project, local) | claude --setting-sources user,project |
--disable-slash-commands | Disable all skills and slash commands for the session | claude --disable-slash-commands |
--system-prompt and --system-prompt-file are mutually exclusive; the append variants can combine with a replacement flag.
Output
| Flag | Purpose | Example |
|---|
--print, -p | Print the response without interactive mode | claude -p "summarize README.md" |
--output-format <fmt> | Print-mode output: text, json, stream-json | claude -p "..." --output-format json |
--input-format <fmt> | Print-mode input: text, stream-json | claude -p --input-format stream-json |
--json-schema <schema> | Validated JSON output matching a JSON Schema (print only); result lands in structured_output | claude -p "..." --json-schema '{"type":"object",...}' |
--include-partial-messages | Include partial streaming events (requires --print --output-format stream-json) | claude -p ... --output-format stream-json --include-partial-messages |
--verbose | Full turn-by-turn output (both modes) | claude --verbose |
Debugging
| Flag | Purpose | Example |
|---|
--debug [categories] | Debug mode, filterable by category | claude --debug "api,mcp" |
--version, -v | Output the version number | claude --version |
Automation
| Flag | Purpose | Example |
|---|
--max-turns <n> | Limit agentic turns (print only); errors when the limit is reached | claude -p "fix tests" --max-turns 10 |
--max-budget-usd <n> | Max dollars to spend on API calls before stopping (print only) | claude -p "..." --max-budget-usd 2 |
--init / --init-only | Run initialization hooks and start interactive mode / and exit | claude --init-only |
--maintenance | Run maintenance hooks and exit | claude --maintenance |
--teammate-mode <mode> | Agent-team teammate display: auto (default), in-process, tmux | claude --teammate-mode tmux |
Integrations
| Flag | Purpose | Example |
|---|
--mcp-config <files-or-json> | Load MCP servers from JSON files or strings | claude --mcp-config ./mcp.json |
--strict-mcp-config | Only use MCP servers from --mcp-config, ignoring all other MCP config | claude --mcp-config ./mcp.json --strict-mcp-config |
--ide | Auto-connect to an IDE on startup if exactly one valid IDE is available | claude --ide |
--chrome / --no-chrome | Enable / disable Chrome browser integration | claude --no-chrome |
--plugin-dir <dir> | Load plugins from directories for this session only (repeatable) | claude --plugin-dir ./my-plugin |
Last verified: 2026-09-07
Official sources:
AI coding tools evolve quickly. If you find outdated information, please open an issue or pull request.