All skills
Skillintermediate

CLI reference

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

Claude Code Knowledge Pack7/10/2026

Overview

Documentation Index

Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt Use this file to discover all available pages before exploring further.

CLI reference

Complete reference for Claude Code command-line interface, including commands and flags.

CLI commands

You can start sessions, pipe content, resume conversations, and manage updates with these commands:

CommandDescriptionExample
claudeStart interactive sessionclaude
claude "query"Start interactive session with initial promptclaude "explain this project"
claude -p "query"Query via SDK, then exitclaude -p "explain this function"
`cat file \claude -p "query"`Process piped content
claude -cContinue most recent conversation in current directoryclaude -c
claude -c -p "query"Continue via SDKclaude -c -p "Check for type errors"
claude -r "<session>" "query"Resume session by ID or nameclaude -r "auth-refactor" "Finish this PR"
claude updateUpdate to latest versionclaude update
claude install [version]Install or reinstall the native binary. Accepts a version like 2.1.118, or stable or latest. See Install a specific versionclaude install stable
claude auth loginSign in to your Anthropic account. Use --email to pre-fill your email address, --sso to force SSO authentication, and --console to sign in with Anthropic Console for API usage billing instead of a Claude subscriptionclaude auth login --console
claude auth logoutLog out from your Anthropic accountclaude auth logout
claude auth statusShow authentication status as JSON. Use --text for human-readable output. Exits with code 0 if logged in, 1 if notclaude auth status
claude agentsList all configured subagents, grouped by sourceclaude agents
claude auto-mode defaultsPrint the built-in auto mode classifier rules as JSON. Use claude auto-mode config to see your effective config with settings appliedclaude auto-mode defaults > rules.json
claude mcpConfigure Model Context Protocol (MCP) serversSee the Claude Code MCP documentation.
claude pluginManage Claude Code plugins. Alias: claude plugins. See plugin reference for subcommandsclaude plugin install code-review@claude-plugins-official
claude remote-controlStart a Remote Control server to control Claude Code from Claude.ai or the Claude app. Runs in server mode (no local interactive session). See Server mode flagsclaude remote-control --name "My Project"
claude setup-tokenGenerate a long-lived OAuth token for CI and scripts. Prints the token to the terminal without saving it. Requires a Claude subscription. See Generate a long-lived tokenclaude setup-token

If you mistype a subcommand, Claude Code suggests the closest match and exits without starting a session. For example, claude udpate prints Did you mean claude update?.

CLI flags

Customize Claude Code's behavior with these command-line flags. claude --help does not list every flag, so a flag's absence from --help does not mean it is unavailable.

FlagDescriptionExample
--add-dirAdd additional working directories for Claude to read and edit files. Grants file access; most .claude/ configuration is not discovered from these directories. Validates each path exists as a directoryclaude --add-dir ../apps ../lib
--agentSpecify an agent for the current session (overrides the agent setting)claude --agent my-custom-agent
--agentsDefine custom subagents dynamically via JSON. Uses the same field names as subagent frontmatter, plus a prompt field for the agent's instructionsclaude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'
--allow-dangerously-skip-permissionsAdd bypassPermissions to the Shift+Tab mode cycle without starting in it. Lets you begin in a different mode like plan and switch to bypassPermissions later. See permission modesclaude --permission-mode plan --allow-dangerously-skip-permissions
--allowedToolsTools that execute without prompting for permission. See permission rule syntax for pattern matching. To restrict which tools are available, use --tools instead"Bash(git log *)" "Bash(git diff *)" "Read"
--append-system-promptAppend custom text to the end of the default system promptclaude --append-system-prompt "Always use TypeScript"
--append-system-prompt-fileLoad additional system prompt text from a file and append to the default promptclaude --append-system-prompt-file ./extra-rules.txt
--bareMinimal mode: skip auto-discovery of hooks, skills, plugins, MCP servers, auto memory, and CLAUDE.md so scripted calls start faster. Claude has access to Bash, file read, and file edit tools. Sets CLAUDE_CODE_SIMPLE. See bare modeclaude --bare -p "query"
--betasBeta headers to include in API requests (API key users only)claude --betas interleaved-thinking
--channels(Research preview) MCP servers whose channel notifications Claude should listen for in this session. Space-separated list of plugin:<name>@<marketplace> entries. Requires Claude.ai authenticationclaude --channels plugin:my-notifier@my-marketplace
--chromeEnable Chrome browser integration for web automation and testingclaude --chrome
--continue, -cLoad the most recent conversation in the current directory. Includes sessions that added this directory with /add-dir`claud