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)
- Most important shortcuts: Shift+Enter for multi-line input, Ctrl+C to cancel, Tab for Extended Thinking
- CLI flags enable advanced usage: --model for model switching, --verbose for debug info, --allowedTools for tool permissions
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 |
|---|---|
/add-dir | Adds additional working directories to the session |
/agents | Manages custom AI subagents |
/bashes | Shows and manages background tasks |
/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 |
/cost | Shows detailed token usage and cost statistics |
/doctor | Checks 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 |
/hooks | Manages hook configurations |
/ide | Manages IDE integrations and shows status |
/init | Initializes project with CLAUDE.md guide file |
/install-github-app | Sets up Claude GitHub Actions for repository |
/login | Switches between Anthropic accounts |
/logout | Logs out from current Anthropic account |
/mcp | Manages MCP server connections and OAuth |
/memory | Edits CLAUDE.md memory files |
/model | Switches between AI models (Opus, Sonnet, Haiku) |
/output-style | Sets output style directly or from menu |
/permissions | Shows or updates tool permissions |
/plugin | Manages Claude Code plugins |
/pr-comments | Shows pull request comments |
/privacy-settings | Shows and updates privacy settings |
/release-notes | Shows the release notes |
/resume | Continues a previous conversation |
/review | Requests code review for current changes |
/rewind | Resets conversation and/or code to previous state |
/sandbox | Activates isolated bash environment |
/security-review | Performs security review of pending changes |
/status | Opens settings panel with version, model, and account info |
/statusline | Sets up Claude Code statusline UI |
/terminal-setup | Installs Shift+Enter key binding (iTerm2, VS Code) |
/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+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+V / Alt+V | Paste image from clipboard | Mac/Linux or Windows |
Arrow keys ↑/↓ | Navigate through command history | Recalls previous inputs |
Esc + Esc | Rewind code/conversation | Restores previous state |
Tab | Toggle Extended Thinking | Thinking on/off |
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 mcp | Configure Model Context Protocol (MCP) servers | See MCP documentation |
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" |
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" |
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 |
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" |
--verbose | Activates verbose logging | claude --verbose |
--ide | Automatically connects to IDE at startup | claude --ide |
--max-turns | Limits agentic turns (non-interactive) | claude -p --max-turns 3 "query" |
--fallback-model | Auto-fallback on overload (print mode) | claude -p --fallback-model sonnet "query" |
claude --model opus --verbose --add-dir src/ starts Claude with Opus model, verbose logging, and loads the src folder.Think Modes
The different "think modes" are like different driving speeds. Depending on the complexity of your task, you choose the appropriate mode.
# Standard mode (80% of all tasks)
"Add a button to the navigation"
# Think mode (15% - thoughtful solutions)
"think: How should I optimally structure the database connection?"
# Think-hard mode (5% - complex architecture)
"think hard: Refactor the complete API structure"I use standard mode 80 percent of the time. The think modes only for really tricky problems. Think hard is like an architect who first creates a complete blueprint before starting.
MAX_THINKING_TOKENS. Higher values allow deeper thinking but consume more tokens. Default: 10000.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.Custom Commands
One of the coolest features of Claude Code? You can create your own commands that perfectly fit your workflow.
Project commands are stored in .claude/commands/ and are available to everyone in the project. Personal commands go in ~/.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 custom commands 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.




