Skip to main content
Last Updated: March 02, 2026
Complete reference of all available command-line flags, subcommands, and environment variables when launching Claude Code from the terminal.

Session Management

--continue
flag
default:"-c"
Continue the most recent conversation in the current directory
--resume
flag
default:"-r"
Resume a specific session by ID or name, or show interactive picker
--from-pr
string
Resume sessions linked to a specific GitHub PR (accepts NUMBER or URL)
--fork-session
flag
Create a new session ID when resuming (use with --resume or --continue)
--session-id
string
Use a specific session ID (must be valid UUID)
--no-session-persistence
flag
Disable session persistence (print mode only)
--remote
flag
Create a new web session on claude.ai
--teleport
flag
Resume a web session in your local terminal

Model & Configuration

--model
string
Set model with alias (sonnet, opus, haiku) or full model ID
--fallback-model
string
Auto-fallback model when default is overloaded (print mode only)
--betas
string
Beta headers to include in API requests (API key users only)

Permissions & Security

--dangerously-skip-permissions
flag
Skip ALL permission prompts. Use with extreme caution
--dangerously-skip-permissions bypasses all safety checks. Only use in trusted, isolated environments.
--allow-dangerously-skip-permissions
flag
Enable permission bypassing as an option without activating it
--permission-mode
string
Begin in specified permission mode: default, plan, acceptEdits, bypassPermissions
--allowedTools
string
Tools that execute without prompting (permission rule syntax)
--disallowedTools
string
Tools removed from model context entirely
--tools
string
Restrict which built-in tools Claude can use (use "" to disable all)
--permission-prompt-tool
string
Specify MCP tool to handle permission prompts in non-interactive mode

Output & Format

--print
flag
default:"-p"
Print response without interactive mode (headless/SDK mode)
--output-format
string
Output format: text, json, stream-json
--input-format
string
Input format: text, stream-json
--json-schema
string
Get validated JSON matching schema (print mode only)
--include-partial-messages
flag
Include partial streaming events (requires --print and --output-format=stream-json)
--verbose
flag
Enable verbose logging with full turn-by-turn output

System Prompt

--system-prompt
string
Replace entire system prompt with custom text
--system-prompt-file
string
Load system prompt from file, replacing default (print mode only)
--append-system-prompt
string
Append custom text to default system prompt
--append-system-prompt-file
string
Append file contents to default prompt (print mode only)

Agent & Subagent

--agent
string
Specify an agent for the current session
--agents
json
Define custom subagents dynamically via JSON
--teammate-mode
string
Set agent team display: auto, in-process, tmux

MCP & Plugins

--mcp-config
string
Load MCP servers from JSON file or string
--strict-mcp-config
flag
Only use MCP servers from --mcp-config, ignore all others
--plugin-dir
string
Load plugins from directory for this session only (repeatable)

Directory & Workspace

--add-dir
string
Add additional working directories for Claude to access
--worktree
flag
default:"-w"
Start Claude in an isolated git worktree (branched from HEAD)

Budget & Limits

--max-budget-usd
number
Maximum dollar amount for API calls before stopping (print mode only)
--max-turns
number
Limit number of agentic turns (print mode only)

Integration

--chrome
flag
Enable Chrome browser integration for web automation
--no-chrome
flag
Disable Chrome browser integration for this session
--ide
flag
Automatically connect to IDE on startup if exactly one valid IDE available

Initialization & Maintenance

--init
flag
Run initialization hooks and start interactive mode
--init-only
flag
Run initialization hooks and exit (no interactive session)
--maintenance
flag
Run maintenance hooks and exit

Debug & Diagnostics

--debug
string
Enable debug mode with optional category filtering (e.g., "api,hooks")
Use --debug to troubleshoot hook execution, API calls, and internal behavior. Add category filters to focus output.

Settings Override

--settings
string
Path to settings JSON file or JSON string to load
--setting-sources
string
Comma-separated list of sources to load: user, project, local
--disable-slash-commands
flag
Disable all skills and slash commands for this session

Version & Help

--version
flag
default:"-v"
Output the version number
--help
flag
default:"-h"
Show help information

Subcommands

These are not flags but top-level subcommands run as claude <subcommand>:
claude

Environment Variables

These environment variables modify Claude Code behavior at startup:
  • CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 — Enable experimental agent teams
  • CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 — Disable experimental beta features
  • CLAUDE_CODE_TMPDIR — Override temp directory for internal files
  • CLAUDE_CODE_DISABLE_BACKGROUND_TASKS — Disable background task functionality
  • USE_BUILTIN_RIPGREP=0 — Use system ripgrep instead of built-in (Alpine Linux)
  • MAX_THINKING_TOKENS — Limit thinking token budget (set to 0 to disable)
  • CLAUDE_CODE_EFFORT_LEVEL — Control thinking depth: low, medium, high
  • CLAUDE_AUTOCOMPACT_PCT_OVERRIDE — Auto-compact threshold percentage
  • CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 — Enable additional directory CLAUDE.md loading
  • DISABLE_AUTOUPDATER=1 — Disable auto-updates
  • CLAUDE_CODE_ENABLE_TASKS=false — Disable new task management system, revert to old todos
  • CLAUDE_CODE_SHELL — Override automatic shell detection
  • CLAUDE_BASH_NO_LOGIN=1 — Skip login shell for BashTool
  • CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS — Override default file read token limit
  • CLAUDE_CODE_EXIT_AFTER_STOP_DELAY — Auto-exit SDK mode after idle duration (ms)
  • CLAUDE_CODE_SIMPLE — Enable simple mode (Bash + Edit tools only)

Usage Examples

claude --continue

Sources

CLI Reference

Official CLI documentation

Headless Mode

Guide to non-interactive usage

Setup Guide

Installation and configuration

CHANGELOG

Latest updates and features

Build docs developers (and LLMs) love