Get the PDF
Enter your email and we’ll open the print dialog so you can save it as a PDF. I’ll also send you new Claude Code workflows for marketers.
Please enter a valid email address.
No spam. Unsubscribe any time.
Claude Code Command Reference
Every slash command, CLI flag, MCP command, keyboard shortcut, and configuration option — in one place.
Slash Commands — Complete Reference
/add-dir <path>
Add a new working directory to the current session
/agents
Manage agent configurations
/btw <question> NEW
Ask Claude a quick side question mid-task — no context reset, no re-explaining
/chrome
Configure Claude in Chrome settings
/clear
Clear conversation history and free up context. Aliases: /reset, /new
/color [color|default]
Set prompt bar color for this session: red, blue, green, yellow, purple, orange, pink, cyan
/compact [instructions]
Compress conversation history with optional focus instructions to keep
/config
Open Settings — theme, model, output style. Alias: /settings
/context
Visualize context usage as a colored grid — shows optimization suggestions and capacity warnings
/copy [N]
Copy last response to clipboard. Pass N to copy Nth-latest. Shows picker for code blocks
/cost
Show token usage statistics for the current session
/desktop
Continue session in Claude Code Desktop app. macOS & Windows only. Alias: /app
/diff
Interactive diff viewer — uncommitted changes and per-turn diffs. Arrow keys to navigate
/doctor
Diagnose Claude Code installation — checks config, auth, and updater
/effort [level]
Set model effort: low | medium | high | max | auto. Max requires Opus. No arg = show current
/exit
Exit Claude Code. Alias: /quit
/export [filename]
Export conversation as plain text. With filename writes to file; without opens save dialog
/extra-usage
Configure extra usage to keep working when rate limits are hit
/fast [on|off]
Toggle fast mode — same Opus model, faster output streaming
/feedback [report]
Submit feedback or bug reports about Claude Code. Alias: /bug
/branch [name]
Create a conversation branch at this point. Alias: /fork
/help
Show all available commands and current session info
/hooks
View hook configurations for tool events
/ide
Manage IDE integrations and show connection status
/init
Generate a CLAUDE.md for the current project. Set CLAUDE_CODE_NEW_INIT=true for interactive flow
/insights
Generate report analyzing your Claude Code sessions — patterns, friction points, project areas
/install-github-app
Set up Claude GitHub Actions app for a repository
/install-slack-app
Install the Claude Slack app via browser OAuth flow
/keybindings
Open or create your keybindings configuration file
/login
Switch or add a Claude account
/logout
Sign out of the current Claude account
/mcp
View MCP server status, manage connections and OAuth authentication
/memory
Edit CLAUDE.md files, enable/disable auto-memory, view auto-memory entries
/mobile
Show QR code to download Claude mobile app. Aliases: /ios, /android
/model [model]
View or switch AI model mid-session. Arrow keys adjust effort level
/passes
Share a free week of Claude Code with friends (eligible accounts only)
/permissions
View or update tool permissions. Alias: /allowed-tools
/plan
Enter plan mode — Claude reads and plans but takes no actions
/plugin
Manage Claude Code plugins
/pr-comments [PR]
Fetch GitHub PR comments. Auto-detects current branch PR or pass a URL/number
/privacy-settings
View and update privacy settings (Pro and Max plans only)
/release-notes
View full changelog — most recent version shown closest to prompt
/reload-plugins
Reload all active plugins to apply changes without restarting
/remote-control
Make this session available for remote control from claude.ai. Alias: /rc
/remote-env
Configure the default remote environment for web sessions started with –remote
/rename [name]
Rename the current session. Without a name, auto-generates one from conversation history
/resume [session]
Resume a conversation by ID or name, or open session picker. Alias: /continue
/rewind
Rewind conversation and/or code to a previous point. Alias: /checkpoint
/sandbox
Toggle sandbox mode (supported platforms only)
/schedule [description]
Create, update, list, or run Cloud scheduled tasks conversationally
/security-review
Analyze pending branch changes for security vulnerabilities — injection, auth, data exposure
/skills
List all available skills installed in the current session
/stats
Visualize daily usage, session history, streaks, and model preferences
/status
Open Settings (Status tab) — version, model, account, and connectivity
/statusline
Configure Claude Code’s status line. Describe what you want or auto-configure from shell prompt
/stickers
Order Claude Code stickers
/tasks
List and manage background tasks running in the current session
/terminal-setup
Configure terminal keybindings for Shift+Enter and other shortcuts
/theme
Change color theme — light, dark, colorblind (daltonized), and ANSI variants
/upgrade
Open the upgrade page to switch to a higher plan tier
/usage
Show plan usage limits and rate limit status
/vim
Toggle between Vim and Normal editing modes
/voice
Toggle push-to-talk voice dictation (requires Claude.ai account)
/mcp__<server>__<prompt>
Run MCP server-exposed prompts — dynamically discovered from connected servers
Keyboard Shortcuts
Ctrl+C
Interrupt current operation or clear input
Ctrl+D
Exit Claude Code
Escape
Cancel or clear current input line
↑ / ↓
Navigate through previous commands
Shift+Enter
Insert newline without submitting (after /terminal-setup)
Tab
Autocomplete file paths and slash commands
Slash Commands — Built-in Skills
/loop [interval] [cmd]
Re-run a command on a repeating interval. Default: 10m. Example: /loop 4h /rank-watch
/schedule
Create persistent background triggers on a cron schedule — runs whether or not a session is open
/commit
Stage and create a git commit with an AI-written message following repo conventions
/update-config
Configure settings.json — permissions, hooks, env vars, automated behaviors
/keybindings-help
Customize keyboard shortcuts and chord bindings in ~/.claude/keybindings.json
/seo-audit
Full SEO audit — technical issues, on-page, meta tags, and recommendations
/cold-email
Write B2B cold email sequences with subject lines, hooks, and follow-ups
/social-content
Create and optimize content for LinkedIn, X, Instagram, TikTok
/paid-ads
Google Ads, Meta, LinkedIn ad copy, targeting strategy, and optimization
/ab-test-setup
Plan and design A/B tests with hypothesis, variants, and success metrics
/analytics-tracking
Set up GA4, GTM, event tracking, UTM parameters, and tracking plans
/schema-markup
Add or fix JSON-LD structured data — FAQ, Product, Review, Breadcrumb
/email-sequence
Write nurture sequences, drip campaigns, and triggered email flows
/referral-program
Design referral/affiliate programs with incentive structure and copy
/onboarding-cro
Optimize post-signup onboarding, activation flows, and time-to-value
/find-skills
Discover and install new skills — search available skill library
Permission Modes
default
Standard mode — prompts for approval on sensitive actions
acceptEdits
Auto-approve all file edits, still prompts for Bash commands
dontAsk
Skip confirmation prompts — use in trusted automated workflows
plan
Read-only — Claude plans and explains but takes no actions
auto
Fully autonomous — handles all decisions without prompting
bypassPermissions
⚠ Dangerous — bypasses all checks. Sandboxes only
CLI Flags — Core
-p, –print
Non-interactive mode — prints response and exits. Great for scripts and pipes
-c, –continue
Continue the most recent conversation in the current directory
-r, –resume [id]
Resume a specific conversation by session ID, or open interactive picker
–model <model>
Set model for session. Use alias (sonnet, opus) or full ID
–output-format <fmt>
Output format with –print: text (default) | json | stream-json
–verbose
Show verbose/debug output — useful for diagnosing issues
-n, –name <name>
Set a display name for this session (shown in /resume and terminal title)
–add-dir <path>
Grant tool access to additional directories outside the working directory
–system-prompt <p>
Override the default system prompt for this session
–append-system-prompt
Append text to the default system prompt without replacing it
CLI Flags — Advanced
–permission-mode
Set permission mode: default | acceptEdits | dontAsk | plan | auto
–allowedTools
Whitelist specific tools e.g. “Bash(git:*) Edit Read”
–disallowedTools
Blacklist specific tools from being used in this session
–max-budget-usd
Cap API spend for a –print session (e.g. –max-budget-usd 0.50)
–effort <level>
Set reasoning effort: low | medium | high | max
–mcp-config <file>
Load MCP servers from a JSON file for this session only
-w, –worktree
Create a new git worktree for isolated session work
–fork-session
Create a new session ID when resuming (branches the conversation)
–bare
Minimal mode — skips hooks, CLAUDE.md, memory, LSP. For sandboxes
–dangerously-skip-permissions
⚠ Bypass all permission checks. Sandboxes only
MCP Commands — claude mcp …
mcp list
List all configured MCP servers and their status
mcp get <name>
Show full config and connection details for a specific server
mcp remove <name>
Remove an MCP server by name. Add –scope project for project-level removal
mcp reset-project-choices
Reset all approved/rejected server decisions for the current project
mcp add <name> <cmd>
Add stdio MCP server. Example: claude mcp add gsc — npx @gsc/mcp
mcp add –transport sse
Add SSE MCP server: claude mcp add –transport sse name https://url
mcp add –transport http
Add HTTP MCP server: claude mcp add –transport http name https://url
mcp add -e KEY=val
Pass environment variables to the MCP server process
mcp add-json <name> <json>
Add server using a raw JSON config string
mcp add-from-claude-desktop
Import all MCP servers from Claude Desktop config (Mac / WSL)
mcp serve
Start Claude Code itself as an MCP server for other tools to connect to
MCP Server Scope
–scope user
Available across all projects (default). Stored in ~/.claude/
–scope project
Available to all users of the project. Stored in .mcp.json
–scope local
Available to you only in this project. Stored in .claude/settings.local.json
.mcp.json
Project-level MCP config file. Commit to share servers with your team
CLAUDE.md — Configuration File
./CLAUDE.md
Project-level config — read automatically every session in this directory
~/.claude/CLAUDE.md
Global config — applies to every Claude Code session across all projects
../CLAUDE.md
Parent directory configs are also loaded — chain configs up the directory tree
#import path/to/file.md
Import another markdown file into CLAUDE.md — useful for shared team configs
bash block at top
Bash commands in a fenced block auto-run at session start (e.g. load env vars)
/init
Generate a CLAUDE.md for the current project — Claude reads the codebase first
/memory
Open all CLAUDE.md files in your editor for direct editing
Auto-memory
Claude auto-saves persistent notes to ~/.claude/projects/[path]/memory/
Settings Files
~/.claude/settings.json
Global user settings — applies to all projects
.claude/settings.json
Project settings — commit to share with team
.claude/settings.local.json
Local overrides — add to .gitignore, never commit
model
Default model for sessions
permissions
Allowed/denied tools (persistently)
env
Environment variables loaded at session start
hooks
Shell commands triggered by session events
Hooks
PreToolUse
Runs before any tool call. Can inspect or block the action
PostToolUse
Runs after a tool call completes. Good for logging or notifications
Stop
Runs when Claude finishes responding — trigger alerts or next steps
Notification
Runs when Claude sends a notification event
SubagentStop
Runs when a subagent (spawned by Agent tool) stops
Models Reference
claude-opus-4-6
Most capable — complex reasoning, multi-step tasks. Alias: opus
claude-sonnet-4-6
Balanced speed + capability — default model. Alias: sonnet
claude-haiku-4-5-20251001
Fastest, most cost-efficient — simple tasks and high-volume scripts. Alias: haiku
–model sonnet
Use the alias to always get the latest version of that tier automatically
Non-Interactive Mode — Useful Patterns
claude -p “Summarize this file” < report.txt
Pipe file content to Claude and print the response
claude -p “Fix the bug” –output-format json
Get a structured JSON response — useful for parsing in scripts
claude -p “…” –model haiku –max-budget-usd 0.10
Run a task with a specific model and hard cost cap
claude -p “…” –allowedTools “Read,Glob,Grep”
Restrict to read-only tools — safe for content analysis tasks
cat data.csv | claude -p “Analyze this data”
Pipe any data format — CSV, JSON, logs — directly to Claude
