Repository navigation
Claude Code CLI Flags
xsyetopz edited this page Oct 19, 2026
·
1 revision
A flag changes how one claude run behaves.
claude --help lists 66 flags, and 64 more are hidden (see CLI Hidden Flags).
For example, claude -p "Summarize README.md" --output-format json --max-budget-usd 1 prints one answer and stops, and claude --model opus --effort high --permission-mode plan starts a careful planning session.
A row has the mark ✅ when CLI Reference or another docs page names the flag. The text of each row says in plain words what the flag does. For the full behavior, open the docs page.
| Flag | Mark | What it does |
|---|---|---|
-h, --help |
✅ | Shows the help text and exits. |
-d, --debug [filter] |
✅ | Turns on debug logs, and an optional filter picks the categories. |
--debug-file <path> |
✅ | Writes the debug logs to a file and turns on debug mode. |
--verbose |
✅ | Overrides the verbose setting of your config. |
-p, --print |
✅ | Prints the answer and exits, which suits pipes, and the trust dialog is skipped in this mode. |
--bare |
✅ | Starts with a minimal setup: no hooks, no plugin sync, no auto memory, and no background work. |
--safe-mode |
✅ | Starts with all customizations off, such as CLAUDE.md, skills, plugins, hooks, and MCP servers. |
--output-format <format> |
✅ | Sets the output of print mode to text, json, or stream-json. |
--json-schema <schema> |
✅ | Checks the final answer against a JSON Schema. |
--include-hook-events |
✅ | Adds the hook events to the stream, with --output-format=stream-json. |
--include-partial-messages |
✅ | Adds partial message chunks to the stream, with --print and stream-json. |
--forward-subagent-text |
✅ | Adds the text of subagents to the stream as assistant and user messages, with --print and stream-json. |
--input-format <format> |
✅ | Sets the input of print mode to text or stream-json. |
--dangerously-skip-permissions |
✅ | Skips all permission checks, and you should use it only in a sandbox with no internet access. |
--allow-dangerously-skip-permissions |
✅ | Makes skipping all permission checks a choice, without turning it on. |
--max-budget-usd <amount> |
✅ | Stops at a spend limit in dollars, with --print only. |
--replay-user-messages |
✅ | Sends the user messages from stdin back on stdout as an acknowledgment. |
--prompt-suggestions [value] |
✅ | Turns on prompt suggestions, and print mode sends a prompt_suggestion message after each turn. |
--allowedTools, --allowed-tools <tools...> |
✅ | Lists the tools that run without a permission prompt. |
--tools <tools...> |
✅ | Lists the built-in tools that the model can use. |
--restricted |
✅ | Removes the tools that run code and WebFetch, and ignores user, project, and local settings. |
--disallowedTools, --disallowed-tools <tools...> |
✅ | Lists the tools that the model cannot use. |
--mcp-config <configs...> |
✅ | Loads MCP servers from JSON files or strings. |
--permission-prompts <target> |
✅ | Sets who answers permission prompts: host or none. |
--system-prompt <prompt> |
✅ | Replaces the system prompt for the session. |
--append-system-prompt <prompt> |
✅ | Adds text to the end of the default system prompt. |
--system-prompt-snapshot <on|off> |
✅ | Sets whether the system prompt is recorded once and reused on every request and resume. |
--exclude-dynamic-system-prompt-sections |
✅ | Moves the data of the machine from the system prompt to the first user message for better cache reuse. |
--permission-mode <mode> |
✅ | Sets the permission mode of the session. |
-c, --continue |
✅ | Continues the newest conversation of the current folder. |
-r, --resume [value] |
✅ | Resumes a conversation by session ID, or opens the picker. |
--fork-session |
✅ | Creates a new session ID when you resume, with --resume or --continue. |
--from-pr [value] |
✅ | Resumes a session that links to a pull request. |
--no-session-persistence |
✅ | Saves nothing to disk, so the session cannot be resumed, with --print only. |
--model <model> |
✅ | Sets the model with an alias such as opus or with a full name. |
--effort <level> |
✅ | Sets the effort level of the session. |
--agent <agent> |
✅ | Sets the agent of the session and overrides the agent setting. |
--betas <betas...> |
✅ | Adds beta headers to API requests, for API key users only. |
--fallback-model <model> |
✅ | Sets one or more models to try when the main model is overloaded or not available. |
--settings <file-or-json> |
✅ | Loads more settings from a JSON file or a JSON string. |
--add-dir <directories...> |
✅ | Gives the tools access to more folders. |
--ide |
✅ | Connects to the IDE at startup when exactly one valid IDE is open. |
--desktop |
✅ | Opens the session in the Claude Desktop app instead of the terminal. |
--strict-mcp-config |
✅ | Uses only the MCP servers from --mcp-config. |
--session-id <uuid> |
✅ | Uses a UUID that you give as the session ID. |
-n, --name <name> |
✅ | Sets the display name of the session. |
--agents <json-or-file> |
✅ | Defines custom agents with JSON or a file. |
--setting-sources <sources> |
✅ | Chooses which setting sources load: user, project, and local. |
--plugin-dir <path> |
✅ | Loads a plugin from a folder or a .zip file for this session only. |
--plugin-url <url> |
✅ | Fetches a plugin .zip file from a URL for this session only. |
--disable-slash-commands |
✅ | Turns off all skills. |
--chrome |
✅ | Turns on the Claude in Chrome integration. |
--no-chrome |
✅ | Turns off the Claude in Chrome integration. |
-w, --worktree [name] |
✅ | Creates a new git worktree for the session. |
--tmux |
✅ | Creates a tmux session for the worktree, and it needs --worktree. |
--autocompact <auto|tokens> |
✅ | Sets the auto-compact window to auto or to 100k to 1M tokens. |
--bg, --background |
✅ | Starts the session in the background and prints its ID. |
--brief |
🔍 | Turns on the SendUserMessage tool so the agent can message the user. |
--ax-screen-reader |
✅ | Draws flat text with no borders or animations, for screen readers. |
--teleport [session] |
✅ | Resumes a teleport session. |
--cloud [description|session_id|url] |
✅ | Creates a cloud session, or attaches to one by session ID or claude.ai/code URL. |
--environment <environment_id> |
✅ | Creates a cloud session on a self-hosted environment. |
--remote-control [name] |
✅ | Starts an interactive session with Remote Control turned on. |
--file <specs...> |
🔍 | Downloads file resources at startup, in the form file_id:relative_path. |
--remote-control-session-name-prefix <prefix> |
✅ | Sets the prefix of the names that Remote Control makes, and the default is the host name. |
-v, --version |
✅ | Prints the version number. |
claudetto
- Start
- Slices
- Add-Ons
- Reference
- Rationale
- Evidence
- Development
Claude Code 2.1.303
- Start
- Models and Context
- Configure
- Extend
- Findings