Claude CodeCheatsheet: Commands, Flags & Shortcuts
Community-maintained by Shai Chikorel · reference v2.1.216 · updated 2026-07-21 · verified against Anthropic's command documentation ↗
Slash Commands
/clearClear conversation
/compact [focus]Compact context
/branch [name]Branch conversation (/fork alias)
/usageToken usage, cost and cache breakdown (replaces /cost, /stats)
/contextVisualize context (grid)
/diffInteractive diff viewer
/keybindingsCustomize keyboard shortcuts
/scroll-speed [speed]Adjust output scroll speed
/terminal-setupConfigure terminal keybindings
/initCreate CLAUDE.md at repo root by scanning the codebase
/memoryEdit CLAUDE.md files, toggle auto memory, view entries
/mcpManage MCP servers (list, add, remove, auth)
/hooksManage pre/post tool hooks
/skillsList available skills (built-in + project + personal)
/reload-skillsReload skills without restarting the session
/agentsManage agent configurations (list, create, edit)
/workflowsView and manage background multi-agent workflow runs
/review [PR]Review PR locally
/ultrareview [PR#]Cloud code review — parallel multi-agent analysis
/security-reviewScan diff for vulnerabilities (secrets, injection, authz)
/loop [interval] [prompt]Recurring task (/proactive alias)
/ideIDE integrations status
/add-dir <path>Add working directory to the session
/btw <question>Ask a side question without adding to the conversation
/extra-usageExtra usage when rate limited
/voiceToggle push-to-talk voice dictation
/doctorFull setup checkup (/checkup alias)
/insightsAnalyze sessions report
/desktopContinue in Desktop app
/rename [name]Rename current session
/helpShow help + commands
/feedbackSubmit feedback (alias: /bug)
MCP Servers
--transport httpRemote HTTP (recommended)
--transport stdioLocal process
--transport sseRemote SSE
Local ~/.claude.jsonScope: you only
Project .mcp.jsonScope: shared/VCS
User ~/.claude.jsonScope: global
/mcpInteractive UI
claude mcp listList all servers
alwaysLoad: trueKeep server connected across all sessions
Keyboard Shortcuts
Ctrl+CCancel input/generation
Ctrl+DExit session
Ctrl+LClear prompt input + force full screen redraw
Ctrl+OToggle transcript viewer (verbose usage); cycles focus view in fullscreen
Ctrl+UClear entire input buffer
Ctrl+YRestore cleared input buffer
Ctrl+GOpen in editor (same as Ctrl+X Ctrl+E)
Ctrl+RReverse search history
Ctrl+XKill all background agents (press twice to confirm)
Ctrl+BBackground running tasks
Ctrl+TToggle task list
Esc EscRewind or summarize
Shift+TabCycle permission modes (default → acceptEdits → plan → …)
Alt+PSwitch model
Alt+TToggle extended thinking
Alt+OToggle fast mode
CLI & Flags
claudeInteractive
claude "q"With prompt
claude -p "q"Headless (SDK)
claude -cContinue last
claude -r "n"Resume by ID/name
claude updateUpdate
claude auth loginSign in (--sso, --console)
claude agentsList agents
claude mcpMCP config
claude pluginPlugin management
claude project purge [path]Delete all Claude project state
claude ultrareview [target]Non-interactive code review (PR / branch / path)
--modelSet model
--dangerously-skip-permissionsBypass permission prompts (use in CI only)
--output-format jsonStructured output
--max-budget-usd 5Cost cap
Config & Env
~/.claude/settings.jsonUser settings (applies to every project)
.claude/settings.jsonProject settings (shared via VCS)
.claude/settings.local.jsonLocal-only overrides (gitignored)
~/.claude.jsonOAuth tokens, MCP servers, session state
.mcp.jsonProject MCP servers (checked in, shared)
modelOverridesMap model picker labels → custom IDs
autoMode.hard_denyUnconditional auto-mode classifier deny rules
hooks: ifConditional hooks using permission rule syntax
DISABLE_PROMPT_CACHINGStartup warning when prompt caching is disabled
ANTHROPIC_API_KEYAPI key env var
ANTHROPIC_MODELOverride default model via env
ANTHROPIC_BASE_URLProxy/gateway override
MAX_THINKING_TOKENS0 = off
API_TIMEOUT_MSAPI timeout (default 600000ms)
CLAUDECODEDetect CC shell (=1 when running inside Claude Code)
DISABLE_UPDATESBlock all update paths (pinned CLI in CI)
Skills & Agents
Skill toolDiscovers built-in slash commands (/init, /review, /security-review, …)
/code-review [effort]Code review; `--fix` flag applies findings to working tree
/batchLarge parallel changes (5-30 worktrees)
/debug [desc]Troubleshoot from debug log
/loop [interval] [prompt]Recurring scheduled task
/claude-apiLoad API + SDK reference into context
.claude/skills/<name>/Project skills (shared via VCS)
~/.claude/skills/<name>/Personal skills (all projects)
SKILL.mdSkill entry file with YAML frontmatter + prompt body
scripts/Optional executables invoked by the skill
references/Optional docs loaded on demand via progressive disclosure
descriptionAuto-invocation trigger (highest-leverage line)
allowed-toolsSkip permission prompts for listed tools
disallowed-toolsBlock specific tools from the skill
modelOverride model for this skill (e.g. `sonnet`, `haiku`, `opus`)
effortOverride effort level (`low` / `medium` / `high`)
paths: [globs]Restrict skill to matching paths (YAML list)
context: forkRun the skill in an isolated subagent context
$ARGUMENTSUser input placeholder inside the prompt body
${CLAUDE_SKILL_DIR}Absolute path to the skill's own directory
${CLAUDE_EFFORT}Current effort level (skill variable)
`` !`cmd` ``Dynamic context injection (runs at skill load)
plugin bin/Ship executables usable via the Bash tool
ExploreFast read-only research agent (Haiku, cheap)
PlanResearch + design agent for plan mode
GeneralFull toolset, complex multi-step tasks
BashTerminal agent with its own separate context
permissionMode`default` / `acceptEdits` / `plan` / `dontAsk` / `bypassPermissions`
isolation: worktreeRun the agent in a dedicated git worktree
memory: user|project|localPersistent memory scope for the agent
background: trueRun as a background task (see `Ctrl+B`, `/workflows`)
maxTurnsCap agentic turns to prevent runaway loops
initialPromptAuto-submit the first turn on agent start
SendMessageResume a running agent (replaces the older `resume`)
@agent-nameMention a named subagent from the main chat