๐ Table of Contents
- Quick Start Commands
- CLI Flags (Launch-Time)
- Environment Variables
- Authentication & API
- Cloud Providers
- Model Configuration
- Agent Teams (Experimental)
- Bash & Shell Behavior
- Memory & Context
- MCP Protocol
- Tasks & Scheduling
- Plugins & Updates
- Disabling Features
- Network & Proxy
- Miscellaneous
- Slash Commands
- Quick Reference Matrix
- Installation & Setup
- Tips & Best Practices
- Real-World Examples
Quick Start Commands
๐ฏ Most Used
| Command | Description | Example |
|---|---|---|
| claude | Start interactive REPL session | claude |
| claude "query" | Start session with initial prompt | claude "explain this function" |
| claude -p "query" | Non-interactive print mode (query and exit) | claude -p "review this code" |
| claude -c | Continue most recent conversation | claude -c |
| claude --continue | Long form of -c | claude --continue |
| claude -r "id" "query" | Resume a specific session by ID | claude -r "abc123" "finish the task" |
| claude --resume | Resume last session interactively | claude --resume |
| claude -v | Show installed version number | claude -v |
| cat file | claude -p "q" | Process piped stdin | cat error.log | claude -p "diagnose" |
| claude update | Update to latest version | claude update |
| claude install --force | Force reinstall (bypasses stale locks) | claude install --force |
| claude auth login | Authenticate with Anthropic account | claude auth login |
| claude auth login --console | Auth via API Console / billing account | claude auth login --console |
| claude auth status | Check current authentication status | claude auth status |
CLI Flags (Launch-Time)
โ๏ธ Configuration
Passed when launching Claude Code to customize session behavior.
๐ Working Directory & Scope
| Flag | Description | Example |
|---|---|---|
| --add-dir | Add additional working directories (validates paths exist) | claude --add-dir ../apps ../lib |
| -w, --worktree | Launch in isolated git worktree (loads skills/hooks from worktree dir) | claude --worktree |
| --fork-session | Create new session ID when resuming (parallel work branches) | claude --fork-session |
๐ค Model & Agents
| Flag | Description | Example |
|---|---|---|
| --model | Set model (aliases: sonnet, opus, haiku โ or full model ID) | claude --model claude-opus-4-6 |
| --agent | Specify a named agent for the session | claude --agent general-purpose |
| --teammate-mode | Set team display: auto | in-process | tmux | claude --teammate-mode in-process |
| --agents | Define custom subagents inline via JSON array | claude --agents '[{"name":"explorer"}]' |
| --effort | Set thinking effort: low | medium | high | max | auto | claude --effort high |
๐ Permissions & Security
| Flag | Description | Example |
|---|---|---|
| --permission-mode | Start in a specific mode (e.g., plan) | claude --permission-mode plan |
| --dangerously-skip-permissions | Skip all permission prompts โ ๏ธ โ use only in devcontainer with firewall | claude --dangerously-skip-permissions |
| --allow-dangerously-skip-permissions | Allow the skip-permissions option without activating it | claude --permission-mode plan --allow-dangerously-skip-permissions |
| --tools | Restrict built-in tools (works in interactive AND -p mode) | claude --tools "Bash,Edit,Read" |
| --allowedTools | Tools that run without prompting for permission | claude --allowedTools "Write" "Bash(git *)" |
| --disallowedTools | Tools removed from context entirely; cannot be used | claude --disallowedTools "Bash(rm *)" |
| --permission-prompt-tool | MCP tool to handle permission prompts in -p (non-interactive) mode | claude -p --permission-prompt-tool mcp_auth_tool "q" |
๐พ System Prompt Customization
| Flag | Description | Example |
|---|---|---|
| --system-prompt | Replace entire system prompt with custom text | claude --system-prompt "You are a Python expert" |
| --system-prompt-file | Load system prompt replacement from file (mutually exclusive with --system-prompt) | claude --system-prompt-file ./prompts/custom.txt |
| --append-system-prompt | Append text to the default system prompt (preserves built-in capabilities) | claude --append-system-prompt "Always use TypeScript" |
| --append-system-prompt-file | Append file contents to the default system prompt | claude --append-system-prompt-file ./style-rules.txt |
๐ค Output & Input Formats
| Flag | Description | Example |
|---|---|---|
| --output-format | text | json | stream-json | claude -p --output-format json "query" |
| --input-format | Set input format (e.g., stream-json for piped input) | claude -p --input-format stream-json |
| --include-partial-messages | Include partial streaming events in output | claude -p --output-format stream-json --include-partial-messages "q" |
| --json-schema | Return validated JSON matching a specific schema | claude -p --json-schema '{"type":"object"}' "query" |
๐ MCP & Plugins
| Flag | Description | Example |
|---|---|---|
| --mcp-config | Load MCP server definitions from a JSON file | claude --mcp-config ./mcp.json |
| --strict-mcp-config | Only use servers from --mcp-config; ignore all others | claude --strict-mcp-config --mcp-config ./mcp.json |
| --plugin-dir | Load plugins from directory for this session (flag is repeatable) | claude --plugin-dir ./plugins --plugin-dir ./more |
๐ Web, Remote & Browser
| Flag | Description | Example |
|---|---|---|
| --remote | Create a new web session on claude.ai | claude --remote |
| --remote-control | Bridge terminal session to claude.ai for browser/phone control | claude --remote-control |
| --rc | Alias for --remote-control | claude --rc |
| --teleport | Resume a web/iOS running session in your local terminal | claude --teleport |
| --chrome | Enable Claude in Chrome browser integration (claude.ai/chrome extension) | claude --chrome |
| --no-chrome | Disable Chrome integration | claude --no-chrome |
| --channels NEW | Allow MCP servers to push messages into your active session (research preview โ server must declare claude/channel capability) | claude --channels |
๐๏ธ Debugging & Logging
| Flag | Description | Example |
|---|---|---|
| --debug | Enable debug mode with optional category filter | claude --debug "api,mcp" |
| --verbose | Verbose logging โ full turn-by-turn output | claude --verbose |
| --mcp-debug | Detailed MCP server error information | claude --mcp-debug |
โ๏ธ Session & Configuration
| Flag | Description | Example |
|---|---|---|
| -n, --name | Set a display name for the session | claude -n "Feature Implementation" |
| --max-budget-usd | Spending cap for API calls (-p mode only) | claude -p --max-budget-usd 10 "query" |
| --max-turns | Limit agentic turns (-p mode only) | claude -p --max-turns 3 "query" |
| --settings | Load settings from JSON file or inline JSON string | claude --settings ./settings.json |
| --setting-sources | Comma-separated sources: user, project, local | claude --setting-sources user,project |
| --init-only | Run initialization hooks then exit without a session | claude --init-only |
๐ง Miscellaneous CLI Flags
| Flag | Description | Example |
|---|---|---|
| --betas | Beta headers for API requests (API key users only) | claude --betas interleaved-thinking |
| --disable-slash-commands | Disable all slash commands / skills for this session | claude --disable-slash-commands |
| --sandbox NEW | Launch in an isolated sandbox environment with Tab key tab-switching | claude --sandbox |
Complete Environment Variables Reference
๐ All Variables
๐ Authentication & API
| Variable | Purpose | Example Value |
|---|---|---|
| ANTHROPIC_API_KEY | Primary API key; overrides subscription login | sk-ant-xxx... |
| ANTHROPIC_AUTH_TOKEN | Custom Authorization header value (Bearer prefix auto-added) | your-token |
| ANTHROPIC_BASE_URL | Route requests via proxy or custom gateway | https://api.example.com |
| ANTHROPIC_CUSTOM_HEADERS | Newline-separated custom HTTP headers (Name: Value) | X-Custom: value |
| ANTHROPIC_FOUNDRY_API_KEY | API key for Microsoft Azure Foundry | xxx... |
| ANTHROPIC_FOUNDRY_BASE_URL | Full base URL for Azure Foundry resource | https://foundry.azure.com |
| ANTHROPIC_FOUNDRY_RESOURCE | Azure Foundry resource name | my-resource |
| ANTHROPIC_FOUNDRY_DEPLOYMENT NEW | Azure Foundry deployment name (separate from resource name) | my-deployment |
| CLAUDE_CODE_CLIENT_CERT | Path to client certificate for mTLS | /path/to/cert.pem |
| CLAUDE_CODE_CLIENT_KEY | Path to private key for mTLS | /path/to/key.pem |
| CLAUDE_CODE_CLIENT_KEY_PASSPHRASE | Passphrase for encrypted mTLS client key | your-passphrase |
| AWS_BEARER_TOKEN_BEDROCK | Bedrock API key / bearer token for authentication | xxx... |
โ๏ธ Cloud Provider Configuration
| Variable | Purpose | Value/Notes |
|---|---|---|
| CLAUDE_CODE_USE_BEDROCK | Route through AWS Bedrock | 1 or true |
| CLAUDE_CODE_USE_VERTEX | Route through Google Vertex AI | 1 or true |
| CLAUDE_CODE_USE_FOUNDRY | Route through Microsoft Azure Foundry | 1 or true |
| CLAUDE_CODE_SKIP_BEDROCK_AUTH | Skip AWS credential check (e.g., when using an LLM gateway) | 1 |
| CLAUDE_CODE_SKIP_VERTEX_AUTH | Skip Google Cloud credential check | 1 |
| CLAUDE_CODE_SKIP_FOUNDRY_AUTH | Skip Azure credential check | 1 |
| ANTHROPIC_BEDROCK_BASE_URL | Proxy URL for Bedrock requests (overrides default Bedrock endpoint) | https://your-proxy-url |
| ANTHROPIC_VERTEX_BASE_URL | Proxy URL for Vertex AI requests | https://your-proxy-url |
| CLOUD_ML_REGION | Google Cloud region for Vertex AI | us-east5 |
| ANTHROPIC_VERTEX_PROJECT_ID | Google Cloud project ID for Vertex AI | my-project-id |
| ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION | Override AWS region for Haiku model on Bedrock | us-west-2 |
| VERTEX_REGION_CLAUDE_3_5_HAIKU | Override Vertex AI region for Haiku model | us-central1 |
๐ค Model Configuration
| Variable | Purpose | Values/Examples |
|---|---|---|
| ANTHROPIC_MODEL | Override default model for all requests | claude-opus-4-6, claude-sonnet-4-6 |
| ANTHROPIC_DEFAULT_SONNET_MODEL | Full model ID the sonnet alias resolves to | claude-sonnet-4-6 |
| ANTHROPIC_DEFAULT_HAIKU_MODEL | Full model ID the haiku alias resolves to | claude-haiku-4-5-20251001 |
| ANTHROPIC_DEFAULT_OPUS_MODEL | Full model ID the opus alias resolves to | claude-opus-4-6 |
| ANTHROPIC_SMALL_FAST_MODEL | DEPRECATED Haiku-class model for background tasks โ use specific vars | Use ANTHROPIC_DEFAULT_HAIKU_MODEL |
| CLAUDE_CODE_SUBAGENT_MODEL | Model used specifically for subagents | claude-sonnet-4-6 |
| CLAUDE_CODE_EFFORT_LEVEL | Default thinking effort (Opus 4.6 and Sonnet 4.6 only). Default for Max/Team is now medium as of March 2026 | low | medium | high | max | auto |
| CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING | Disable adaptive reasoning; revert to fixed MAX_THINKING_TOKENS budget | 1 |
| MAX_THINKING_TOKENS | Override extended thinking token budget; 0 disables thinking | 10000 or 0 |
| CLAUDE_CODE_MAX_OUTPUT_TOKENS | Override max output tokens per request (Opus 4.6 default is 64K, upper bound 128K) | 4096 |
| CLAUDE_CODE_DISABLE_1M_CONTEXT | Disable 1M context window; removes 1M variants from /model picker | 1 |
| ANTHROPIC_CUSTOM_MODEL_OPTION | Adds custom entry at bottom of /model picker (skips ID validation) | my-gateway/claude-opus-4-6 |
| ANTHROPIC_CUSTOM_MODEL_OPTION_NAME | Display name for the custom model picker entry (optional) | Opus via Gateway |
| ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION | Display description for the custom model picker entry (optional) | Custom optimized model |
๐งโ๐คโ๐ง Agent Teams (Experimental)
๐งช Experimental Features
Enables parallel AI agent workflows. Disabled by default.
| Variable | Purpose | Value/Notes |
|---|---|---|
| CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS | Enable agent teams feature | 1 or true |
| CLAUDE_CODE_TEAM_NAME | Name of the agent team โ auto-set by Claude Code for teammates | my-team |
| CLAUDE_CODE_PLAN_MODE_REQUIRED | Auto-set on teammates requiring plan approval (read-only) | true (auto-managed) |
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 claude --teammate-mode in-process
๐ง Bash & Shell Behavior
| Variable | Purpose | Default / Examples |
|---|---|---|
| BASH_DEFAULT_TIMEOUT_MS | Default timeout for long-running bash commands | 30000 ms |
| BASH_MAX_TIMEOUT_MS | Max timeout the model can request for a bash command | 300000 ms |
| BASH_MAX_OUTPUT_LENGTH | Max characters in bash output before middle-truncation | 500000 |
| CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR | Return to original working dir after each Bash command | 1 |
| CLAUDE_CODE_SHELL | Override automatic shell detection | bash | zsh | sh |
| CLAUDE_CODE_SHELL_PREFIX | Command prefix wrapping all bash commands (logging / auditing) | time or strace |
| CLAUDE_ENV_FILE | Shell script sourced before each Bash command (activate virtualenv, load .env, etc.) | venv/bin/activate |
| CLAUDECODE | Auto-set to 1 inside Claude Code-spawned shells โ use to detect context in scripts | 1 (auto-set) |
๐ง Memory, Context & Compaction
| Variable | Purpose | Values / Defaults |
|---|---|---|
| CLAUDE_CODE_DISABLE_AUTO_MEMORY | Disable automatic memory creation and loading | 1 |
| CLAUDE_AUTOCOMPACT_PCT_OVERRIDE | Context fill % at which auto-compaction triggers | 95 (default) |
| CLAUDE_CODE_AUTO_COMPACT_WINDOW | Token capacity used for auto-compaction calculations | Auto-calculated |
| CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD | Also load CLAUDE.md from --add-dir directories | 1 |
| CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS | Override default token limit for file read operations | Model default |
๐ MCP (Model Context Protocol)
| Variable | Purpose | Values / Examples |
|---|---|---|
| MCP_TIMEOUT | Timeout (ms) for MCP server startup | 30000 ms |
| MCP_TOOL_TIMEOUT | Timeout (ms) for individual MCP tool call execution | 60000 ms |
| MAX_MCP_OUTPUT_TOKENS | Max tokens in MCP tool responses (warning shown above 10K by default) | 50000 |
| ENABLE_CLAUDEAI_MCP_SERVERS | Control claude.ai-managed MCP servers; set false to disable | false to disable |
| ENABLE_TOOL_SEARCH | MCP tool search mode. Auto-mode is now the default since v2.1.80; defers tools that exceed 10% of context | true | auto | auto:N | false |
| MCP_CLIENT_SECRET | OAuth 2.0 client secret for MCP server auth (stored in keychain, not config file) | your-secret |
| MCP_OAUTH_CALLBACK_PORT | Fixed port for OAuth callback URI (use when server has pre-registered redirect URIs) | 8888 |
๐ Tasks, Sessions & Scheduling
| Variable | Purpose | Values |
|---|---|---|
| CLAUDE_CODE_ENABLE_TASKS | Enable task tracking in non-interactive (-p) mode | true |
| CLAUDE_CODE_TASK_LIST_ID | Share a task list across multiple Claude Code instances | task-id-123 |
| CLAUDE_CODE_DISABLE_CRON | Disable scheduled cron jobs and /loop immediately | 1 |
| CLAUDE_CODE_DISABLE_BACKGROUND_TASKS | Disable background task execution and Ctrl+B shortcut | 1 |
| CLAUDE_CODE_EXIT_AFTER_STOP_DELAY | Auto-exit after N ms of idle in SDK/print mode | 5000 ms |
| CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS | Max time (ms) for SessionEnd hooks to complete | 1500 ms |
๐ฆ Plugins & Updates
| Variable | Purpose | Values |
|---|---|---|
| DISABLE_AUTOUPDATER | Disable automatic background updates | 1 |
| FORCE_AUTOUPDATE_PLUGINS | Force plugin auto-updates even when autoupdater is disabled | 1 |
| CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS | Timeout (ms) for git ops during plugin install/update | 120000 (default) |
| CLAUDE_CODE_PLUGIN_SEED_DIR | Read-only plugin seed directory paths for container images (: on Unix, ; on Windows) | /path/to/plugins |
๐ซ Disabling Features
| Variable | Purpose | Value |
|---|---|---|
| CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Disables autoupdater, feedback, error reporting, and telemetry โ all at once | 1 |
| DISABLE_TELEMETRY | Opt out of Statsig analytics/telemetry | 1 |
| DISABLE_ERROR_REPORTING | Opt out of Sentry crash/error reporting | 1 |
| DISABLE_FEEDBACK_COMMAND | Disable the /feedback slash command | 1 |
| DISABLE_BUG_COMMAND | Alias for DISABLE_FEEDBACK_COMMAND | 1 |
| DISABLE_COST_WARNINGS | Disable cost warning messages during sessions | 1 |
| DISABLE_INSTALLATION_CHECKS | Suppress installation health warnings at startup | 1 |
| DISABLE_PROMPT_CACHING | Disable prompt caching globally across all model tiers | 1 |
| DISABLE_PROMPT_CACHING_HAIKU | Disable prompt caching for Haiku tier only | 1 |
| DISABLE_PROMPT_CACHING_SONNET | Disable prompt caching for Sonnet tier only | 1 |
| DISABLE_PROMPT_CACHING_OPUS | Disable prompt caching for Opus tier only | 1 |
| CLAUDE_CODE_DISABLE_FAST_MODE | Disable fast mode globally | 1 |
| CLAUDE_CODE_DISABLE_TERMINAL_TITLE | Disable automatic terminal title/tab updates | 1 |
| CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS | Remove built-in git/commit instructions from system prompt | 1 |
| CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS | Strip anthropic-beta headers (for proxies that reject unknown headers) | 1 |
| CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY | Disable "How is Claude doing?" end-of-session surveys | 1 |
๐ Network & Proxy
| Variable | Purpose | Example Value |
|---|---|---|
| HTTP_PROXY | HTTP proxy server URL | http://proxy.example.com:8080 |
| HTTPS_PROXY | HTTPS proxy server URL | https://proxy.example.com:8080 |
| NO_PROXY | Comma-separated domains/IPs to bypass proxy | localhost,127.0.0.1,.internal.com |
| CLAUDE_CODE_PROXY_RESOLVES_HOSTS | Let the proxy handle DNS resolution instead of the client | 1 |
| CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS | Allow fast mode even when org status check fails due to network error | 1 |
โ๏ธ Miscellaneous / Advanced
| Variable | Purpose | Example Value |
|---|---|---|
| CLAUDE_CONFIG_DIR | Override default config/data directory (default: ~/.claude) | ~/.my-claude-config |
| CLAUDE_CODE_TMPDIR | Override internal temp directory (Claude Code appends /claude/ to the path) | /tmp/my-claude |
| CLAUDE_CODE_SIMPLE | Minimal mode: Bash + file tools only, no MCP/hooks/CLAUDE.md loading | 1 |
| CLAUDE_CODE_NEW_INIT | Enable interactive /init onboarding flow | true |
| CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION | Show/hide grayed-out prompt suggestions; set false to hide | false |
| CLAUDE_CODE_ENABLE_TELEMETRY | Enable OpenTelemetry data collection for enterprise monitoring | 1 |
| CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS | Interval (ms) for refreshing dynamic OTel authentication headers | 1740000 (29 min) |
| CLAUDE_CODE_API_KEY_HELPER_TTL_MS | Credentials refresh interval for apiKeyHelper scripts | Auto-managed |
| SLASH_COMMAND_TOOL_CHAR_BUDGET | Override character budget for slash command / skill metadata loading | 5000 |
| USE_BUILTIN_RIPGREP | Bundled ripgrep is used by default; set 0 to use system ripgrep instead | 0 to use system |
| IS_DEMO | Demo mode: hides email/org, skips onboarding | 1 |
| CLAUDE_CODE_HIDE_ACCOUNT_INFO NEW | Hide email and organization from the UI (useful for streaming/recording sessions) | 1 |
| CLAUDE_CODE_ACCOUNT_UUID | SDK callers provide account UUID synchronously at startup | UUID format |
| CLAUDE_CODE_USER_EMAIL | User email for SDK / headless mode | user@example.com |
| CLAUDE_CODE_ORGANIZATION_UUID | Organization UUID for SDK / headless mode | UUID format |
| CLAUDE_CODE_ENABLE_REMOTE_CONTROL_SERVER NEW | Enable remote control server for IDE/web session bridging | 1 |
โก Slash Commands (In-Session)
๐ฌ Interactive Mode Only
Type / anywhere in the prompt โ not just at the start โ to trigger autocomplete. Custom commands in .claude/commands/ appear namespaced by subdirectory (e.g. /frontend:component).
/help
Show all commands including custom skills and MCP server commands
/clear
Clear conversation history and free context. Aliases: /reset, /new
/exit
Exit Claude Code. Alias: /quit
/rename [name]
Rename the current session title
/status
Show version, model, account, and connectivity status
/release-notes
View the latest release notes at any time
/model [model]
Select or change AI model. Use arrow keys to adjust effort when a supported model is active
/effort [level]
Set effort: low | medium | high | max | auto. Shows what auto currently resolves to
/fast [on|off]
Toggle fast mode (speed-optimized Opus 4.6). Note: prior context is re-billed at fast rates when toggled mid-session
/context
Visualize context usage with optimization suggestions. Skills shown as a separate category
/compact [focus]
Compact conversation, optionally retaining focus (e.g., /compact retain the error handling patterns). Use when context > ~80%
/memory
Edit CLAUDE.md, manage auto-memory, view and edit all imported memory files
/init
Initialize project with an interactive CLAUDE.md guide
/add-dir <path>
Add a new working directory to the current session
/config
Open the tabbed Settings interface. Alias: /settings
/permissions
View/update tool permissions. Press / inside to filter. Alias: /allowed-tools
/keybindings
Create or edit ~/.claude/keybindings.json. Changes take effect immediately
/vim
Enable Vim key bindings for prompt input (also configurable in /config)
/plan [description]
Enter plan mode. Pass a description to start immediately (e.g., /plan fix the auth bug)
/output-style [style]
Set output style. Built-ins: Explanatory, Learning. Custom styles in .claude/output-styles/
/loop [interval] [prompt]
Run a prompt or command on a recurring interval (e.g., /loop 5m check deploy status)
/branch [name]
Fork the current conversation to explore a different path. Alias: /fork
/export [filename]
Export the full conversation as plain text
/copy [N]
Copy last assistant response to clipboard. Press w to write to file instead (useful over SSH)
/btw <question>
Ask a side question without adding it to the main conversation context
/diff
Open the interactive diff viewer for uncommitted changes
/mcp
Manage MCP server connections and OAuth authentication
/plugin
Install, update, and remove Claude Code plugins
/doctor
Diagnose Claude Code installation; validates permission rule syntax and suggests fixes
/debug
Ask Claude to help troubleshoot the current session directly
/stats
Visualize daily usage, session history, and model preferences
/login
Sign in to your Anthropic account (subscription or API Console)
/logout
Sign out from your current account
/feedback
Submit feedback about Claude Code. Alias: /bug
/tasks
List and manage foreground and background tasks. Alias: /bashes
/hooks
View hook configurations for PreToolUse, PostToolUse, and Stop events
/ide
Manage VS Code / JetBrains integrations and show connection status
/color [color]
Set prompt bar color: red, blue, green, yellow, purple, orange, pink, cyan, default
/theme
Open theme selector to change Claude Code's terminal color theme
/remote-control NEW
Bridge terminal session to claude.ai/code โ control from any browser or phone
/teleport NEW
Pull a running web/iOS session into your local terminal
/remote-env NEW
Configure environment for remote sessions (claude.ai subscribers)
/desktop NEW
Hand off terminal session to the Desktop app for visual diff review
/sandbox NEW
Launch isolated sandbox environment. Tab / arrow keys switch between tabs
/voice NEW
Toggle voice mode on or off
/terminal NEW
Open an integrated terminal pane within the session
๐ฏ Quick Reference Matrix
๐ Common Patterns
| Task | Command / Flag / Variable |
|---|---|
| Start interactive session | claude |
| Continue previous conversation | claude -c or claude --continue |
| Quick non-interactive query | claude -p "query" |
| Change model to Opus | claude --model claude-opus-4-6 |
| Set effort level | claude --effort high or CLAUDE_CODE_EFFORT_LEVEL=high |
| Enable experimental agent teams | CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 |
| Use AWS Bedrock | CLAUDE_CODE_USE_BEDROCK=1 + AWS_REGION=us-east-1 |
| Use Google Vertex AI | CLAUDE_CODE_USE_VERTEX=1 + CLOUD_ML_REGION=us-east5 + ANTHROPIC_VERTEX_PROJECT_ID=my-proj |
| Skip permission prompts (devcontainer only) | claude --dangerously-skip-permissions |
| Enter plan mode at launch | claude --permission-mode plan |
| Add multiple directories | claude --add-dir ../apps ../lib |
| Append to system prompt | claude --append-system-prompt "Always use TypeScript" |
| JSON output in -p mode | claude -p --output-format json "query" |
| Restrict tools to safe set | claude --tools "Bash,Read,Grep,Edit" |
| Disable all non-essential traffic | CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 |
| Load MCP servers | claude --mcp-config ./mcp.json |
| Enable MCP push channels | claude --channels |
| Corporate HTTPS proxy | HTTPS_PROXY=http://proxy:8080 claude |
| Custom shell | CLAUDE_CODE_SHELL=zsh claude |
| Auto-activate virtualenv | CLAUDE_ENV_FILE=.venv/bin/activate claude |
| Fork session for parallel work | claude --fork-session |
| Isolated git worktree | claude --worktree |
| Disable extended thinking | MAX_THINKING_TOKENS=0 |
| Disable 1M context window | CLAUDE_CODE_DISABLE_1M_CONTEXT=1 |
| Bridge session to browser/phone | claude --remote-control or in-session /remote-control |
| Pull web session to terminal | In-session: /teleport |
| Launch sandbox environment | claude --sandbox |
| Run recurring check every 5 min | In-session: /loop 5m check deploy status |
| Hide account info from UI | CLAUDE_CODE_HIDE_ACCOUNT_INFO=1 |
| Use system ripgrep | USE_BUILTIN_RIPGREP=0 |
| Debug MCP issues | claude --mcp-debug --verbose |
๐ฅ Installation & Setup
๐ Getting Started
npm install -g @anthropic-ai/claude-code is no longer the recommended method. Use native installers below. Native installs auto-update in the background.
macOS & Linux โ Install Script (Recommended)
macOS โ Homebrew
Windows โ WinGet (Recommended for Windows)
Windows โ PowerShell Script
Authentication
Update
npm โ Legacy / CI Fallback
๐ก Tips & Best Practices
โจ Pro Tips
env in ~/.claude/settings.json for team-wide rollout.--dangerously-skip-permissions bypasses all safety checks. Use only in a devcontainer with a firewall configured โ never on your main machine.--max-budget-usd to cap spending in -p mode.medium in March 2026.--channels for MCP push messages, --sandbox for isolation, /remote-control + /teleport + /desktop for cross-surface workflows, /loop for recurring tasks, /voice / /terminal, MCP tool-search auto mode on by default, CLAUDE_CODE_HIDE_ACCOUNT_INFO, npm install deprecated.