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

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

Model & Configuration

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

Permissions & Security

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

Output & Format

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

System Prompt

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

Agent & Subagent

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

MCP & Plugins

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

Directory & Workspace

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

Budget & Limits

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

Integration

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

Initialization & Maintenance

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

Debug & Diagnostics

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

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

Version & Help

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

Subcommands

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

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

Sources

CLI Reference

Official CLI documentation

Headless Mode

Guide to non-interactive usage

Setup Guide

Installation and configuration

CHANGELOG

Latest updates and features