Claude Code Guide

_For reference and contributions, visit the [official Claude Code documentation](https://code.claude.com/docs/en/overview)_ ![Claude Code](https://img.shields.io/npm/v/@anthropic-ai/claude-code?label=Claude%20Code&logo=anthropic) [![Status](https://img.shields.io/badge/Status-Active-brightgreen)](https://github.com/anthropics/claude-code) [![License](https://img.shields.io/badge/License-Anthropic-orange)](https://claude.ai/code)
| Section | Status | Other Resources | | ------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------- | | Getting Started | ✅ | **Claude-Code** [Docs](https://code.claude.com/docs/en/overview) | | Configuration & Environment Variables | ✅ | **Claude-Code via** [**Discord**](https://github.com/zebbern/claude-code-discord) | | Commands & Usage | ✅ | Security Agents [SKILL.md](https://github.com/zebbern/claude-code-guide/tree/main/skills) | | Interface & Input | ✅ | Let Agent Create [SKILL.md](https://github.com/zebbern/agent-skills-authoring) | | Advanced Features | ✅ | 954+ Agent [Skills](https://github.com/zebbern/antigravity-awesome-skills) | | Automation & Integration | ✅ | No cost ai [resources](https://github.com/zebbern/no-cost-ai) | | Help & Troubleshooting | ✅ | 250+ Mermaid [templates](https://github.com/zebbern/mermaid-templates) | | Third-Party Integrations | ✅ | Discord Communication [MCP](https://github.com/zebbern/discord-mcp-agent) |
---

Contents

**Fast paths:** [Install](#quick-start) · [Commands](#claude-commands) · [Config](#configuration--environment) · [MCP](#mcp-integration) · [Agents](#sub-agents) · [Troubleshoot](#help--troubleshooting) | Area | Start here | Also useful | | --- | --- | --- | | [Getting Started](#getting-started) | [Quick Start](#quick-start) | [Initial Setup](#initial-setup), [System Requirements](#system-requirements) | | [Configuration](#configuration--environment) | [Environment Variables](#environment-variables) | [Configuration Files](#configuration-files) | | [Commands](#commands--usage) | [Slash Commands](#claude-commands) | [CLI Quick Reference](#cheat-sheet) | | [Interface](#interface--input) | [Keyboard Shortcuts](#keyboard-shortcuts) | [Vim Mode](#vim-mode) | | [Advanced Features](#advanced-features) | [Plan Mode](#plan-mode), [Auto Mode](#auto-mode), [MCP](#mcp-integration) | [Sub Agents](#sub-agents), [Skills](#skills), [Hooks](#hooks-system) | | [Security](#security--permissions) | [Security & Permissions](#security--permissions) | [Dangerous Mode](#dangerous-mode), [Best Practices](#security-best-practices-main) | | [Automation](#automation--integration) | [Automation & Scripting](#automation--scripting-with-claude-code) | [PR Review](#auto-pr-review-inline-comments), [Issue Triage](#issue-triage-suggest-labels--severity) | | [Help](#help--troubleshooting) | [Troubleshooting](#help--troubleshooting) | [Best Practices](#best-practices), [Monitoring](#monitoring--alerting) | | [Third-Party Integrations](#third-party-integrations) | [DeepSeek Integration](#deepseek-integration) | [Provider Setup Examples](#provider-setup-examples) |
Full content map - **[Getting Started](#getting-started)** - [Quick Start](#quick-start) - [System Requirements](#system-requirements) - [Initial Setup](#initial-setup) - **[Configuration & Environment](#configuration--environment)** - [Environment Variables](#environment-variables) - [Configuration Files](#configuration-files) - **[Commands & Usage](#commands--usage)** - [Slash Command Reference](#claude-commands) - [CLI Quick Reference](#cheat-sheet) - **[Interface & Input](#interface--input)** - [Keyboard Shortcuts](#keyboard-shortcuts) - [Vim Mode](#vim-mode) - **[Advanced Features](#advanced-features)** - [Thinking Mode](#thinking-keywords) - [Effort Levels](#effort-levels) - [Fast Mode](#fast-mode) - [Auto Mode](#auto-mode) - [Plan Mode](#plan-mode) - [Background Tasks](#background-tasks) - [Workflows & Scheduling](#workflows--scheduling) - [Remote Sessions](#remote-sessions) - [Claude in Chrome](#claude-in-chrome) - [Sandbox Mode](#sandbox-mode) - [LSP Tool](#lsp-tool) - [Sub Agents](#sub-agents) - [Agent Teams](#agent-teams) - [Skills](#skills) - [Plugin System](#plugin-system) - [Worktree Isolation](#worktree-isolation) - [Native Installer](#native-installer) - [Authentication CLI](#claude-auth) - [Agent Management CLI](#claude-agents-cli) - [Remote Control](#remote-control) - [Managed Settings](#managed-settings) - [Model Updates](#model-updates) - [Theming & Customization](#theming--customization) - [Code Review](#code-review) - [Insights](#insights) - [MCP Integration](#mcp-integration) - [Hooks System](#hooks-system) - **[Security & Permissions](#security--permissions)** - [Dangerous Mode](#dangerous-mode) - [Security Best Practices](#security-best-practices-main) - **[Automation & Integration](#automation--integration)** - [Automation & Scripting](#automation--scripting-with-claude-code) - [Auto PR Review](#auto-pr-review-inline-comments) - [Issue Triage](#issue-triage-suggest-labels--severity) - **[Help & Troubleshooting](#help--troubleshooting)** - [Installation Issues](#installation--nodejs-issues) - [MCP Issues](#mcp-model-context-protocol-issues) - [Best Practices](#best-practices) - [Monitoring & Alerting](#monitoring--alerting) - **[Third-Party Integrations](#third-party-integrations)** - [Provider Setup Examples](#provider-setup-examples) - [DeepSeek Integration](#deepseek-integration)
---

Getting Started

**Enable sound alerts when claude completes the task:** > claude config set --global preferredNotifChannel terminal_bell

Quick Start

> [!TIP] > **Send claude or npx claude in terminal to start the interface** > > **Go to [Help & Troubleshooting](#help--troubleshooting) to fix issues...** ```C # Native Installer (preferred — no Node.js required) ⭐️ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # Windows /* Via CMD (native) */ curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd /* Via Powershell */ irm https://claude.ai/install.ps1 | iex -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # macOS / Linux / WSL /* Via Terminal */ curl -fsSL https://claude.ai/install.sh | bash -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # Arch /* Via Terminal */ yay -S claude-code*/ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # Alternative (npm) — useful when your environment already standardizes on Node.js # Requires Node.js 18+ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # Windows /* Via CMD (npm) */ npm install -g @anthropic-ai/claude-code -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # macOS /* Via Terminal */ brew install node && npm install -g @anthropic-ai/claude-code -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # Linux /* Via Terminal */ sudo apt update && sudo apt install -y nodejs npm /* Via Terminal */ npm install -g @anthropic-ai/claude-code -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # WSL/GIT /* Via Terminal */ npm install -g @anthropic-ai/claude-code -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # Docker /* Windows (CMD) */ docker run -it --rm -v "%cd%:/workspace" -e ANTHROPIC_API_KEY="sk-your-key" node:20-slim bash -lc "npm i -g @anthropic-ai/claude-code && cd /workspace && claude" /* macOS/Linux (bash/zsh)*/ docker run -it --rm -v "$PWD:/workspace" -e ANTHROPIC_API_KEY="sk-your-key" node:20-slim bash -lc 'npm i -g @anthropic-ai/claude-code && cd /workspace && claude' /* No bash Fallback */ docker run -it --rm -v "$PWD:/workspace" -e ANTHROPIC_API_KEY="sk-your-key" node:20-slim sh -lc 'npm i -g @anthropic-ai/claude-code && cd /workspace && claude' --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # Check if claude is installed correctly /* Linux */ which claude /* Windows */ where claude /* Universal */ claude --version -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # Common Management /*claude config */ Configure settings /*claude mcp list */ Setup MCP servers, you can also replace "list" with add/remove /*claude agents */ Open the agent/session dashboard /*claude update */ Run a manual update check ``` --- > [!Tip] > **Open Project Via Terminal Into VS Code / Cursor** > > ### $ - cd /path/to/project > > ### $ - code . > > **Make sure you have the (Claude Code extension) installed in your VS Code / Cursor** ---

System Requirements

> - OS: macOS 10.15+, Ubuntu 20.04+/Debian 10+, or Windows 10/11 or WSL > - Hardware: 4GB RAM minimum 8GB+ recommended > - Software: Git 2.23+ is optional for PR/worktree workflows. Node.js 18+ is only required for npm-based installation; the native installer bundles its own runtime. > - Internet: Connection for API calls ---

Initial Setup

> [!Tip] > **Find API key from [Anthropic Console](https://console.anthropic.com)** > > **Do NOT commit real keys use git-ignored files, OS key stores, or secret managers** ```C # Universal /* Authenticate via Anthropic account */ claude auth login /* Authenticate via Console/API billing */ claude auth login --console /* Switch accounts inside Claude */ /login ---------------------------------------------------------------------------------------------------------------------------------- # Windows /* Set-api-key */ set ANTHROPIC_API_KEY=sk-your-key-here-here /* cmd-masked-check */ echo OK: %ANTHROPIC_API_KEY:~0,8%*** /* Set-persistent-key */ setx ANTHROPIC_API_KEY "sk-your-key-here-here" /* cmd-unset-key */ set ANTHROPIC_API_KEY= ---------------------------------------------------------------------------------------------------------------------------------- # Linux /* Set-api-key */ export ANTHROPIC_API_KEY="sk-your-key-here-here" /* masked-check */ echo "OK: ${ANTHROPIC_API_KEY:0:8}***" /* remove-session */ unset ANTHROPIC_API_KEY ---------------------------------------------------------------------------------------------------------------------------------- # Powershell /* ps-session */ $env:ANTHROPIC_API_KEY = "sk-your-key-here-here" /* ps-masked-check */ "OK: $($env:ANTHROPIC_API_KEY.Substring(0,8))***" /* ps-persist */ [Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY","sk-your-key-here-here","User") /* ps-rotate */ $env:ANTHROPIC_API_KEY = "sk-new-key" /* ps-remove */ Remove-Item Env:\ANTHROPIC_API_KEY ---------------------------------------------------------------------------------------------------------------------------------- # Other... # persist-bash/* */ echo 'export ANTHROPIC_API_KEY="sk-your-key-here-here"' >> ~/.bashrc && source ~/.bashrc # persist-zsh /* */ echo 'export ANTHROPIC_API_KEY="sk-your-key-here-here"' >> ~/.zshrc && source ~/.zshrc # persist-fish/* */ fish -lc 'set -Ux ANTHROPIC_API_KEY sk-your-key-here-here' ---------------------------------------------------------------------------------------------------------------------------------- ``` ---

Configuration & Environment

Environment Variables

> **You can also set any of these in settings.json under the "env" key for automatic application.** > [!Important] > **Windows Users replace export with set or setx for perm** ```bash # Environment toggles (put in ~/.bashrc or ~/.zshrc) export ANTHROPIC_API_KEY="sk-your-key-here-here" # API key sent as X-Api-Key header (interactive usage: /login) export ANTHROPIC_AUTH_TOKEN="my-auth-token" # Custom Authorization header; Claude adds "Bearer " prefix automatically export ANTHROPIC_CUSTOM_HEADERS="X-Trace-Id: 12345" # Extra request headers (format: "Name: Value") export ANTHROPIC_MODEL="sonnet" # Custom model name or alias to use export ANTHROPIC_DEFAULT_SONNET_MODEL="sonnet" # Default Sonnet alias or pinned Sonnet model ID export ANTHROPIC_DEFAULT_OPUS_MODEL="opus" # Default Opus alias or pinned Opus model ID export ANTHROPIC_SMALL_FAST_MODEL="haiku-model" # Haiku-class model for background tasks (placeholder) export ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION="REGION" # Override AWS region for the small/fast model on Bedrock (placeholder) export AWS_BEARER_TOKEN_BEDROCK="bedrock_..." # Amazon Bedrock API key/token for authentication export BASH_DEFAULT_TIMEOUT_MS=60000 # Default timeout (ms) for long-running bash commands export BASH_MAX_TIMEOUT_MS=300000 # Maximum timeout (ms) allowed for long-running bash commands export BASH_MAX_OUTPUT_LENGTH=20000 # Max characters in bash outputs before middle-truncation export CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1 # (0 or 1) return to original project dir after each Bash command export CLAUDE_BASH_NO_LOGIN=1 # Force BashTool to skip login shell startup files export CLAUDE_CODE_API_KEY_HELPER_TTL_MS=600000 # Interval (ms) to refresh creds when using apiKeyHelper export CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL=1 # (0 or 1) skip auto-installation of IDE extensions export CLAUDE_CODE_MAX_OUTPUT_TOKENS=4096 # Max number of output tokens for most requests export CLAUDE_CODE_USE_BEDROCK=1 # (0 or 1) use Amazon Bedrock export CLAUDE_CODE_USE_VERTEX=0 # (0 or 1) use Google Vertex AI export CLAUDE_CODE_SKIP_BEDROCK_AUTH=0 # (0 or 1) skip AWS auth for Bedrock (e.g., via LLM gateway) export CLAUDE_CODE_SKIP_VERTEX_AUTH=0 # (0 or 1) skip Google auth for Vertex (e.g., via LLM gateway) export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=0 # (0 or 1) disable nonessential traffic (equivalent to DISABLE_* below) export CLAUDE_CODE_DISABLE_TERMINAL_TITLE=0 # (0 or 1) disable automatic terminal title updates export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 # (0 or 1) enable agent teams research preview export CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 # (0 or 1) load CLAUDE.md from --add-dir paths export CLAUDE_CODE_ENABLE_TASKS=false # Set to "false" to disable the task system export DISABLE_AUTOUPDATER=0 # (0 or 1) disable automatic updates (overrides autoUpdates setting) export DISABLE_BUG_COMMAND=0 # (0 or 1) disable the /bug command export DISABLE_COST_WARNINGS=0 # (0 or 1) disable cost warning messages export DISABLE_ERROR_REPORTING=0 # (0 or 1) opt out of Sentry error reporting export DISABLE_NON_ESSENTIAL_MODEL_CALLS=0 # (0 or 1) disable model calls for non-critical paths export DISABLE_TELEMETRY=0 # (0 or 1) opt out of Statsig telemetry export HTTP_PROXY="http://proxy:8080" # HTTP proxy server URL export HTTPS_PROXY="https://proxy:8443" # HTTPS proxy server URL export MAX_THINKING_TOKENS=0 # (0 or 1 to turn off/on) force a thinking budget for the model export MCP_TIMEOUT=120000 # MCP server startup timeout (ms) export MCP_TOOL_TIMEOUT=60000 # MCP tool execution timeout (ms) export MAX_MCP_OUTPUT_TOKENS=25000 # Max tokens allowed in MCP tool responses (default 25000) export USE_BUILTIN_RIPGREP=0 # (0 or 1) set 0 to use system-installed rg instead of bundled one # Vertex AI region overrides follow VERTEX_REGION_CLAUDE_. export VERTEX_REGION_CLAUDE_3_5_HAIKU="REGION" # 3.x family example export VERTEX_REGION_CLAUDE_4_6_SONNET="REGION" # Sonnet family example export VERTEX_REGION_CLAUDE_4_8_OPUS="REGION" # Opus family example # -- Session and runtime controls --------------------------------------------- export CLAUDE_CODE_SIMPLE=1 # Minimal mode: disables MCP tools, attachments, hooks, CLAUDE.md, and skills export CLAUDE_CODE_DISABLE_1M_CONTEXT=1 # Disable 1 M-token context window (use default shorter context) export CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 # Disable background tasks entirely export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 # Opt out of experimental beta features export CLAUDE_CODE_AUTO_CONNECT_IDE=false # Disable automatic IDE connection on startup export CLAUDE_CODE_TMPDIR="/custom/tmp" # Override the temp directory Claude Code uses export CLAUDE_CODE_SHELL="/bin/zsh" # Override shell detection (force a specific shell) export CLAUDE_CODE_SHELL_PREFIX="command-wrapper" # Prefix/wrap every shell command Claude runs export CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS=50000 # Override max output tokens for the Read tool export CLAUDE_CODE_PROXY_RESOLVES_HOSTS=true # Let the HTTP/HTTPS proxy handle DNS resolution export CLAUDE_CODE_EXIT_AFTER_STOP_DELAY=30000 # Auto-exit SDK mode after idle for N ms export CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS=30000 # Timeout (ms) for plugin git operations export CLAUDE_CODE_ACCOUNT_UUID="uuid" # Override account UUID (SDK / automation flows) export CLAUDE_CODE_USER_EMAIL="user@example.com" # Override user email (SDK / automation flows) export CLAUDE_CODE_ORGANIZATION_UUID="uuid" # Override organization UUID (SDK / automation flows) export ENABLE_CLAUDEAI_MCP_SERVERS=false # Opt out from claude.ai-synced MCP servers export FORCE_AUTOUPDATE_PLUGINS=1 # Allow plugin auto-update even when main updater is disabled export IS_DEMO=1 # Demo mode — hides email/org from the UI export NO_PROXY="localhost,127.0.0.1" # Bypass proxy for specified hosts (comma-separated) # -- Provider, terminal, and telemetry controls -------------------------------- export CLAUDE_CODE_ENABLE_AUTO_MODE=1 # Enable auto mode on Bedrock, Vertex, and Foundry for Opus 4.7/4.8 export CLAUDE_CODE_USE_POWERSHELL_TOOL=1 # Enable PowerShell tool where available; Windows provider sessions may default to it export CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY=1 # Opt out of PowerShell -ExecutionPolicy Bypass behavior export CLAUDE_CODE_NO_FLICKER=1 # Prefer flicker-free alternate-screen rendering where supported export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 # Let compatible gateways populate the model picker from /v1/models export CLAUDE_CODE_FORCE_SYNC_OUTPUT=1 # Force synchronized terminal output when auto-detection misses support export CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1 # Let package-manager installs run background upgrades where supported export ENABLE_PROMPT_CACHING_1H=true # Opt in to 1-hour prompt cache TTL when your provider supports it export OTEL_LOG_TOOL_DETAILS=1 # Include tool parameters in tool_decision telemetry events export OTEL_METRICS_INCLUDE_ENTRYPOINT=true # Include session entrypoint on OpenTelemetry metrics ```

Global Config Options

```bash claude config set -g theme dark # Theme: dark | light | light-daltonized | dark-daltonized claude config set -g preferredNotifChannel iterm2_with_bell # Notification channel: iterm2 | iterm2_with_bell | terminal_bell | notifications_disabled claude config set -g autoUpdates true # Auto-download & install updates (applied on restart) claude config set -g verbose true # Show full bash/command outputs claude config set -g attribution false # Omit "co-authored-by Claude" in git commits/PRs claude config set -g forceLoginMethod claudeai # Restrict login flow: claudeai | console claude config set -g model "sonnet" # Default model override; use a full model ID only when pinning claude config set -g statusLine '{"type":"command","command":"~/.claude/statusline.sh"}' # Custom status line claude config set -g enableAllProjectMcpServers true # Auto-approve all MCP servers from .mcp.json claude config set -g enabledMcpjsonServers '["memory","github"]' # Approve specific MCP servers claude config set -g disabledMcpjsonServers '["filesystem"]' # Reject specific MCP servers ```

Configuration Files

**(Memory type) Claude Code offers four memory locations in a hierarchical structure, each serving a different purpose:** | Memory Type | Location | Purpose | Use Case Examples | Shared With | | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------- | | **Enterprise policy** | macOS: `/Library/Application Support/ClaudeCode/CLAUDE.md`
Linux: `/etc/claude-code/CLAUDE.md`
Windows: `C:\ProgramData\ClaudeCode\CLAUDE.md` | Organization-wide instructions managed by IT/DevOps | Company coding standards, security policies, compliance requirements | All users in organization | | **Project memory** | `./CLAUDE.md` | Team-shared instructions for the project | Project architecture, coding standards, common workflows | Team members via source control | | **User memory** | `~/.claude/CLAUDE.md` | Personal preferences for all projects | Code styling preferences, personal tooling shortcuts | Just you (all projects) | | **Project memory (local)** | `./CLAUDE.local.md` | Personal project-specific preferences (git-ignored) | Your sandbox URLs, preferred test data, personal overrides | Just you (current project) | | **Project rules** | `.claude/rules/*.md` | Modular project rules (loaded alongside CLAUDE.md) | Linting rules, API conventions, per-directory standards | Team members via source control | > All memory files are automatically loaded into Claude Code's context when launched. Files higher in the hierarchy take precedence and are loaded first, providing a foundation that more specific memories build upon. #### `.claude/rules/` Directory The `.claude/rules/` directory lets you break project instructions into separate Markdown files instead of one large `CLAUDE.md`. Every `*.md` file inside is automatically loaded into context alongside `CLAUDE.md`. This is useful for: - **Modular organization**: Separate concerns (e.g., `api-conventions.md`, `testing-rules.md`) - **Per-directory overrides**: Nested `rules/` directories can apply scoped rules - **Team collaboration**: Different team members can own different rule files via PR review #### Auto-Memory Claude can save useful working context during your sessions, such as project conventions, tooling preferences, and architectural decisions it observes while helping you. Use `/memory` to inspect, edit, or remove saved memories. Auto-memory is most useful for context you would otherwise repeat across sessions: - Preferred build, test, and lint commands - Local conventions that are not obvious from code alone - Architecture decisions that influence future edits - Team preferences that should shape how Claude proposes changes Keep durable team rules in `CLAUDE.md` or `.claude/rules/`. Treat auto-memory as helpful working context, not as the only source of truth. ---

Commands & Usage

Slash Command Reference

| Command | Purpose | | :------------------------ | :------------------------------------------------------------------------------------------------------- | | `/add-dir` | Add additional working directories | | `/agents` | Manage custom AI subagents for specialized tasks | | `/branch` | Branch or fork the current conversation into a separate session | | `/bug` | Report bugs (sends conversation to Anthropic) | | `/clear` | Clear conversation history | | `/compact [instructions]` | Compact conversation with optional focus instructions | | `/config` | Open the Settings interface (Config tab) | | `/context` | Visualize current context usage as a colored grid | | `/copy` | Copy conversation content to clipboard | | `/code-review [effort]` | Run correctness-focused code review; use `--fix` to apply findings or `--comment` for PR comments | | `/color` | Set or randomize the current session accent color | | `/debug` | Troubleshoot current session and diagnose issues | | `/doctor` | Checks the health of your Claude Code installation | | `/effort` | Pick reasoning effort for the current model/session | | `/exit` | Exit the REPL | | `/export [filename]` | Export the current conversation to a file or clipboard | | `/fast` | Toggle fast mode for accelerated Opus responses where available | | `/goal` | Set a completion condition so Claude keeps working across turns until it is met | | `/help` | Get usage help | | `/init` | Initialize project with CLAUDE.md guide | | `/insights` | Generate an interactive HTML report analyzing your coding habits | | `/keybindings` | Configure custom keyboard shortcuts | | `/login` | Switch Anthropic accounts | | `/loop` | Schedule a recurring prompt or slash command | | `/logout` | Sign out from your Anthropic account | | `/mcp` | Manage MCP server connections and OAuth authentication | | `/memory` | Edit CLAUDE.md memory files | | `/model` | Select or change the AI model | | `/permissions` | View or update tool permissions | | `/plan` | Enter plan mode directly from the prompt | | `/plugins` | Manage plugins (install, enable, disable, marketplace) | | `/pr_comments` | View pull request comments | | `/release-notes` | Open the built-in release notes view | | `/rename ` | Rename the current session for easier identification | | `/resume [session]` | Resume a conversation by ID or name, or open session picker | | `/rules` | View and manage `.claude/rules/` directory (modular project rules) | | `/rewind` | Rewind the conversation and/or code to a previous point | | `/sandbox` | View sandbox dependency status with installation instructions | | `/scroll-speed` | Tune mouse wheel scroll speed with a live preview | | `/settings` | Open Settings interface (alias for `/config`) | | `/simplify` | Run cleanup-only review for reuse, simplification, efficiency, and altitude | | `/status` | Open Settings interface (Status tab) showing version, model, account | | `/statusline` | Set up Claude Code's status line UI | | `/tasks` | List and manage background tasks | | `/teleport` | Resume a remote session from claude.ai (subscribers only) | | `/terminal-setup` | Install Shift+Enter key binding for newlines (iTerm2, VS Code, Kitty, Alacritty, Zed, Warp, and WezTerm) | | `/remote-env` | Configure remote environment settings | | `/theme` | Change the color theme | | `/todos` | List current TODO items | | `/ultrareview [target]` | Run comprehensive cloud code review with parallel multi-agent analysis | | `/usage` | Show plan usage limits and rate limit status (subscription plans) | | `/usage-credits` | Enable or inspect usage credits for higher-throughput modes | | `/workflows` | View dynamic workflow runs and background orchestration status | | `/batch` | Run batch operations on multiple files (bundled skill) |

Command Line Flags

| Flag / Command | Description | Example | | :--------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | | `-d, --debug` | Enable debug mode (shows detailed debug output). | `claude -d -p "query"` | | `--include-partial-messages` | partial message streaming support via CLI flag | `claude -p "query" --include-partial-messages` | | `--verbose` | Override verbose mode setting from config (shows expanded logging / turn-by-turn output). | `claude --verbose` | | `-p, --print` | Print response and exit (useful for piping output). | `claude -p "query"` | | `--output-format ` | Output format (only works with `--print`): `text` (default), `json` (single result), or `stream-json` (realtime streaming). | `claude -p "query" --output-format json` | | `--input-format ` | Input format (only works with `--print`): `text` (default) or `stream-json` (realtime streaming input). | `claude -p --output-format stream-json --input-format stream-json` | | `--replay-user-messages` | Re-emit user messages from stdin back to stdout for acknowledgment — **only works with** `--input-format=stream-json` **and** `--output-format=stream-json`. | `claude --input-format stream-json --output-format stream-json --replay-user-messages` | | `--allowedTools`, `--allowed-tools ` | Comma/space-separated list of tool names to allow (e.g. `"Bash(git:*) Edit"`). | `--allowed-tools "Bash(git:*)" Edit"` | | `--disallowedTools`, `--disallowed-tools ` | Comma/space-separated list of tool names to deny (e.g. `"Bash(git:*) Edit"`). | `--disallowed-tools "Edit"` | | `--mcp-config ` | Load MCP servers from JSON files or strings (space-separated). | `claude --mcp-config ./mcp-servers.json` | | `--strict-mcp-config` | Only use MCP servers from `--mcp-config`, ignoring other MCP configurations. | `claude --mcp-config ./a.json --strict-mcp-config` | | `--append-system-prompt ` | Append a system prompt to the default system prompt (useful in print mode). | `claude -p --append-system-prompt "Do X then Y"` | | `--permission-mode ` | Permission mode for the session (choices include `acceptEdits`, `auto`, `bypassPermissions`, `default`, `plan`). | `claude --permission-mode plan` | | `--permission-prompt-tool ` | Specify an MCP tool to handle permission prompts in non-interactive mode. | `claude -p --permission-prompt-tool mcp_auth_tool "query"` | | `--fallback-model ` | Enable automatic fallback to a specified model when the default is overloaded (note: only works with `--print` per help). | `claude -p --fallback-model claude-haiku-20240307 "query"` | | `--model ` | Model for the current session. Accepts aliases like `sonnet`/`opus` or a full model ID when pinning. | `claude --model sonnet` | | `--settings ` | Load additional settings from a JSON file or a JSON string. | `claude --settings ./settings.json` | | `--add-dir ` | Additional directories to allow tool access to. | `claude --add-dir ../apps ../lib` | | `--ide` | Automatically connect to an IDE on startup if exactly one valid IDE is available. | `claude --ide` | | `-c, --continue` | Continue the most recent conversation in the current directory. | `claude --continue` | | `-r, --resume [sessionId]` | Resume a conversation; provide a session ID or interactively select one. | `claude -r "abc123"` | | `--session-id ` | Use a specific session ID for the conversation (must be a valid UUID). | `claude --session-id 123e4567-e89b-12d3-a456-426614174000` | | `--agents ` | Define custom subagents dynamically via JSON (see subagent docs for format). | `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"..."}}'` | | `--agent ` | Specify a specific agent for the current session. | `claude --agent my-custom-agent` | | `--bg` | Start or continue work as a background session that can be viewed from `claude agents`. | `claude --bg "fix failing tests"` | | `--bg --exec ` | Run a shell command as an attachable background session. | `claude --bg --exec "npm test"` | | `--name