You're sitting at the terminal, have Claude Code installed, and you're thinking: "Okay, now what?"
I know that feeling well. When I first typed claude five months ago, the tool felt like a black hole. Hundreds of commands, cryptic slash commands, and no idea where to start.
Today I'll show you all Claude Code commands: a complete overview with all slash commands, all CLI flags, and hidden keyboard shortcuts. This is the most comprehensive reference you'll find. After this guide, you'll really know every available command.
- Over 60 commands available: 50+ built-in slash commands (including /voice, /effort, /diff, /color) plus 5 bundled skills (/batch, /simplify, /loop, /debug, /claude-api)
- Key shortcuts: Option+T / Alt+T for Extended Thinking, Option+P / Alt+P for model picker, Ctrl+G for external editor, Shift+Tab for permission modes
- CLI flags and environment variables enable advanced usage, e.g., --effort (low/medium/high/max), --worktree for isolated git worktrees, --remote-control for control via claude.ai
Installing and Starting Claude Code
# Installation (one-time)
npm install -g @anthropic-ai/claude-code
# Start Claude Code
claude # Interactive mode
claude "Fix the bug in auth" # With initial prompt
claude -p "Analyze this code" # One-time query without session
claude -c # Continue last sessionSlash Commands (Built-in)
These commands are your daily tools when working with Claude Code. Type / followed by any letters to filter. Not all commands are visible to every user, some depend on platform, plan, or environment.
Command | Parameter | Since | Description |
|---|---|---|---|
/add-dir | <path> | 2.0.11 | Add additional working directories to the current session |
/agents | 1.0.58 | Manage subagent configurations and agent teams | |
/btw | <question> | 2.0.0 | Ask a side question without adding to conversation. Works while Claude is processing |
/chrome | 2.0.72 | Configure Claude in Chrome settings | |
/clear | 0.2.9 | Clear conversation history and start fresh (aliases: /reset, /new) | |
/color | [color | default] | 2.1.70 | Set prompt bar color for session (red, blue, green, yellow, purple, orange, pink, cyan). default to reset |
/compact | [instructions] | 0.2.47 | Compress conversation with optional focus instructions |
/config | 0.2.34 | Open settings interface for theme, model, and output style (alias: /settings) | |
/context | 2.1.14 | Visualize context usage as a color grid with optimization suggestions | |
/copy | 0.2.9 | Copy last response to clipboard. With code blocks, shows interactive picker for individual blocks or full response | |
/cost | 1.0.85 | Show detailed token usage and cost statistics | |
/desktop | 2.0.51 | Continue session in Claude Code Desktop app. macOS and Windows only (alias: /app) | |
/diff | 2.0.0 | Interactive diff viewer for uncommitted changes and per-turn diffs. Use arrow keys to navigate | |
/doctor | 2.0.12 | Diagnose and verify Claude Code installation | |
/effort | [low | medium | high | max | auto] | 2.1.76 | Set effort level. low, medium, and high persist across sessions. max is session-only (Opus 4.6 only). auto resets to default. Takes effect immediately |
/exit | 0.2.9 | Exit the CLI (alias: /quit) | |
/export | [filename] | 0.2.9 | Export conversation as plain text. With a filename, writes directly to file. Without, opens a dialog to copy to clipboard or save |
/extra-usage | 2.1.36 | Configure extra usage to keep working when rate limits are hit | |
/fast | [on | off] | 2.1.36 | Toggle fast mode for Opus 4.6 on or off (faster output) |
/feedback | [report] | 0.2.9 | Submit feedback to the Anthropic team (alias: /bug) |
/fork | [name] | 2.0.0 | Create a fork of the current conversation at this point |
/help | 0.2.9 | Show all available slash commands with descriptions | |
/hooks | 1.0.38 | View hook configurations for tool events | |
/ide | 2.0.0 | Manage IDE integrations (VS Code, JetBrains) and show status | |
/init | 0.2.9 | Initialize project with CLAUDE.md guide file | |
/insights | 2.1.14 | Generate an analysis report of your Claude Code sessions (project areas, interaction patterns, friction points) | |
/install-github-app | 1.0.0 | Set up the Claude GitHub Actions app | |
/install-slack-app | 2.0.51 | Install the Claude Slack app | |
/keybindings | 2.1.18 | Open or create keybindings configuration | |
/login | 0.2.96 | Sign in to Anthropic account | |
/logout | 0.2.96 | Sign out from Anthropic account | |
/mcp | 0.2.50 | Manage MCP server connections and OAuth authentication | |
/memory | 1.0.94 | Edit CLAUDE.md memory files, enable/disable auto-memory, view auto-memory entries | |
/mobile | 2.0.51 | Show QR code for Claude mobile app (aliases: /ios, /android) | |
/model | [model] | 0.2.9 | Switch between AI models. Use left/right arrows to adjust effort level. Takes effect immediately |
/passes | 2.0.58 | Share a free week of Claude Code with friends (only if eligible) | |
/permissions | 2.0.67 | View or update tool permissions (alias: /allowed-tools) | |
/plan | [description] | 2.1.0 | Enter plan mode directly from the prompt |
/plugin | 2.0.12 | Manage Claude Code plugins (install, uninstall, browse) | |
/pr-comments | [PR URL | number] | 2.0.0 | Show GitHub PR comments. Auto-detects PR or takes URL/number as argument |
/privacy-settings | 2.0.51 | View and update privacy settings (Pro/Max only) | |
/release-notes | 2.0.32 | View the full changelog | |
/reload-plugins | 2.1.69 | Reload all active plugins to apply changes without restarting | |
/remote-control | [name] | 2.1.51 | Make session controllable from claude.ai or Claude app (alias: /rc) |
/remote-env | 2.0.47 | Configure default remote environment for web sessions with --remote | |
/rename | [name] | 2.1.20 | Rename session and show name on prompt bar. Without a name, auto-generates from conversation history |
/resume | [session] | 1.0.27 | Resume a conversation by ID, name, or picker (alias: /continue) |
/rewind | 2.0.0 | Rewind conversation and/or code to a previous point (alias: /checkpoint) | |
/sandbox | 2.0.24 | Toggle sandbox mode on/off (supported platforms only) | |
/security-review | 2.1.70 | Analyze pending changes for security vulnerabilities (injection, auth issues, data exposure) | |
/skills | 2.1.3 | List all available skills | |
/stats | 2.0.64 | Visualize daily usage, session history, streaks, and model preferences | |
/status | 0.2.9 | Open settings (Status tab) with version, model, account, and connectivity | |
/statusline | [description] | 1.0.71 | Configure Claude Code statusline. Describe what you want, or run without arguments for auto-configuration |
/stickers | 2.0.51 | Order Claude Code stickers | |
/tasks | 2.0.64 | List and manage background tasks | |
/terminal-setup | 1.0.110 | Configure terminal keybindings for Shift+Enter (VS Code, Alacritty, Warp) | |
/theme | 2.0.74 | Change color theme (light/dark, colorblind variants, ANSI themes) | |
/upgrade | 2.0.51 | Open upgrade page for a higher plan tier | |
/usage | 2.0.0 | Show plan usage limits and rate limit status | |
/vim | 0.2.34 | Toggle between Vim and Normal editing modes | |
/voice | 2.1.69 | Push-to-talk voice mode. Hold spacebar to speak, supports 20+ languages |
/clear is a real token saver. Almost reached the message limit? This command clears the context and gives you a fresh start.Bundled Skills
Bundled skills ship with Claude Code and are available in every session. Unlike built-in commands, skills are prompt-based: they give Claude a detailed playbook and let it orchestrate the work using its tools. This means skills can spawn parallel agents, read files, and adapt to your codebase.
Skill | Description |
|---|---|
/batch <instruction> | Orchestrate large-scale changes in parallel. Decomposes work into 5 to 30 units, spawns one agent per unit in an isolated git worktree, and creates PRs. Example: /batch "migrate src/ from Solid to React" |
/claude-api | Load Claude API and Agent SDK reference material for your project language (Python, TypeScript, etc.). Also activates automatically when your code imports anthropic or @anthropic-ai/sdk |
/debug [description] | Troubleshoot your current session by reading the debug log. Optionally describe the issue to focus the analysis |
/loop [interval] <prompt> | Run a prompt repeatedly on an interval. Useful for polling deployments or monitoring PRs. Example: /loop 5m "check if deploy finished" |
/simplify [focus] | Review recently changed files for code reuse, quality, and efficiency. Spawns three review agents in parallel, aggregates findings, and applies fixes |
/mcp__<server>__<prompt> and are dynamically discovered from connected servers.Keyboard Shortcuts
Keyboard shortcuts make the difference between productive flow and constant looking things up. Here are all available shortcuts for interactive mode.
General Controls
Shortcut | Description | Context |
|---|---|---|
Ctrl+C | Cancel current input or generation | Standard interrupt |
Ctrl+F (2x) | Kill all background agents | Press twice within 3 seconds to confirm |
Ctrl+D | Exit Claude Code session | EOF signal |
Ctrl+G | Open prompt in external editor | For long prompts |
Ctrl+L | Clear terminal screen | Keeps conversation history |
Ctrl+O | Toggle verbose output | Shows detailed tool usage |
Ctrl+R | Reverse search in command history | Interactive history search |
Ctrl+T | Toggle task list visibility | Show/hide tasks in status area |
Ctrl+V / Alt+V | Paste image from clipboard | Mac/Linux or Windows |
Ctrl+B | Background current task | Tmux users press twice |
Arrow keys ↑/↓ | Navigate through command history | Recalls previous inputs |
← / → | Cycle through dialog tabs | In permission dialogs and menus |
Esc + Esc | Rewind or summarize | Restore previous state or summarize from selected message |
Option+T / Alt+T | Toggle Extended Thinking | Run /terminal-setup first |
Option+P / Alt+P | Open model picker | Quick model switch without clearing prompt |
Shift+Tab / Alt+M | Switch permission modes | Auto-Accept, Plan, Normal |
Text Editing
Shortcut | Description | Context |
|---|---|---|
Ctrl+K | Delete to end of line | Deleted text is stored |
Ctrl+U | Delete entire line | Deleted text is stored |
Ctrl+Y | Paste previously deleted text | Paste from kill ring |
Alt+Y (after Ctrl+Y) | Cycle through paste history | Cycle previously deleted texts |
Alt+B | Move cursor back one word | Option as Meta on macOS |
Alt+F | Move cursor forward one word | Option as Meta on macOS |
Multi-line Input
Method | Shortcut | Context |
|---|---|---|
| Quick Escape | \\ + Enter | Works in all terminals |
| macOS Standard | Option+Enter | Default on macOS |
| Shift+Enter | Shift+Enter | Works natively in iTerm2, WezTerm, Ghostty, Kitty. Run /terminal-setup for others |
| Control Sequence | Ctrl+J | Line feed for multi-line |
| Paste Mode | Direct paste | For code blocks, logs |
Quick Commands
Shortcut | Description | Notes |
|---|---|---|
/ at start | Execute slash command or skill | Filters and autocompletes |
! at start | Bash mode | Executes commands directly, output in session |
@ | File path mention | Triggers file path autocomplete |
CLI Commands
I actually rarely use CLI commands (except for starting Claude Code, of course).
Command | Description | Example |
|---|---|---|
claude | Start interactive REPL | claude |
claude "query" | Start REPL with initial prompt | claude "explain this project" |
claude -p "query" | Query via SDK, then exit | claude -p "explain this function" |
cat file | claude -p "query" | Process piped content | cat logs.txt | claude -p "explain" |
claude -c | Continue most recent conversation | claude -c |
claude -c -p "query" | Continue via SDK | claude -c -p "Check for type errors" |
claude -r "session" "query" | Resume session by ID or name | claude -r "auth-refactor" "Finish this PR" |
claude update | Update to latest version | claude update |
claude auth login | Sign in to Anthropic account (with --email or --sso) | claude auth login --sso |
claude auth logout | Sign out from Anthropic account | claude auth logout |
claude auth status | Show authentication status (JSON or --text) | claude auth status --text |
claude agents | List all configured subagents | claude agents |
claude doctor | Check Claude Code installation health | claude doctor |
claude mcp | Configure and manage MCP servers | claude mcp add github https://... |
claude remote-control | Start Remote Control server (session controllable via claude.ai) | claude remote-control --name "My Project" |
CLI Flags
CLI flags are very useful for starting Claude Code with the right settings.
Basic Flags
Flag | Description | Example |
|---|---|---|
-p, --print | Print response without interactive mode | claude -p "query" |
-c, --continue | Continue last conversation | claude -c |
-r, --resume | Resume specific session by ID or name | claude -r "auth-refactor" "query" |
-n, --name | Set display name for session (visible in /resume and terminal title) | claude -n "feature-work" |
-w, --worktree | Start in isolated git worktree | claude -w feature-auth |
-v, --version | Output version number | claude -v |
Model & System Prompt
Flag | Description | Example |
|---|---|---|
--effort | Set effort level (low, medium, high, max). max is Opus 4.6 only, session-scoped | claude --effort high |
--model | Set model by alias (sonnet, opus) or full name | claude --model claude-sonnet-4-6 |
--system-prompt | Replace entire system prompt | claude --system-prompt "You are a Python expert" |
--system-prompt-file | Load system prompt from file (replaces default) | claude --system-prompt-file ./prompt.txt |
--append-system-prompt | Append text to default system prompt | claude --append-system-prompt "Always use TypeScript" |
--append-system-prompt-file | Append file contents to default system prompt | claude --append-system-prompt-file ./rules.txt |
--tools | Restrict available tools ("" for none, "default" for all) | claude --tools "Bash,Edit,Read" |
Agents & Subagents
Flag | Description | Example |
|---|---|---|
--agent | Specify an agent for the session | claude --agent my-custom-agent |
--agents | Define custom subagents via JSON | claude --agents '{"reviewer":{...}}' |
--teammate-mode | Agent teams display mode (auto, in-process, tmux) | claude --teammate-mode tmux |
Permissions & Security
Flag | Description | Example |
|---|---|---|
--allowedTools | Allow tools without permission prompt | claude --allowedTools "Bash(git log *)" "Read" |
--disallowedTools | Remove tools entirely (not usable) | claude --disallowedTools "Edit" |
--permission-mode | Start in specific permission mode | claude --permission-mode plan |
--dangerously-skip-permissions | Skip all permission prompts (use with caution!) | claude --dangerously-skip-permissions |
--permission-prompt-tool | MCP tool for permission prompts (non-interactive) | claude -p --permission-prompt-tool mcp_tool "query" |
MCP Server & Integration
Flag | Description | Example |
|---|---|---|
--mcp-config | Load MCP servers from JSON files (space-separated) | claude --mcp-config ./mcp.json |
--strict-mcp-config | Use ONLY --mcp-config, ignore all other MCP sources | claude --strict-mcp-config --mcp-config ./mcp.json |
--plugin-dir | Load plugins from a directory (repeat flag for multiple) | claude --plugin-dir ./my-plugins |
--chrome / --no-chrome | Enable/disable Chrome browser integration | claude --chrome |
--ide | Automatically connect to IDE at startup | claude --ide |
--betas | Beta headers for API requests (API key only) | claude --betas "feature-x" |
Output & Format
Flag | Description | Example |
|---|---|---|
--output-format | Specify output format (text, json, stream-json) | claude -p "query" --output-format json |
--input-format | Specify input format (text, stream-json) | claude -p --input-format stream-json |
--json-schema | Get validated JSON matching schema (print mode only) | claude -p --json-schema '{...}' "query" |
--include-partial-messages | Include partial streaming events (stream-json only) | claude -p --output-format stream-json --include-partial-messages "query" |
--verbose | Enable verbose logging with full turn-by-turn output | claude --verbose |
Directories & Session
Flag | Description | Example |
|---|---|---|
--add-dir | Add additional working directories | claude --add-dir ../apps ../lib |
--from-pr | Resume sessions linked to a GitHub PR | claude --from-pr 123 |
--session-id | Use specific session ID (UUID) | claude --session-id "550e8400-..." |
--fork-session | Create new session ID when resuming | claude --resume abc123 --fork-session |
--no-session-persistence | Disable session saving (print mode only) | claude -p --no-session-persistence "query" |
Remote & More
Flag | Description | Example |
|---|---|---|
--remote | Create web session on claude.ai | claude --remote "Fix all bugs" |
--remote-control, --rc | Start with Remote Control (session controllable via claude.ai) | claude --rc "My Project" |
--teleport | Resume remote web session locally | claude --teleport |
--debug | Enable debug mode with optional category filtering | claude --debug "api,mcp" |
--max-turns | Limit agentic turns (print mode only) | claude -p --max-turns 3 "query" |
--max-budget-usd | Maximum budget in USD (print mode only) | claude -p --max-budget-usd 5.00 "query" |
--fallback-model | Auto-fallback on overload (print mode only) | claude -p --fallback-model sonnet "query" |
--init / --init-only | Initialize with session or just run hooks and exit | claude --init-only |
--settings | Load settings from JSON file or string | claude --settings ./settings.json |
--setting-sources | Comma-separated list of settings sources (user, project, local) | claude --setting-sources "user,project" |
--disable-slash-commands | Disable all skills and commands for this session | claude --disable-slash-commands |
claude --model opus --verbose --add-dir src/ starts Claude with Opus model, verbose logging, and loads the src folder.Environment Variables
Beyond CLI flags, there are numerous environment variables that let you control Claude Code's behavior. Set them in your shell or in settings.json under the env key.
Model & Performance
Variable | Description | Default |
|---|---|---|
ANTHROPIC_MODEL | Override the default model | None |
CLAUDE_CODE_EFFORT_LEVEL | Effort level (low, medium, high) | high |
CLAUDE_CODE_MAX_OUTPUT_TOKENS | Maximum output tokens per response | 32768 |
MAX_THINKING_TOKENS | Token budget for Extended Thinking | 10000 |
CLAUDE_CODE_SUBAGENT_MODEL | Model used by subagents | None |
Bash & Timeouts
Variable | Description | Default |
|---|---|---|
BASH_MAX_TIMEOUT_MS | Maximum timeout for bash commands in ms | ~60000 |
BASH_DEFAULT_TIMEOUT_MS | Default timeout for bash commands in ms | ~60000 |
BASH_MAX_OUTPUT_LENGTH | Maximum bash output length in characters | 30000 |
MAX_MCP_OUTPUT_TOKENS | Token limit for MCP tool output | None |
Feature Toggles
Variable | Description | Value |
|---|---|---|
CLAUDE_CODE_DISABLE_AUTO_MEMORY | Disable automatic memory creation | 1 = off |
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS | Disable background tasks | 1 = off |
CLAUDE_CODE_DISABLE_CRON | Stop scheduled cron jobs in session | 1 = off |
CLAUDE_CODE_DISABLE_1M_CONTEXT | Disable the 1M token context window | 1 = off |
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS | Remove git instructions from system prompt | 1 = off |
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION | Control prompt suggestions (grayed-out suggestion text) | false = off |
CLAUDE_CODE_TASK_LIST_ID | Named task list for cross-session tasks | e.g., my-project |
ENABLE_TOOL_SEARCH | Enable Tool Search with ANTHROPIC_BASE_URL | 1 = on |
ENABLE_CLAUDEAI_MCP_SERVERS | Control claude.ai MCP servers | false = off |
DISABLE_AUTOUPDATER | Disable auto-updates | 1 = off |
DISABLE_TELEMETRY | Disable telemetry | 1 = off |
DISABLE_PROMPT_CACHING | Disable prompt caching | 1 = off |
Authentication & Provider
Variable | Description | Context |
|---|---|---|
ANTHROPIC_API_KEY | API key for Anthropic | Required without subscription |
CLAUDE_CODE_USE_BEDROCK | Use AWS Bedrock as provider | 1 = enabled |
CLAUDE_CODE_USE_VERTEX | Use Google Vertex AI as provider | 1 = enabled |
HTTP_PROXY / HTTPS_PROXY | Proxy configuration | For corporate networks |
settings.json instead of exporting them in the shell every time, e.g., {"env": {"CLAUDE_CODE_EFFORT_LEVEL": "medium"}}MCP (Model Context Protocol) Integration
MCP is one of Claude Code's most important extensions. With it, you can directly integrate external tools and services. The community is already delivering hundreds of MCP server implementations and constantly expanding the ecosystem.
# Add MCP server
claude mcp add --transport http github https://mcp.github.com
# Start with debug
claude --debug "mcp"
# Expose Claude Code itself as an MCP server
claude mcp serveSince early 2026, Claude Code uses Tool Search (lazy loading) for MCP tools by default. This reduces context usage by approximately 95%, as tools are loaded on demand rather than all at once.
Another feature is MCP Elicitation: MCP servers can display interactive forms or browser URLs during a task to request structured input. MCP servers can also provide their own commands in the format /mcp__<server>__<prompt>.
Skills
One of the coolest features of Claude Code? You can create your own skills that perfectly fit your workflow. Skills are the evolution of former custom commands and follow the open Agent Skills standard.
Project skills are stored in .claude/skills/ and are available to everyone in the project. Personal skills go in ~/.claude/skills/ and only apply to you. Enterprise skills are distributed organization-wide through managed settings.
---
name: test-all
description: Runs all tests and linters
argument-hint: [test-suite] [flags]
allowed-tools: Bash(npm test:*), Bash(npm run:*)
model: sonnet
disable-model-invocation: false
context: fork
---
Run the following tests:
1. npm test $ARGUMENTS
2. npm run lint
3. npm run typecheck
Show me a summary of all results.After creating it, simply type /test-all and Claude runs your complete test suite. I have about 10 such skills for recurring tasks.
name, description, argument-hint, allowed-tools, model, disable-model-invocation, user-invocable, context (fork for subagent), agent (Explore, Plan, etc.) and hooks. Variables: $ARGUMENTS, $0/$1, ${CLAUDE_SKILL_DIR}, ${CLAUDE_SESSION_ID}.Troubleshooting: When Claude Code Doesn't Do What It Should
Even after hundreds of sessions, I sometimes run into problems. Here are the most common errors and their solutions.
Problem | Cause | Solution |
|---|---|---|
| Claude doesn't understand project | Wrong start folder | Start in project root, create CLAUDE.md |
| Token limit reached | Too much context | Use /clear, /compact for smart compression |
| Commands don't work | Outdated version | Run claude update |
| MCP server won't connect | Missing configuration | Run claude --debug "mcp" for diagnosis |
| Shift+Enter doesn't work | Terminal setup missing | Run /terminal-setup (VS Code, Alacritty, Warp) |
You can use the following debug commands for problem analysis:
# Check system status
/status
# Check installation
/doctor
# Visualize context usage
/context
# Show token costs
/cost
# Verbose mode for details
claude --verbose
# Activate debug mode
claude --debug "api,mcp"
# Session troubleshooting
/debug "my problem"
# Open configuration
/config/doctor shows errors, first run claude update to update to the latest version.





