You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`--add-dir`| Add additional working directories for Claude to access (validates each path exists as a directory) |`claude --add-dir ../apps ../lib`|
26
-
|`--agents`| Define custom [subagents](/en/sub-agents) dynamically via JSON (see below for format) |`claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'`|
27
-
|`--allowedTools`| A list of tools that should be allowed without prompting the user for permission, in addition to [settings.json files](/en/settings)|`"Bash(git log:*)" "Bash(git diff:*)" "Read"`|
28
-
|`--disallowedTools`| A list of tools that should be disallowed without prompting the user for permission, in addition to [settings.json files](/en/settings)|`"Bash(git log:*)" "Bash(git diff:*)" "Edit"`|
29
-
|`--print`, `-p`| Print response without interactive mode (see [SDK documentation](/en/sdk) for programmatic usage details)|`claude -p "query"`|
30
-
|`--system-prompt`| Replace the entire system prompt with custom text (works in both interactive and print modes; added in v2.0.14) |`claude --system-prompt "You are a Python expert"`|
31
-
|`--system-prompt-file`| Load system prompt from a file, replacing the default prompt (print mode only; added in v1.0.54) |`claude -p --system-prompt-file ./custom-prompt.txt "query"`|
32
-
|`--append-system-prompt`| Append custom text to the end of the default system prompt (works in both interactive and print modes; added in v1.0.55) |`claude --append-system-prompt "Always use TypeScript"`|
33
-
|`--output-format`| Specify output format for print mode (options: `text`, `json`, `stream-json`) |`claude -p "query" --output-format json`|
34
-
|`--input-format`| Specify input format for print mode (options: `text`, `stream-json`) |`claude -p --output-format json --input-format stream-json`|
35
-
|`--include-partial-messages`| Include partial streaming events in output (requires `--print` and `--output-format=stream-json`) |`claude -p --output-format stream-json --include-partial-messages "query"`|
36
-
|`--verbose`| Enable verbose logging, shows full turn-by-turn output (helpful for debugging in both print and interactive modes) |`claude --verbose`|
37
-
|`--max-turns`| Limit the number of agentic turns in non-interactive mode |`claude -p --max-turns 3 "query"`|
38
-
|`--model`| Sets the model for the current session with an alias for the latest model (`sonnet` or `opus`) or a model's full name |`claude --model claude-sonnet-4-5-20250929`|
39
-
|`--permission-mode`| Begin in a specified [permission mode](iam#permission-modes)|`claude --permission-mode plan`|
40
-
|`--permission-prompt-tool`| Specify an MCP tool to handle permission prompts in non-interactive mode |`claude -p --permission-prompt-tool mcp_auth_tool "query"`|
41
-
|`--resume`| Resume a specific session by ID, or by choosing in interactive mode |`claude --resume abc123 "query"`|
42
-
|`--continue`| Load the most recent conversation in the current directory |`claude --continue`|
43
-
|`--dangerously-skip-permissions`| Skip permission prompts (use with caution) |`claude --dangerously-skip-permissions`|
|`--add-dir`| Add additional working directories for Claude to access (validates each path exists as a directory) |`claude --add-dir ../apps ../lib`|
26
+
|`--agents`| Define custom [subagents](/en/sub-agents) dynamically via JSON (see below for format) |`claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'`|
27
+
|`--allowedTools`| A list of tools that should be allowed without prompting the user for permission, in addition to [settings.json files](/en/settings)|`"Bash(git log:*)" "Bash(git diff:*)" "Read"`|
28
+
|`--disallowedTools`| A list of tools that should be disallowed without prompting the user for permission, in addition to [settings.json files](/en/settings)|`"Bash(git log:*)" "Bash(git diff:*)" "Edit"`|
29
+
|`--print`, `-p`| Print response without interactive mode (see [SDK documentation](https://docs.claude.com/en/api/agent-sdk) for programmatic usage details) |`claude -p "query"`|
30
+
|`--system-prompt`| Replace the entire system prompt with custom text (works in both interactive and print modes; added in v2.0.14) |`claude --system-prompt "You are a Python expert"`|
31
+
|`--system-prompt-file`| Load system prompt from a file, replacing the default prompt (print mode only; added in v1.0.54) |`claude -p --system-prompt-file ./custom-prompt.txt "query"`|
32
+
|`--append-system-prompt`| Append custom text to the end of the default system prompt (works in both interactive and print modes; added in v1.0.55) |`claude --append-system-prompt "Always use TypeScript"`|
33
+
|`--output-format`| Specify output format for print mode (options: `text`, `json`, `stream-json`) |`claude -p "query" --output-format json`|
34
+
|`--input-format`| Specify input format for print mode (options: `text`, `stream-json`) |`claude -p --output-format json --input-format stream-json`|
35
+
|`--include-partial-messages`| Include partial streaming events in output (requires `--print` and `--output-format=stream-json`) |`claude -p --output-format stream-json --include-partial-messages "query"`|
36
+
|`--verbose`| Enable verbose logging, shows full turn-by-turn output (helpful for debugging in both print and interactive modes) |`claude --verbose`|
37
+
|`--max-turns`| Limit the number of agentic turns in non-interactive mode |`claude -p --max-turns 3 "query"`|
38
+
|`--model`| Sets the model for the current session with an alias for the latest model (`sonnet` or `opus`) or a model's full name |`claude --model claude-sonnet-4-5-20250929`|
39
+
|`--permission-mode`| Begin in a specified [permission mode](/en/iam#permission-modes)|`claude --permission-mode plan`|
40
+
|`--permission-prompt-tool`| Specify an MCP tool to handle permission prompts in non-interactive mode |`claude -p --permission-prompt-tool mcp_auth_tool "query"`|
41
+
|`--resume`| Resume a specific session by ID, or by choosing in interactive mode |`claude --resume abc123 "query"`|
42
+
|`--continue`| Load the most recent conversation in the current directory |`claude --continue`|
43
+
|`--dangerously-skip-permissions`| Skip permission prompts (use with caution) |`claude --dangerously-skip-permissions`|
44
44
45
45
<Tip>
46
46
The `--output-format json` flag is particularly useful for scripting and
@@ -114,7 +114,7 @@ Claude Code provides three flags for customizing the system prompt, each serving
114
114
115
115
For detailed information about print mode (`-p`) including output formats,
116
116
streaming, verbose logging, and programmatic usage, see the
Copy file name to clipboardExpand all lines: docs/common-workflows.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -247,7 +247,7 @@ claude --permission-mode plan
247
247
248
248
**Run "headless" queries in Plan Mode**
249
249
250
-
You can also run a query in Plan Mode directly with `-p` (i.e., in ["headless mode"](/en/sdk/sdk-headless)):
250
+
You can also run a query in Plan Mode directly with `-p` (i.e., in ["headless mode"](/en/headless)):
251
251
252
252
```bash theme={null}
253
253
claude --permission-mode plan -p "Analyze the authentication system and suggest improvements"
@@ -508,7 +508,7 @@ Use @ to quickly include files or directories without waiting for Claude to read
508
508
Suppose you're working on complex architectural decisions, challenging bugs, or planning multi-step implementations that require deep reasoning.
509
509
510
510
<Note>
511
-
[Extended thinking](/en/docs/build-with-claude/extended-thinking) is disabled by default in Claude Code. You can enable it on-demand by using `Tab` to toggle Thinking on, or by using prompts like "think" or "think hard". You can also enable it permanently by setting the [`MAX_THINKING_TOKENS` environment variable](/en/settings#environment-variables) in your settings.
511
+
[Extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) is disabled by default in Claude Code. You can enable it on-demand by using `Tab` to toggle Thinking on, or by using prompts like "think" or "think hard". You can also enable it permanently by setting the [`MAX_THINKING_TOKENS` environment variable](/en/settings#environment-variables) in your settings.
512
512
</Note>
513
513
514
514
<Steps>
@@ -535,7 +535,7 @@ Suppose you're working on complex architectural decisions, challenging bugs, or
535
535
<Tip>
536
536
Tips to get the most value out of extended thinking:
537
537
538
-
[Extended thinking](/en/docs/build-with-claude/extended-thinking) is most valuable for complex tasks such as:
538
+
[Extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) is most valuable for complex tasks such as:
539
539
540
540
* Planning complex architectural changes
541
541
* Debugging intricate issues
@@ -550,7 +550,7 @@ Suppose you're working on complex architectural decisions, challenging bugs, or
550
550
* "think" triggers basic extended thinking
551
551
* intensifying phrases such as "keep hard", "think more", "think a lot", or "think longer" triggers deeper thinking
552
552
553
-
For more extended thinking prompting tips, see [Extended thinking tips](/en/docs/build-with-claude/prompt-engineering/extended-thinking-tips).
553
+
For more extended thinking prompting tips, see [Extended thinking tips](https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/extended-thinking-tips).
When using Claude API, you can limit the total Claude Code workspace spend. To configure, [follow these instructions](https://support.claude.com/en/articles/9796807-creating-and-managing-workspaces). Admins can view cost and usage reporting by [following these instructions](https://support.claude.com/en/articles/9534590-cost-and-usage-reporting-in-console).
37
37
38
-
On Bedrock and Vertex, Claude Code does not send metrics from your cloud. In order to get cost metrics, several large enterprises reported using [LiteLLM](/en/bedrock-vertex-proxies#litellm), which is an open-source tool that helps companies [track spend by key](https://docs.litellm.ai/docs/proxy/virtual_keys#tracking-spend). This project is unaffiliated with Anthropic and we have not audited its security.
38
+
On Bedrock and Vertex, Claude Code does not send metrics from your cloud. In order to get cost metrics, several large enterprises reported using [LiteLLM](/en/third-party-integrations#litellm), which is an open-source tool that helps companies [track spend by key](https://docs.litellm.ai/docs/proxy/virtual_keys#tracking-spend). This project is unaffiliated with Anthropic and we have not audited its security.
0 commit comments