> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/jackdog668/claude-code/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Overview

> Reference for the claude CLI: flags, options, and available subcommands.

The `claude` command starts an interactive session by default. Pass a prompt as an argument to send a single message, or use `-p` / `--print` for non-interactive pipeline usage.

```bash theme={null}
claude [prompt] [options]
claude <subcommand> [options]
```

## Global flags

<ParamField path="-p, --print" type="boolean">
  Print the response to stdout and exit immediately. Skips the workspace trust
  dialog. Only use this flag in directories you trust.
</ParamField>

<ParamField path="--model <model>" type="string">
  Model to use for the current session. Accepts a short alias (e.g. `sonnet`,
  `opus`) or a full model ID (e.g. `claude-sonnet-4-6`).
</ParamField>

<ParamField path="-d, --debug [filter]" type="string | boolean">
  Enable debug mode. Optionally pass a comma-separated category filter (e.g.
  `"api,hooks"` or `"!1p,!file"` to exclude categories).
</ParamField>

<ParamField path="--verbose" type="boolean">
  Override the verbose mode setting from config.
</ParamField>

<ParamField path="--permission-mode <mode>" type="string">
  Permission mode for the session. Choices: `default`, `acceptEdits`,
  `bypassPermissions`, `dontAsk`, `plan`.
</ParamField>

<ParamField path="--dangerously-skip-permissions" type="boolean">
  Bypass all permission checks. Recommended only for sandboxes with no internet
  access.
</ParamField>

<ParamField path="--settings <file-or-json>" type="string">
  Path to a settings JSON file, or a JSON string, to load additional settings
  from.
</ParamField>

<ParamField path="-r, --resume [session-id]" type="string | boolean">
  Resume a conversation. Provide a session ID to resume directly, or omit the
  value to open an interactive picker. Optionally pass a search term to
  pre-filter the picker.
</ParamField>

<ParamField path="-c, --continue" type="boolean">
  Continue the most recent conversation in the current directory.
</ParamField>

<ParamField path="--max-turns <turns>" type="number">
  Maximum number of agentic turns in non-interactive mode. Causes an early exit
  after the specified number of turns. Only works with `--print`.
</ParamField>

<ParamField path="--output-format <format>" type="string">
  Output format. Only works with `--print`. Choices:

  * `text` (default) — plain text
  * `json` — single JSON result
  * `stream-json` — realtime streaming JSON
</ParamField>

<ParamField path="--input-format <format>" type="string">
  Input format. Only works with `--print`. Choices:

  * `text` (default) — plain text
  * `stream-json` — realtime streaming JSON input
</ParamField>

<ParamField path="--add-dir <directories...>" type="string[]">
  Additional directories to allow tool access to.
</ParamField>

<ParamField path="--allowedTools, --allowed-tools <tools...>" type="string[]">
  Comma- or space-separated list of tool names to allow (e.g.
  `"Bash(git:*) Edit"`).
</ParamField>

<ParamField path="--disallowedTools, --disallowed-tools <tools...>" type="string[]">
  Comma- or space-separated list of tool names to deny (e.g.
  `"Bash(git:*) Edit"`).
</ParamField>

<ParamField path="--mcp-config <configs...>" type="string[]">
  Load MCP servers from JSON files or inline JSON strings (space-separated).
</ParamField>

<ParamField path="-n, --name <name>" type="string">
  Set a display name for this session (shown in `/resume` and the terminal
  title).
</ParamField>

<ParamField path="--plugin-dir <path>" type="string">
  Load plugins from a directory for this session only. Repeatable:
  `--plugin-dir A --plugin-dir B`.
</ParamField>

<ParamField path="--system-prompt <prompt>" type="string">
  System prompt to use for the session.
</ParamField>

<ParamField path="--append-system-prompt <prompt>" type="string">
  Append text to the default system prompt.
</ParamField>

<ParamField path="--no-session-persistence" type="boolean">
  Disable session persistence — sessions will not be saved to disk and cannot
  be resumed. Only works with `--print`.
</ParamField>

<ParamField path="--fallback-model <model>" type="string">
  Enable automatic fallback to the specified model when the default model is
  overloaded. Only works with `--print`.
</ParamField>

<ParamField path="--effort <level>" type="string">
  Effort level for the session. Choices: `low`, `medium`, `high`, `max`.
</ParamField>

<ParamField path="--bare" type="boolean">
  Minimal mode: skips hooks, LSP, plugin sync, attribution, auto-memory,
  background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets
  `CLAUDE_CODE_SIMPLE=1`. Auth is strictly `ANTHROPIC_API_KEY` or
  `apiKeyHelper` via `--settings`.
</ParamField>

## Usage examples

<CodeGroup>
  ```bash Interactive session theme={null}
  claude
  ```

  ```bash Single prompt theme={null}
  claude "Explain this codebase"
  ```

  ```bash Non-interactive (pipe-friendly) theme={null}
  echo "What does this do?" | claude -p --output-format text
  ```

  ```bash Resume last session theme={null}
  claude -c
  ```

  ```bash Resume by ID theme={null}
  claude --resume 550e8400-e29b-41d4-a716-446655440000
  ```

  ```bash Restrict tools theme={null}
  claude --allowedTools "Read,Bash(git:*)"
  ```
</CodeGroup>

## Subcommands

| Subcommand                     | Description                              |
| ------------------------------ | ---------------------------------------- |
| [`mcp`](/commands/mcp)         | Configure and manage MCP servers         |
| [`plugin`](/commands/plugin)   | Manage Claude Code plugins               |
| [`config`](/commands/config)   | Open the interactive configuration panel |
| [`memory`](/commands/memory)   | Edit Claude memory files (CLAUDE.md)     |
| [`session`](/commands/session) | Resume and manage past sessions          |
| `auth`                         | Manage authentication                    |
| `doctor`                       | Run diagnostic checks                    |

<Note>
  Subcommands for `auth`, `doctor`, and others follow the same help flag
  convention: use `-h` or `--help` to see their options.
</Note>
