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 30 slash commands available: /clear (clears context), /compact (compresses conversation), /model (switch models), /plan (plan mode)
- Key shortcuts: Cmd+T for Extended Thinking, Cmd+P for model picker, Ctrl+G for external editor, Shift+Tab for permission modes
- CLI flags enable advanced usage: --model for model switching, --remote for web sessions, --tools for tool selection, --max-budget-usd for cost limits
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
These commands are your daily tools when working with Claude Code. I use them so often that my fingers type them automatically:
Command | Description |
|---|---|
/bug | Reports bugs directly to the Anthropic team |
/clear | Clears the complete conversation history and starts fresh |
/compact | Compresses the conversation with optional focus parameter |
/config | Opens the settings interface (Config Tab) |
/context | Visualizes current context usage as a color grid |
/copy | Copies the last assistant response to clipboard |
/cost | Shows detailed token usage and cost statistics |
/doctor | CheckCheck Claude Code installation for problems |
/exit | Exits the Claude Code REPL |
/export | Exports conversation to file or clipboard |
/help | Shows all available slash commands with descriptions |
/init | Initializes project with CLAUDE.md guide file |
/keybindings | Creates or opens keybindings configuration |
/mcp | Manages MCP server connections and OAuth |
/memory | Edits CLAUDE.md memory files |
/model | Switches between AI models (Opus, Sonnet, Haiku) |
/permissions | Shows or updates tool permissions |
/plan | Enters plan mode directly from the prompt |
/rename | Renames the current session |
/resume | Continues a previous conversation (by ID or picker) |
/rewind | Resets conversation and/or code to previous state |
/stats | Shows usage statistics, session history, and model preferences |
/status | Opens settings panel with version, model, and account info |
/statusline | Sets up Claude Code statusline UI |
/tasks | Shows and manages background tasks |
/teleport | Resumes a remote session from claude.ai |
/terminal-setup | Installs Shift+Enter key binding (iTerm2, VS Code) |
/theme | Changes the color theme |
/todos | Lists current TODO entries |
/usage | Shows plan usage limits and rate limit status |
/vim | Activates Vim mode for Insert/Command modes |
/clear is a real token saver. Almost reached the message limit? This command clears the context and gives you a fresh start.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 | Cancels current input or generation | Standard interrupt |
Ctrl+D | Ends Claude Code session | EOF signal |
Ctrl+G | Open prompt in external editor | For long prompts |
Ctrl+L | Clears terminal screen | Keeps conversation history |
Ctrl+O | Toggle verbose output | Shows details |
Ctrl+R | Reverse search in command history | Interactive history search |
Ctrl+S | Stash current prompt | Save prompt for later |
Ctrl+T | Toggle task list visibility | Show/hide todos |
Ctrl+V / Alt+V | Paste image from clipboard | Mac/Linux or Windows |
Ctrl+B | Background current task | Background tasks |
Arrow keys ↑/↓ | Navigate through command history | Recalls previous inputs |
Esc + Esc | Rewind code/conversation | Restores previous state |
Cmd+T / Alt+T | Toggle Extended Thinking | Thinking on/off |
Cmd+P / Alt+P | Open model picker | Quick model switch |
Shift+Tab / Alt+M | Switch permission modes | Auto-Accept, Plan Mode, Normal |
Multi-line Input
Method | Shortcut | Context |
|---|---|---|
| Quick Escape | \\ + Enter | Works in all terminals |
| macOS Standard | Option+Enter | Standard on macOS |
| Terminal Setup | Shift+Enter | After /terminal-setup |
| Control Sequence | Ctrl+J | Line feed for multi-line |
| Paste Mode | Direct paste | For code blocks, logs |
/terminal-setup to install the Shift+Enter binding for iTerm2 and VS Code terminals.Quick Commands
Shortcut | Description | Notes |
|---|---|---|
# at start | Memory shortcut - adds to CLAUDE.md | Prompts for file selection |
/ at start | Execute slash command | See slash commands above |
! 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-id>" "query" | Resume session by ID | claude -r "abc123" "Finish this PR" |
claude update | Update to latest version | claude update |
claude doctor | Check Claude Code installation health | claude doctor |
claude mcp | Configure and manage MCP servers | claude mcp add github https://... |
claude plugin | Install and manage plugins | claude plugin install my-plugin |
claude install | Install native build (stable, latest) | claude install stable |
claude setup-token | Set up long-lived auth token | claude setup-token |
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 | claude -r "abc123" "query" |
-v, --version | Output version number | claude -v |
Model & System Prompt
Flag | Description | Example |
|---|---|---|
--model | Sets model for current session | claude --model sonnet |
--system-prompt | Replaces complete system prompt | claude --system-prompt "You are a Python expert" |
--system-prompt-file | Loads system prompt from file | claude -p --system-prompt-file ./prompt.txt "query" |
--append-system-prompt | Appends text to standard system prompt | claude --append-system-prompt "Always use TypeScript" |
--tools | Restrict or disable available tools | claude --tools "Bash,Edit,Read" |
Agents & Subagents
Flag | Description | Example |
|---|---|---|
--agent | Specifies an agent for session | claude --agent my-custom-agent |
--agents | Defines custom subagents via JSON | claude --agents '{"reviewer":{...}}' |
Permissions & Security
Flag | Description | Example |
|---|---|---|
--allowedTools | Allow tools without permission prompt | claude --allowedTools "Bash(git:*)" "Read" |
--disallowedTools | Disallow tools | claude --disallowedTools "Bash(curl:*)" |
--dangerously-skip-permissions | Skips all permission prompts (caution!) | claude --dangerously-skip-permissions |
--permission-mode | Starts in specific permission mode | claude --permission-mode plan |
--permission-prompt-tool | MCP tool for permission prompts | claude -p --permission-prompt-tool mcp_tool "query" |
--allow-dangerously-skip-permissions | Enable bypass as an option without activating it | Only for sandboxes without internet |
MCP Server & Integration
Flag | Description | Example |
|---|---|---|
--mcp-config | Loads MCP servers from JSON | claude --mcp-config ./mcp.json |
--strict-mcp-config | Uses ONLY --mcp-config, ignores others | claude --strict-mcp-config --mcp-config ./mcp.json |
--plugin-dir | Loads plugins from directories | claude --plugin-dir ./my-plugins |
--betas | Beta headers for API requests (API key only) | claude --betas "feature-x" |
Output & Format
Flag | Description | Example |
|---|---|---|
--output-format | Specifies output format (text, json, stream-json) | claude -p "query" --output-format json |
--input-format | Specifies input format (text, stream-json) | claude -p --input-format stream-json |
--json-schema | Get validated JSON matching schema | claude -p --json-schema '{...}' "query" |
Directories & Session
Flag | Description | Example |
|---|---|---|
--add-dir | Adds additional working directories | claude --add-dir ../apps ../lib |
--session-id | Uses specific session ID (UUID) | claude --session-id "550e8400-..." |
--fork-session | Creates new session ID when resuming | claude --resume abc123 --fork-session |
Debug & More
Flag | Description | Example |
|---|---|---|
--debug | Activates debug mode with optional category | claude --debug "api,mcp" |
--debug-file | Write debug logs to a file | claude --debug-file ./debug.log |
--verbose | Activates verbose logging | claude --verbose |
--ide | Automatically connects to IDE at startup | claude --ide |
--chrome | Enable Claude in Chrome integration | claude --chrome |
--max-turns | Limits agentic turns (non-interactive) | claude -p --max-turns 3 "query" |
--max-budget-usd | Maximum budget in USD (print mode) | claude -p --max-budget-usd 5.00 "query" |
--fallback-model | Auto-fallback on overload (print mode) | claude -p --fallback-model sonnet "query" |
--remote | Create web session on claude.ai | claude --remote "Fix all bugs" |
--teleport | Resume remote web session locally | claude --teleport |
--settings | Load settings from JSON file or string | claude --settings ./settings.json |
--disable-slash-commands | Disable all skills for this session | claude --disable-slash-commands |
--file | Download files at startup | claude --file file_abc:doc.txt |
claude --model opus --verbose --add-dir src/ starts Claude with Opus model, verbose logging, and loads the src folder.MCP (Model Context Protocol) Integration
MCP is Claude Code's secret weapon for 2025. With it, you can directly integrate external tools and services. The community is already delivering dozens of MCP server implementations and constantly expanding the ecosystem.
# Add MCP server
claude mcp add --transport http github https://mcp.github.com
# Start with MCP debug
claude --mcp-debug
# Install Desktop Extensions
npm install -g @anthropic-ai/dxt
dxt init
dxt pack/github-search and /github-pr.Skills (formerly Custom Commands)
One of the coolest features of Claude Code? You can create your own skills that perfectly fit your workflow. Skills are the evolution of the former custom commands and offer more flexibility.
Project skills are stored in .claude/skills/ or .claude/commands/ and are available to everyone in the project. Personal skills go in ~/.claude/skills/ or ~/.claude/commands/ and only apply to you.
---
allowed-tools: Bash(npm test:*), Bash(npm run:*)
description: Runs all tests and linters
argument-hint: [test-suite] [flags]
model: sonnet
disable-model-invocation: false
---
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, you can simply type /test-all and Claude runs your complete test suite. I have about 10 such skills for recurring tasks.
$ARGUMENTS for all arguments or $1, $2 etc. for individual positional arguments. With ! as prefix you execute bash commands, with @ you reference files.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, load fewer files |
| Commands don't work | Outdated version | Run claude update |
| MCP server won't connect | Missing configuration | claude --mcp-debug for diagnosis |
| Shift+Enter doesn't work | Terminal setup missing | Run /terminal-setup |
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"
# Open configuration
/config/doctor shows errors, first run npm install -g @anthropic-ai/claude-code to update to the latest version.




