Skip to main content
gradually.ai logogradually.ai
Blog
About Us
Subscribe to AI Newsletter
AI Newsletter
  1. Home
  2. AI Blog

Claude Code Commands: The Ultimate Reference

All slash commands, CLI flags, and shortcuts for Claude Code in one compact reference – including practical examples, tips, and workflow recommendations.

FHFinn Hillebrandt
January 28, 2026
Auf Deutsch lesen
AI Programming
Claude Code Commands: The Ultimate Reference
𝕏XShare on XFacebookShare on FacebookLinkedInShare on LinkedInPinterestShare on PinterestThreadsShare on ThreadsFlipboardShare on Flipboard
Links marked with * are affiliate links. If a purchase is made through such links, we receive a commission.

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.

TL;DRKey Takeaways
  • 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 session
Tip
Always start Claude Code in the correct project folder, not from your Desktop or user directory.

Slash 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
/bugReports bugs directly to the Anthropic team
/clearClears the complete conversation history and starts fresh
/compactCompresses the conversation with optional focus parameter
/configOpens the settings interface (Config Tab)
/contextVisualizes current context usage as a color grid
/copyCopies the last assistant response to clipboard
/costShows detailed token usage and cost statistics
/doctorCheckCheck Claude Code installation for problems
/exitExits the Claude Code REPL
/exportExports conversation to file or clipboard
/helpShows all available slash commands with descriptions
/initInitializes project with CLAUDE.md guide file
/keybindingsCreates or opens keybindings configuration
/mcpManages MCP server connections and OAuth
/memoryEdits CLAUDE.md memory files
/modelSwitches between AI models (Opus, Sonnet, Haiku)
/permissionsShows or updates tool permissions
/planEnters plan mode directly from the prompt
/renameRenames the current session
/resumeContinues a previous conversation (by ID or picker)
/rewindResets conversation and/or code to previous state
/statsShows usage statistics, session history, and model preferences
/statusOpens settings panel with version, model, and account info
/statuslineSets up Claude Code statusline UI
/tasksShows and manages background tasks
/teleportResumes a remote session from claude.ai
/terminal-setupInstalls Shift+Enter key binding (iTerm2, VS Code)
/themeChanges the color theme
/todosLists current TODO entries
/usageShows plan usage limits and rate limit status
/vimActivates Vim mode for Insert/Command modes
Tip
My favorite command /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+CCancels current input or generationStandard interrupt
Ctrl+DEnds Claude Code sessionEOF signal
Ctrl+GOpen prompt in external editorFor long prompts
Ctrl+LClears terminal screenKeeps conversation history
Ctrl+OToggle verbose outputShows details
Ctrl+RReverse search in command historyInteractive history search
Ctrl+SStash current promptSave prompt for later
Ctrl+TToggle task list visibilityShow/hide todos
Ctrl+V / Alt+VPaste image from clipboardMac/Linux or Windows
Ctrl+BBackground current taskBackground tasks
Arrow keys ↑/↓Navigate through command historyRecalls previous inputs
Esc + EscRewind code/conversationRestores previous state
Cmd+T / Alt+TToggle Extended ThinkingThinking on/off
Cmd+P / Alt+POpen model pickerQuick model switch
Shift+Tab / Alt+MSwitch permission modesAuto-Accept, Plan Mode, Normal

Multi-line Input

Method
Shortcut
Context
Quick Escape\\ + EnterWorks in all terminals
macOS StandardOption+EnterStandard on macOS
Terminal SetupShift+EnterAfter /terminal-setup
Control SequenceCtrl+JLine feed for multi-line
Paste ModeDirect pasteFor code blocks, logs
Tip
Configure your preferred line break behavior in terminal settings. Run /terminal-setup to install the Shift+Enter binding for iTerm2 and VS Code terminals.

Quick Commands

Shortcut
Description
Notes
# at startMemory shortcut - adds to CLAUDE.mdPrompts for file selection
/ at startExecute slash commandSee slash commands above
! at startBash modeExecutes commands directly, output in session
@File path mentionTriggers file path autocomplete

CLI Commands

I actually rarely use CLI commands (except for starting Claude Code, of course):

Command
Description
Example
claudeStart interactive REPLclaude
claude "query"Start REPL with initial promptclaude "explain this project"
claude -p "query"Query via SDK, then exitclaude -p "explain this function"
cat file | claude -p "query"Process piped contentcat logs.txt | claude -p "explain"
claude -cContinue most recent conversationclaude -c
claude -c -p "query"Continue via SDKclaude -c -p "Check for type errors"
claude -r "<session-id>" "query"Resume session by IDclaude -r "abc123" "Finish this PR"
claude updateUpdate to latest versionclaude update
claude doctorCheck Claude Code installation healthclaude doctor
claude mcpConfigure and manage MCP serversclaude mcp add github https://...
claude pluginInstall and manage pluginsclaude plugin install my-plugin
claude installInstall native build (stable, latest)claude install stable
claude setup-tokenSet up long-lived auth tokenclaude setup-token

CLI Flags

CLI flags are very useful for starting Claude Code with the right settings:

Basic Flags

Flag
Description
Example
-p, --printPrint response without interactive modeclaude -p "query"
-c, --continueContinue last conversationclaude -c
-r, --resumeResume specific sessionclaude -r "abc123" "query"
-v, --versionOutput version numberclaude -v

Model & System Prompt

Flag
Description
Example
--modelSets model for current sessionclaude --model sonnet
--system-promptReplaces complete system promptclaude --system-prompt "You are a Python expert"
--system-prompt-fileLoads system prompt from fileclaude -p --system-prompt-file ./prompt.txt "query"
--append-system-promptAppends text to standard system promptclaude --append-system-prompt "Always use TypeScript"
--toolsRestrict or disable available toolsclaude --tools "Bash,Edit,Read"

Agents & Subagents

Flag
Description
Example
--agentSpecifies an agent for sessionclaude --agent my-custom-agent
--agentsDefines custom subagents via JSONclaude --agents '{"reviewer":{...}}'

Permissions & Security

Flag
Description
Example
--allowedToolsAllow tools without permission promptclaude --allowedTools "Bash(git:*)" "Read"
--disallowedToolsDisallow toolsclaude --disallowedTools "Bash(curl:*)"
--dangerously-skip-permissionsSkips all permission prompts (caution!)claude --dangerously-skip-permissions
--permission-modeStarts in specific permission modeclaude --permission-mode plan
--permission-prompt-toolMCP tool for permission promptsclaude -p --permission-prompt-tool mcp_tool "query"
--allow-dangerously-skip-permissionsEnable bypass as an option without activating itOnly for sandboxes without internet

MCP Server & Integration

Flag
Description
Example
--mcp-configLoads MCP servers from JSONclaude --mcp-config ./mcp.json
--strict-mcp-configUses ONLY --mcp-config, ignores othersclaude --strict-mcp-config --mcp-config ./mcp.json
--plugin-dirLoads plugins from directoriesclaude --plugin-dir ./my-plugins
--betasBeta headers for API requests (API key only)claude --betas "feature-x"

Output & Format

Flag
Description
Example
--output-formatSpecifies output format (text, json, stream-json)claude -p "query" --output-format json
--input-formatSpecifies input format (text, stream-json)claude -p --input-format stream-json
--json-schemaGet validated JSON matching schemaclaude -p --json-schema '{...}' "query"

Directories & Session

Flag
Description
Example
--add-dirAdds additional working directoriesclaude --add-dir ../apps ../lib
--session-idUses specific session ID (UUID)claude --session-id "550e8400-..."
--fork-sessionCreates new session ID when resumingclaude --resume abc123 --fork-session

Debug & More

Flag
Description
Example
--debugActivates debug mode with optional categoryclaude --debug "api,mcp"
--debug-fileWrite debug logs to a fileclaude --debug-file ./debug.log
--verboseActivates verbose loggingclaude --verbose
--ideAutomatically connects to IDE at startupclaude --ide
--chromeEnable Claude in Chrome integrationclaude --chrome
--max-turnsLimits agentic turns (non-interactive)claude -p --max-turns 3 "query"
--max-budget-usdMaximum budget in USD (print mode)claude -p --max-budget-usd 5.00 "query"
--fallback-modelAuto-fallback on overload (print mode)claude -p --fallback-model sonnet "query"
--remoteCreate web session on claude.aiclaude --remote "Fix all bugs"
--teleportResume remote web session locallyclaude --teleport
--settingsLoad settings from JSON file or stringclaude --settings ./settings.json
--disable-slash-commandsDisable all skills for this sessionclaude --disable-slash-commands
--fileDownload files at startupclaude --file file_abc:doc.txt
Note
Many flags can be combined. For example: 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
Note
MCP servers can provide their own slash commands. After installing GitHub-MCP, for example, you have access to /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.

Tip
In the skill prompt, you can use $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 projectWrong start folderStart in project root, create CLAUDE.md
Token limit reachedToo much contextUse /clear, load fewer files
Commands don't workOutdated versionRun claude update
MCP server won't connectMissing configurationclaude --mcp-debug for diagnosis
Shift+Enter doesn't workTerminal setup missingRun /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
Warning
If /doctor shows errors, first run npm install -g @anthropic-ai/claude-code to update to the latest version.

Frequently Asked Questions About Claude Code Commands

𝕏XShare on XFacebookShare on FacebookLinkedInShare on LinkedInPinterestShare on PinterestThreadsShare on ThreadsFlipboardShare on Flipboard
FH

Finn Hillebrandt

AI Expert & Blogger

Finn Hillebrandt is the founder of Gradually AI, an SEO and AI expert. He helps online entrepreneurs simplify and automate their processes and marketing with AI. Finn shares his knowledge here on the blog in 50+ articles as well as through his ChatGPT Course and the AI Business Club.

Learn more about Finn and the team, follow Finn on LinkedIn, join his Facebook group for ChatGPT, OpenAI & AI Tools or do like 17,500+ others and subscribe to his AI Newsletter with tips, news and offers about AI tools and online business. Also visit his other blog, Blogmojo, which is about WordPress, blogging and SEO.

Similar Articles

Gemini CLI Commands: The Ultimate Menu
AI Programming

Gemini CLI Commands: The Ultimate Menu

January 28, 2026
FHFinn Hillebrandt
Claude Code: The Complete Beginner's Guide
AI Programming

Claude Code: The Complete Beginner's Guide

October 15, 2025
FHFinn Hillebrandt
How to Create the Perfect AGENTS.md (incl. Template)
AI Programming

How to Create the Perfect AGENTS.md (incl. Template)

September 26, 2025
FHFinn Hillebrandt
How to Create the Perfect CLAUDE.md (incl. Template)
AI Programming

How to Create the Perfect CLAUDE.md (incl. Template)

September 25, 2025
FHFinn Hillebrandt
Claude Code vs. Gemini CLI vs. OpenAI Codex: The Ultimate Comparison
AI Programming

Claude Code vs. Gemini CLI vs. OpenAI Codex: The Ultimate Comparison

September 1, 2025
FHFinn Hillebrandt

Stay Updated with the AI Newsletter

Get the latest AI tools, tutorials, and exclusive tips delivered to your inbox weekly

Unsubscribe anytime. About 4 to 8 emails per month. Consent includes notes on revocation, service provider, and statistics according to our Privacy Policy.

gradually.ai logogradually.ai

Germany's leading platform for AI tools and knowledge for online entrepreneurs.

AI Tools

  • AI Chat
  • ChatGPT in German
  • Text Generator
  • Prompt Enhancer
  • FLUX AI Image Generator
  • AI Art Generator
  • Midjourney Prompt Generator
  • Veo 3 Prompt Generator
  • AI Humanizer
  • AI Text Detector
  • Gemini Watermark Remover
  • All Tools →

Creative Tools

  • Blog Name Generator
  • AI Book Title Generator
  • Song Lyrics Generator
  • Artist Name Generator
  • Team Name Generator
  • AI Mindmap Generator
  • Headline Generator
  • Company Name Generator
  • AI Slogan Generator

Business Tools

  • API Cost Calculator
  • Token Counter
  • AI Ad Generator
  • AI Copy Generator
  • Essay Generator
  • Story Generator
  • AI Rewrite Generator
  • Blog Post Generator
  • Meta Description Generator
  • AI Email Generator

Resources

  • MCP Server Directory
  • Agent Skills
  • n8n Hosting Comparison
  • OpenClaw Hosting Comparison

© 2025 Gradually AI. All rights reserved.

  • Blog
  • About Us
  • Legal Notice
  • Privacy Policy