This cheat sheet covers the Claude Code commands people actually use: session commands, setup commands, review commands, integrations, MCP commands, agent skills, and CLI flags.
It combines the public command set with newer 2026 additions, while also noting hidden or leak-based command names that appear in source references.
If you want one clean reference instead of scattered changelogs and half-complete lists, this is the version to keep open beside your terminal.
Last audited: May 06, 2026
Table Of Contents
- Session and Context Commands
- Setup, Config, and Environment Commands
- Skills, Agents, Plugins, and MCP Commands
- Coding, Review, and Planning Commands
- Git, PR, and Release Commands
- Integration, Remote, and Device Commands
- Diagnostics, Internal, and Experimental Commands
- Claude Code CLI Commands and Flags
- Real Workflows
Session and Context Commands
Use these commands to manage conversation state, context size, checkpoints, and session history.
| Command | What it does | Notes |
|---|---|---|
/branch [name] | Branches or forks the current conversation or workflow. | /fork appears as an alias in some references. |
/clear | Clears the current conversation context. | Useful when switching to a different task. |
/compact [focus] | Compresses the session to save context tokens. | Example: /compact keep API decisions only |
/context | Shows how the context window is being used. | Useful before compacting. |
/copy [N] | Copies the latest response or a selected response. | Common for code and generated text. |
/cost | Opens cost information. | Merged into /usage in v2.1.118; still works as a shortcut to the relevant Usage tab. |
/diff | Opens an interactive diff viewer. | Useful before review or commit. |
/export [filename] | Exports the conversation. | Commonly used for Markdown exports. |
/rename [name] | Renames the current session. | Useful when juggling multiple tasks. |
/resume [session] | Reopens an earlier session. | Supports named sessions and session titles set via /rename or –name. Resume behavior was improved across recent releases. Press Ctrl+A to show all projects |
/rewind | Rewinds to an earlier checkpoint or state. | Useful when the conversation goes off track. Alias: /undo |
/status | Shows current session and environment status. | Good command to run first. |
/summary | Generates a session summary. | Seen in leak-based references; may not appear in standard public builds. |
/session | Opens session management UI. | Seen in leak-based references; may not appear in standard public builds. |
/share | Shares a session. | Seen in leak-based references; may not appear in standard public builds. |
Setup, Config, and Environment Commands
Use these commands to configure Claude Code, manage memory, adjust permissions, and control the local environment.
| Command | What it does | Notes |
|---|---|---|
/add-dir <path> | Adds another directory to the working scope. | Useful for monorepos and adjacent projects. |
/color [color] | Changes the session accent color. | Now syncs the accent color to claude.ai/code when Remote Control is connected. |
/config | Opens Claude Code settings. | Editor mode now lives here. |
/doctor | Runs diagnostics. | Useful after install or upgrade issues. You can press f to let Claude fix reported issues. |
/effort [low|medium|high|xhigh|max|auto] | Controls reasoning effort. | xhigh was added for Opus 4.7+. Running /effort without arguments now opens an interactive slider. |
/env | Shows or manages environment settings. | Seen in leak-based references; may not appear in standard public builds. |
/fast [on|off] | Toggles fast mode. | Useful for rapid iteration. |
/help | Shows help and available commands. | Good fallback when commands change. |
/hooks | Manages hook scripts and hook events. | Hooks can now invoke MCP tools directly with type: "mcp_tool". |
/init | Creates CLAUDE.md for project instructions. | One of the most important setup commands. |
/init-verifiers | Sets up verifier hooks. | Seen in leak-based references; may not appear in standard public builds. |
/keybindings | Customizes keyboard shortcuts. | Useful for heavy daily use. |
/login | Signs in to Claude Code. | Supports current auth flows. |
/logout | Signs out. | Clears the active auth session. |
/memory | Opens or edits Claude memory files. | Includes CLAUDE.md workflows. |
/model [model] | Switches the active model. | Useful for balancing speed and depth. Gateway /v1/models discovery for the model picker is now opt-in via CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1. |
/output-style [style] | Changes response formatting style. | Useful for concise vs detailed output. |
/permissions | Manages permission mode and recent denials. | Useful when commands are blocked. |
/privacy-settings | Opens privacy or data settings. | Seen in leak-based references; may not appear in standard public builds. |
/sandbox | Opens sandbox controls. | Public name used in current references. |
/sandbox-toggle | Internal sandbox toggle name. | Leak-based/internal naming. |
/team-onboarding | Generates a teammate ramp-up guide from your local Claude Code usage. | Added in v2.1.101. |
/terminal-setup | Configures terminal integration. | Public name. |
/terminalSetup | Internal camelCase form of /terminal-setup. | Leak-based/internal naming. |
/theme | Changes or creates themes. | Supports Auto (match terminal), named custom themes, JSON themes in ~/.claude/themes/, and plugin-shipped themes. |
/tui | Switches the terminal UI mode. | Switch terminal UI mode; use /tui fullscreen for flicker-free rendering in the same conversation. |
Vim mode | Editor mode available through /config. | /vim slash command was removed in v2.1.92, but Vim mode now supports visual mode (v) and visual-line mode (V). |
Skills, Agents, Plugins, and MCP Commands
Use these commands to extend Claude Code with skills, agents, plugins, and connected MCP servers.
| Command | What it does | Notes |
|---|---|---|
/agents | Manages subagents. | Public command. Newer versions add clearer running-agent indicators and a better tabbed layout. |
/bridge | Manages IDE or bridge sessions. | Seen in leak-based references; may not appear in standard public builds. |
/bridge-kick | Force-restarts a bridge connection. | Seen in leak-based references; may not appear in standard public builds. |
/claude-api | Loads the Claude API or SDK helper workflow. | Useful for API-related work. Updated to cover Managed Agents in recent versions. |
/less-permission-prompts | Scans transcripts for common read-only Bash and MCP tool calls and proposes a prioritized allowlist for .claude/settings.json. | Added in v2.1.111 |
/mcp | Manages MCP servers. | Also unlocks dynamic MCP slash commands. |
/plugin | Opens plugin management. | Public command. Newer versions warn when the marketplace could not be refreshed instead of silently showing stale plugin versions. In v2.1.110, the Installed tab also surfaces items needing attention and favorites more clearly. |
/reload-plugins | Hot-reloads installed plugins. | Useful while testing plugins. Newer versions also pick up plugin-provided skills more reliably, and v2.1.110 adds Remote Control support. |
/skills | Lists available skills. | Public command. |
MCP Slash Command Pattern
Claude Code can generate commands dynamically from connected MCP servers:
/mcp__[server]__[prompt] [args]Examples:
/mcp__github__list_prs/mcp__github__create_pr/mcp__jira__create_issue/mcp__linear__get_sprint
These commands only appear after the relevant MCP server is connected.
Coding, Review, and Planning Commands
These commands are the ones most people use during real development work.
| Command | What it does | Notes |
|---|---|---|
/advisor | Architecture or design advice workflow. | Seen in leak-based references; may not appear in standard public builds. |
/batch | Applies one change across many files or worktrees. | Good for repetitive project-wide edits. |
/brief | Brief-output mode toggle. | Seen in leak-based references; may not appear in standard public builds. |
/btw <question> | Asks a side question without pulling in the full task context. | Useful for quick clarifications. |
/bughunter | Bug-finding workflow. | Seen in leak-based references; may not appear in standard public builds. |
/debug [desc] | Runs a guided debugging workflow. | Good for tracing bugs step by step. |
/extra-usage | Shows extended usage detail. | Seen in leak-based references; may not appear in standard public builds. |
/feedback | Sends feedback. | Public command. |
/focus | Toggles Focus view. | Focus view is no longer tied to Ctrl+O. |
/files | Lists files in the current context. | Seen in leak-based references; may not appear in standard public builds. |
/insights | Shows usage or session insights. | Public command. |
/loop [interval] | Runs a recurring or scheduled workflow. | Useful for periodic checks and automations. Alias: /proactive. |
/passes | Runs a multi-pass workflow. | Seen in leak-based references; may not appear in standard public builds. |
/plan [desc] | Switches into plan mode. | Useful before larger changes. |
/powerup | Opens interactive feature lessons. | Added in 2026. |
/pr-comments [PR] | Fetches GitHub PR comments. | Public name. |
/pr_comments | Internal underscore form of /pr-comments. | Leak-based/internal naming. |
/rate-limit-options | Opens rate-limit options. | Seen in leak-based references; may not appear in standard public builds. |
/release-notes | Opens release notes. | Public command. |
/review | Reviews current code changes. | One of the most-used coding commands. |
/security-review | Runs a security-focused review. | Useful before merge or release. |
/simplify | Runs a multi-agent refactor workflow. | Good for structural improvements. |
/stats | Opens usage statistics. | Merged into /usage in v2.1.118; still works as a shortcut to the relevant Usage tab. |
/tag | Legacy tag command. | Removed in v2.1.92. |
/tasks | Manages background tasks. | Seen in leak-based references; may not appear in standard public builds. |
/ultraplan | Runs a more detailed planning workflow. | Remote-session flows now auto-create a default cloud environment in newer versions. |
/ultrareview [PR#] | Runs a comprehensive cloud code review using parallel multi-agent analysis and critique. | Use it with no arguments to review the current branch, or pass a PR number to review a specific GitHub PR. |
/usage | Shows plan limits, quota usage, cost, and statistics. | /cost and /stats now open the relevant tabs inside /usage. |
Git, PR, and Release Commands
These commands are related to branches, commits, pull requests, and release workflows.
| Command | What it does | Notes |
|---|---|---|
/commit | Generates a commit message and commits changes. | Common in community and leak-based command lists. |
/commit-push-pr | Commits, pushes, and opens a PR in one flow. | Seen in leak-based references; may not appear in standard public builds. |
/fix-pipeline | Tries to repair a failing CI pipeline. | Common custom/community command. |
/install-github-app | Sets up GitHub app integration. | Public command. |
/issue | Files a GitHub issue. | Seen in leak-based references; may not appear in standard public builds. |
/lint | Runs linting commands. | Common custom/community command. |
/merge-to-main | Handles merge-to-main workflow. | Common custom/community command. |
/pr | Creates a pull request. | Common custom/community command. |
/push | Pushes the current branch. | Common custom/community command. |
/vitest | Runs Vitest-based test workflows. | Common custom/community command. |
Integration, Remote, and Device Commands
Use these commands when working across IDEs, browsers, desktops, mobile, or remote environments.
| Command | What it does | Notes |
|---|---|---|
/chrome | Opens Chrome integration. | Public command, though availability varies. |
/desktop | Hands off to the desktop app. | Public command. |
/ide | Opens or manages IDE integration. | Public command. |
/mobile | Hands off to mobile or opens mobile integration. | Seen in leak-based references; may not appear in standard public builds. |
/oauth-refresh | Refreshes OAuth tokens. | Seen in leak-based references; may not appear in standard public builds. |
/onboarding | Starts first-run onboarding. | Seen in leak-based references; may not appear in standard public builds. |
/rc | Starts remote control. | Public short form. |
/remote-control | Full remote-control command name. | Public command. Remote-session features continue to expand in newer versions. |
/remote-env | Configures remote environments. | Public command. Remote-session planning features can now auto-create a default cloud environment. |
/remote-setup | Sets up a remote session. | Seen in leak-based references; may not appear in standard public builds. |
/schedule | Manages cloud scheduled tasks. | Public command. |
/teleport | Transfers or bridges sessions. | Public command. |
/voice | Enables push-to-talk voice mode. | Public command. |
Diagnostics, Internal, and Experimental Commands
These are mostly internal, debug-oriented, experimental, or source-leak command names.
| Command | What it does | Notes |
|---|---|---|
/ant-trace | Anthropic internal tracing. | Internal/leak-based. |
/autofix-pr | Auto-fixes PR issues. | Internal/leak-based. |
/backfill-sessions | Backfills session data. | Internal/leak-based. |
/break-cache | Invalidates caches. | Internal/leak-based. |
/ctx_viz | Debug context visualization. | Internal/leak-based. |
/debug-tool-call | Debugs a specific tool call. | Internal/leak-based. |
/good-claude | Easter egg command. | Leak-based. |
/heapdump | Dumps heap for memory analysis. | Internal/leak-based. |
/mock-limits | Mocks rate limits for testing. | Internal/leak-based. |
/perf-issue | Reports a performance issue. | Internal/leak-based. |
/reset-limits | Resets rate limits. | Internal/leak-based. |
/statusline | Customizes the status line. | Leak-based; may not appear in standard public builds. |
/stickers | Easter egg or promo command. | Public but non-essential. |
/thinkback | Replays or analyzes thinking. | Internal/leak-based. |
/thinkback-play | Animated thinking replay. | Internal/leak-based. |
/upgrade | Runs upgrade flow. | Seen in leak-based references; may not appear in standard public builds. |
/version | Shows Claude Code version. | Seen in leak-based references; may not appear in standard public builds. |
/x402 | x402 payment-protocol integration. | Internal/leak-based. |
/buddy | Temporary April 1st easter egg. | Limited and non-essential. |
/exit | Exits Claude Code. | Core command, but included here as a general utility. |
Claude Code CLI Commands and Flags
Many users searching for Claude Code commands actually want terminal commands. These are the main ones.
Core CLI Commands
| CLI command | What it does |
|---|---|
claude | Starts interactive Claude Code. |
claude "prompt" | Starts interactive Claude Code with an initial prompt. |
claude -p "prompt" | Runs a non-interactive single prompt. |
claude -c | Continues the last conversation. |
claude -r "name" | Resumes a named session. |
claude update | Updates Claude Code. |
claude mcp list | Lists configured MCP servers. |
claude mcp serve | Runs Claude Code as an MCP server. |
claude plugin tag | Creates release git tags for plugins with version validation. |
Important CLI Flags
| Flag | What it does |
|---|---|
--model | Sets the model. |
-w, --worktree | Uses a git worktree. |
-n, --name | Names the session. |
--add-dir | Adds a directory to scope. |
--agent | Selects an agent. |
--allowedTools | Pre-approves tools. |
--output-format | Sets machine-readable output such as JSON. |
--json-schema | Requests structured output. |
--max-turns | Limits agentic turns. |
--max-budget-usd | Caps spend. |
--console | Uses Anthropic Console auth. |
--verbose | Enables more verbose output. |
--bare | Minimal headless mode. |
--channels | Enables channel or MCP push permission relay. |
--remote | Starts a remote or web-backed session. |
--effort | Sets reasoning effort level. |
--permission-mode | Sets permission behavior such as plan. |
--dangerously-skip-permissions | Skips permission prompts. |
--chrome | Enables Chrome integration mode. |
--plugin-url <url> | Fetches a plugin .zip archive from a URL for the current session. |
--transport http|stdio|sse | Selects MCP transport. |
--remote-control-session-name-prefix | Prefixes Remote Control session names. |
Useful Environment Variables
| Variable | What it does |
|---|---|
CLAUDE_CODE_CERT_STORE=bundled | Uses bundled CAs only instead of the OS certificate store. |
CLAUDE_CODE_PERFORCE_MODE=1 | Makes Edit/Write/NotebookEdit fail on read-only Perforce files with a p4 edit hint. |
CLAUDE_CODE_SCRIPT_CAPS | Limits per-session script invocations. |
CLAUDE_CODE_USE_MANTLE=1 | Enables Amazon Bedrock powered by Mantle. |
DISABLE_UPDATES | Completely blocks all update paths, including manual claude update. Stricter than DISABLE_AUTOUPDATER. |
CLAUDE_CODE_USE_POWERSHELL_TOOL | Opts into or out of the PowerShell tool rollout. On Linux and macOS, set it to 1 to enable the PowerShell tool when pwsh is available. |
CLAUDE_CODE_FORCE_SYNC_OUTPUT=1 | Forces synchronized output on terminals where auto-detection misses it, such as Emacs eat. |
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE | Lets Homebrew or WinGet installations run package-manager upgrades in the background, then prompt for restart. |
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 | Enables gateway /v1/models discovery for the /model picker. This is now opt-in. |
Real Workflows
Start a New Repository
/init
/status
/modelThis initializes CLAUDE.md, checks the environment, and sets the model.
Onboard a New Teammate
/team-onboarding
/init
/memory
This is useful for turning existing local Claude Code usage into a ramp-up guide, then pairing it with the project’s CLAUDE.md and memory files.
Understand an Unfamiliar Codebase
/status
/context
/plan map the project structure and main entry pointsThis gives a quick environment check, shows loaded context, and builds a plan before editing anything.
Review a Pull Request
/review
/security-review
/pr-comments
/diffThis covers review, security, feedback, and final diff inspection.
Prepare a Safe Refactor
/review
/plan refactor the auth flow without changing behavior
/diffThis is a good sequence before touching critical code paths.
Manage a Long Session
/context
/compact keep decisions only
/costThis checks context size, compacts it, and shows the cost impact.
Run a Multi-File Refactor
/review
/simplify
/batch rename OldThing NewThingThis is a clean sequence for review, simplification, and broad edits.
Fix a Bug in Stages
/debug trace the failing checkout flow
/review
/diffThis works well when the issue is unclear, and you want to inspect the final change carefully.
Work With PR Feedback
/pr-comments 123
/review
/diffThis is useful when you want to address reviewer comments and re-check the final patch.
Switch Between Tasks
/rename feature-auth
/clear
/resume feature-authThis keeps sessions separate and makes it easier to return to a task later.
Set Up MCP and Use It Immediately
/mcp
/mcp__github__list_prs
/mcp__jira__create_issueThis goes from the MCP setup to the actual server commands quickly.
Work Across Devices
/remote-control
/remote-env
/teleportThis covers the main remote workflow commands in one place.
Learn What Changed After an Update
/powerup
/help
/release-notesUse this after an update to check release changes, diagnose environment issues, and review any settings affected by the new version.
Review Usage and Limits
/usage
/cost
/statsThis is the quickest way to check activity, plan limits, and session cost.
Start a Headless One-Off Task
claude -p "review this diff and list risks"Use this when you want one result and do not need an interactive session.
Run a Deep Cloud Review
/review
/ultrareview
/pr-commentsUse this when a normal review is not enough and you want a deeper cloud-based review pass before merging.
Reduce Repetitive Permission Prompts
/less-permission-prompts
/permissions
/hooksUse this after a few real sessions to identify safe read-only commands and build a cleaner allowlist for future work.
Check Usage from Remote Control
/extra-usage
/context
/exitThis is useful when checking usage and session state from a Remote Control client without going back to the local terminal.
FAQs:
Q: What is Claude Code?
A: Claude Code is Anthropic’s terminal-based AI coding agent. It runs locally via the CLI (npm install -g @anthropic-ai/claude-code), reads and edits your actual project files, executes shell commands, runs tests, and manages git operations.
Q: What is the difference between a slash command and a prompt in Claude Code?
A: A prompt is what you type to give Claude a coding task: “refactor this function,” “write a test for this endpoint.” A slash command controls the session itself.
Q: What is CLAUDE.md and what goes in it?
A: CLAUDE.md is a Markdown file in your project root that Claude reads at the start of every session in that repository. It acts as a persistent project brief.
Q: What is the difference between /clear and /compact?
A: /clear deletes all conversation history. The context window is empty after running it, but file edits made during the session remain. /compact replaces conversation history with a compressed summary, preserving the thread of what was discussed. Use /compact when you want Claude to remember context from earlier in the session but need to free up token budget. Use /clear when you are switching to a completely different task and do not need any prior context.
Q: What does /plan actually do in Claude Code?
A: /plan toggles plan permission mode. In this mode, Claude proposes each tool action and waits for your approval before executing it. Use it when working in an unfamiliar codebase or before a large refactor you want to review step by step.
Q: How do I create a custom slash command in Claude Code?
A: Create a Markdown file at .claude/commands/[name].md in your project (for team-shared commands) or ~/.claude/commands/[name].md (for personal commands available in all projects). The filename without the .md extension becomes the command name. The file content is the prompt Claude receives when the command runs. Add a YAML-style frontmatter block at the top to specify which tools the command can use, which model to run it with, and a description that appears in /help. Use $ARGUMENTS in the file content to capture whatever text is passed after the command name.
Q: Can Claude Code connect to GitHub?
A: Yes, in two ways. First, /install-github-app sets up the Claude GitHub App, which lets Claude participate in pull request workflows via GitHub Actions. Second, connecting a GitHub MCP server via /mcp exposes GitHub API operations as slash commands directly in your session (e.g., /mcp__github__list_prs, /mcp__github__create_pr).
Q: How do I reduce costs when using Claude Code?
A: Several approaches work well in combination. Switch to Haiku for mechanical tasks (/model haiku) and back to Opus or Sonnet for complex reasoning. Use /effort low for quick iteration tasks where deep reasoning is not necessary. Use /usage as the main usage screen; /cost and /stats now open the relevant tabs inside it. For custom commands that run frequently, add model: haiku to the frontmatter.
Q: What is the difference between /doctor and /status in Claude Code?
A: /doctor actively tests your environment. It reports failures with actionable error messages. /status reads and displays your current configuration, such as the active model, permission mode, connected MCP servers, and tool state. Run /doctor after installation, after upgrading, or when Claude Code behaves unexpectedly. Run /status at the start of a session to confirm settings before starting work.
Q: Can Claude Code be used in a CI/CD pipeline?
A: Yes. Claude Code supports a non-interactive print mode (claude -p "your prompt") that executes a single prompt and exits, making it scriptable in any CI environment. The --output-format json flag structures the output for programmatic parsing. For GitHub specifically, /install-github-app sets up the official Claude GitHub Actions integration. The /hooks command also allows HTTP webhooks on lifecycle events, which can trigger external CI systems when Claude completes a task or uses a specific tool.
Q: What MCP servers work with Claude Code?
A: Any server that implements the Model Context Protocol can be connected. Once connected via /mcp, each server’s prompts appear as slash commands in the /mcp__[server]__[prompt] format.
Q: What is the difference between /focus and Ctrl+O in Claude Code?
A: As of v2.1.110, Ctrl+O only toggles between the normal and verbose transcript. Focus view is now controlled separately with /focus. If you want the cleaner, stripped-down focus view, use /focus. If you want transcript verbosity changes, use Ctrl+O.
Q: What does /effort do in Claude Code now?
A: /effort controls how much reasoning Claude uses for a task. As of v2.1.111, Opus 4.7 also supports xhigh, which sits between high and max. Running /effort without arguments now opens an interactive slider so you can adjust it visually.
Related Resources
- awesome-claude-code: A curated list of awesome tools, IDE integrations, frameworks, and other resources for developers working with Anthropic’s Claude Code.
- Best Agent Skills: 10 Best Free Agent Skills for Claude Code & AI Workflows.
- Claude Code Slash Commands Cheatsheet: The most complete, verified reference for every Claude Code slash command.
- OpenAI Codex Commands Cheat Sheet: CLI commands, slash commands, flags, config keys, environment variables, sandbox settings, MCP, and real workflows.
- AI Coding Agents: 7 Best CLI AI Coding Agents.
- Best Web Dev Tools: 10 Best Free AI Tools for Frontend Developers








