⚠️ Using System Commands in Claude Code

When you want to run system commands (like tree, ls, or find) that aren't built into Claude Code, you need to add a space after typing the command and before pressing Enter.

Why? Claude Code uses slash commands (like /help, /clear) for its built-in features. Adding a space tells Claude Code you want to run a system command instead.

✅ Correct: Type /tree (with space) → runs system tree command
❌ Incorrect: Type /tree (no space) → Claude Code looks for a /tree slash command

Setup & Configuration

Commands for installing, configuring, and managing Claude Code. These are run in your regular terminal before launching Claude Code.

Installation & Launch

Basic commands to get Claude Code running.

Command Purpose Example
npx @anthropics/claude-code Start Claude Code (NPX) npx @anthropics/claude-code
claude Start interactive REPL claude
claude "query" Start REPL with initial prompt claude "help me debug this"
claude update Update to latest version claude update

Authentication & Configuration

Configure authentication, models, and settings.

Command Purpose Example
claude config Configure settings claude config
claude config list List all configuration settings claude config list
claude config set <key> <value> Set a configuration value claude config set model claude-opus-4
--model <model> Set default model claude --model claude-sonnet-4
/login Switch Anthropic accounts /login
/logout Sign out of current account /logout

Essential Commands

Core commands you'll use daily in Claude Code. Master these first for the best experience.

Daily Use Commands

Commands you'll use most frequently in Claude Code.

Command Purpose Example
/help Show all available commands /help
/clear Clear context (saves tokens) /clear
/exit Exit Claude Code safely /exit
/model Change AI model /model claude-opus-4
/status Show system status and info /status
/cost Show session cost and token usage /cost
/undo Undo last action /undo
/redo Redo undone action /redo
/tokens Show detailed token usage /tokens

Project Management

Commands for managing projects, directories, sessions, and project memory.

Project Setup & Management

Initialize and manage your projects with Claude Code.

Command Purpose Example
/init Initialize project with CLAUDE.md /init
/add-dir <path> Add working directory /add-dir ~/projects
--add-dir <path> Add directories when starting claude --add-dir ../apps ../lib
/memory Edit memory files (CLAUDE.md) /memory
/compact [instructions] Keep summary, clear context /compact focus on performance

Session Management

Manage conversation sessions and history.

Command Purpose Example
--resume <session-id> Resume specific session by ID claude --resume abc123
--continue Load the most recent conversation claude --continue
/resume <session-id> Resume session from within Claude /resume session_id
/export <format> Export conversation /export markdown
/history View command history /history
/save <name> Save current state /save checkpoint

Development Tools

File operations, Git integration, and development utilities for coding workflows.

File Operations

Commands for working with files and directories.

Command Purpose Example
/read <file> Read file contents /read config.json
/write <file> <content> Write to files /write file.txt "content"
/edit <file> Edit files interactively /edit config.json
/open <file> Open files in editor /open file.js
/ls List directory contents /ls
/list <path> List project files /list src/
/tree Show project structure /tree
/mv <old> <new> Move or rename files /mv old.txt new.txt

Git & Version Control

Git operations and version control commands.

Command Purpose Example
/git <command> Git operations /git status
/diff <file> Show code differences /diff file.js
/review Review a pull request /review
/pr-comments Get GitHub PR comments /pr-comments

Search & Analysis

Find and analyze code across your project.

Command Purpose Example
/find <pattern> Search in files /find "TODO"
/search <pattern> Search across project /search "function"
/log <level> View application logs /log error
/watch <path> Watch file changes /watch src/

Execution & Testing

Run code, tests, and development commands.

Command Purpose Example
/run <command> Execute code or scripts /run test.py
/test <type> Run project tests /test unit
/dev <mode> Development mode toggle /dev on
/plan <feature> Create project plan /plan feature

System & Diagnostics

System information, debugging, monitoring, and troubleshooting commands.

System Information

Get information about your Claude Code installation and environment.

Command Purpose Example
--version Check Claude Code version claude --version
/version Show version information /version
--help Show command line help claude --help
/doctor Check installation health /doctor
/env Show environment variables /env
/update Update Claude Code /update

Configuration & Settings

Manage settings, themes, and system configuration.

Command Purpose Example
/config Open config panel /config
/settings Open settings panel /settings
/theme <name> Change UI theme /theme dark
/vim Enable Vim keybindings /vim
/refresh Refresh context /refresh
/reset Reset to initial state /reset

Debug & Support

Debugging, error reporting, and support commands.

Command Purpose Example
--verbose Enable verbose logging claude --verbose
--debug Enable debug mode claude --debug
/bug <description> Report issues to Anthropic /bug "describe problem"
/feedback <message> Send feedback /feedback "Great tool!"
/docs <topic> Open documentation /docs api

Advanced Features

MCP integration, permissions, experimental features, and power-user commands.

MCP Integration

Model Context Protocol server management and configuration.

Command Purpose Example
claude mcp Configure MCP servers claude mcp
claude mcp serve Start Claude Code MCP server claude mcp serve
claude mcp add <name> <cmd> Add stdio server claude mcp add fs "node fs-server.js"
/mcp Manage MCP servers /mcp
--mcp-debug Debug MCP connections claude --mcp-debug

Permissions & Security

Tool permissions and security controls.

Command Purpose Example
/permissions Manage tool permissions /permissions
--allowedTools <tools> Allow specific tools claude --allowedTools "Edit,Bash"
--disallowedTools <tools> Disallow specific tools claude --disallowedTools "WebFetch"
--dangerously-skip-permissions Skip all permission prompts ⚠️ claude --dangerously-skip-permissions

Advanced Modes & Features

Experimental features and advanced usage modes.

Command Purpose Example
-p "query" Print mode (one-off query) claude -p "analyze this code"
--headless "command" Run without interaction claude --headless "fix bugs"
--output-format json JSON output format claude -p "help" --output-format json
--max-turns <n> Limit agentic turns claude -p "task" --max-turns 3
/think Trigger extended thinking /think
/upgrade Access Claude Max (higher limits) /upgrade

GitHub & IDE Integration

GitHub Actions and IDE integration features.

Command Purpose Example
/install-github-app Setup GitHub Actions integration /install-github-app
/ide Manage IDE integrations /ide
/user Personal commands /user

Utility Commands

Additional utility and convenience commands.

Command Purpose Example
/pause <time> Pause conversation /pause 10m
cat file | claude -p "query" Process piped content cat error.log | claude -p "summarize"
--system-prompt "prompt" Override system prompt claude --system-prompt "You are an expert" -p "help"
Shift+Tab Toggle auto-accept mode Shift+Tab
Shift+Tab (2x) Enter planning mode Shift+Tab Shift+Tab