Table of Contents
Introduction
Claude Code is Anthropic's agentic coding tool that lives in your terminal, IDE, and browser. It reads your codebase, edits files, runs commands, and integrates with development tools through MCP servers and plugins. With dozens of built-in slash commands, CLI flags, bundled skills, and keyboard shortcuts, it can be hard to remember everything that is available.
This cheat sheet compiles the most useful Claude Code commands into one color-coded, printable reference that you can keep next to your terminal. Hit the print button below to get a clean A3 landscape version, or scroll through the full reference on this page.
Claude Code Cheat Sheet
Slash Commands · CLI Flags · Keyboard Shortcuts · April 2026 Edition| /clear | Wipe conversation history (/reset /new) |
| /compact [focus] | Summarize context, keep key info |
| /resume [id] | Resume a past session (/continue) |
| /rename [name] | Name the current session |
| /branch [name] | Fork conversation at this point (/fork) |
| /rewind | Rewind to an earlier point (/checkpoint) |
| /export [file] | Export conversation as text |
| /copy [N] | Copy last (or Nth) response to clipboard |
| /exit | Exit Claude Code (/quit) |
| /context | Visualize context usage as colored grid |
| /usage | Show plan usage limits |
| /cost | Show token usage & cost stats |
| /diff | Interactive diff viewer for changes |
| /doctor | Diagnose installation & settings |
| /insights | Analyze session patterns & friction |
| /help | Show all commands |
| /release-notes | View full changelog |
| /pr-comments [PR] | Fetch GitHub PR comments |
/compact at ~80% context. Use /clear when switching tasks entirely.| /model [name] | Switch model (← → to adjust effort) |
| /effort [level] | Set low / medium / high / max / auto. max requires Opus 4.6 |
| /fast [on|off] | Toggle speed-optimized mode |
| /plan [desc] | Enter plan mode (read-only reasoning) |
| /sandbox | Toggle sandboxed execution |
| /config | Open settings UI (/settings) |
| /permissions | Manage allow/ask/deny rules (/allowed-tools) |
| /memory | Edit CLAUDE.md & auto-memory |
| /init | Bootstrap project with CLAUDE.md |
| /hooks | View lifecycle hook configs |
| /keybindings | Open keybinding config file |
| /login | Sign in to Anthropic account |
| /logout | Sign out |
| /privacy-settings | Update privacy prefs (Pro/Max) |
| /extra-usage | Configure pay-as-you-go overflow |
| /color [color] | Set prompt bar color for session |
low for quick tasks, high for complex reasoning, max for Opus 4.6 deep think (session only).| /mcp | Manage MCP server connections |
| /plugin | Manage plugins (install/remove) |
| /reload-plugins | Hot-reload all active plugins |
| /agents | Manage sub-agent configurations |
| /chrome | Configure browser automation |
| /ide | Manage IDE integrations |
| /install-github-app | Set up Claude GitHub Actions |
| /install-slack-app | Install Claude for Slack |
| /add-dir <path> | Add a working directory this session |
| /desktop | Open session in Desktop app (/app) |
| /remote-control | Enable remote from claude.ai (/rc) |
| /simplify | 3-agent parallel code review |
| /batch <task> | Run task across multiple files |
| /debug | Structured debugging workflow |
| /loop [interval] <prompt> | Schedule recurring prompt in-session |
| /schedule [desc] | Create cloud scheduled task |
| /security-review | Scan branch diff for vulnerabilities |
| /btw <question> | Quick side question (no context cost) |
/loop 5m check deploy status — supports smhd units. Session-scoped; dies on exit.| claude -p "prompt" | Non-interactive single prompt |
| --output-format json | JSON / stream-json / text output |
| --model <name> | Choose model at launch |
| --dangerously-skip-permissions | No approval prompts (CI/cron) |
| --allowedTools "Bash,Read" | Pre-approve specific tools |
| --permission-mode acceptEdits | Auto-accept file writes |
| --append-system-prompt "..." | Add to system prompt |
| --system-prompt-file f.md | Replace system prompt from file |
| --continue | Resume most recent conversation |
| --resume <id> | Resume specific session |
| --bare | Skip hooks/skills/MCP discovery |
| --json-schema '{...}' | Enforce structured output schema |
| Esc | Cancel current generation / exit menu |
| Shift+Tab | Cycle: normal → auto → plan mode |
| Ctrl+O | Toggle verbose / thinking output |
| Ctrl+R | Reverse search command history |
| Ctrl+FCtrl+F | Kill all background agents (press twice) |
| @file | Attach file/dir to context |
| !command | Run shell with conversation context |
| /vim | Enable vim keybindings in prompt |
echo 'cd /project && claude -p "$(cat prompt.md)" > output.md 2>&1' | at 21:30Session Management
Session commands control the lifecycle of your conversation with Claude Code. The most important distinction to understand is between /compact and /clear. Compacting summarizes the conversation to reclaim token space while preserving the thread of what was discussed. Clearing wipes everything and starts fresh. As a rule of thumb, compact when your context usage approaches 80%, and clear when you are switching to a completely unrelated task.
The /branch command is useful when you want to explore an alternative approach without losing your current conversation state. Think of it as a git branch for your Claude Code session. And /rewind lets you roll back both the conversation and any code changes to an earlier checkpoint.
Context & Information
Understanding your context usage is key to efficient Claude Code sessions. The /context command gives you a visual grid showing how much of the context window is consumed and by what. If you are on a paid plan, /cost breaks down token consumption and estimated costs for the current session.
The /diff command opens an interactive viewer that shows both your uncommitted git changes and the changes Claude made in each turn, so you can review exactly what happened.
Model & Mode Control
Claude Code supports multiple models and effort levels. Use /model to switch between them mid-session. The arrow keys in the model picker let you adjust the effort level simultaneously. The effort setting controls how deeply Claude reasons: low is fast and cheap for mechanical tasks, high gives thorough reasoning, and max unlocks the deepest thinking on Opus 4.6 (current session only).
/fast enables speed-optimized API settings. It is not a different model. It runs the same Opus 4.6 with faster parameters, making it ideal for rapid interactive iteration. Turn it off when cost efficiency matters more than speed.
/plan puts Claude into a read-only reasoning mode where it analyzes and plans without making changes. This is helpful for understanding complex codebases before committing to edits.
Configuration & Permissions
The /config command opens a settings interface where you can adjust theme, model preferences, output style, and editor mode. For controlling what Claude is allowed to do, /permissions lets you manage allow, ask, and deny rules at different scopes.
/memory gives you access to CLAUDE.md files and the auto-memory system. Claude builds auto-memory as it works, saving learnings like build commands and debugging insights across sessions. You can also manually edit your project's CLAUDE.md to set coding standards, architecture decisions, and conventions that Claude should follow.
The /hooks command shows your lifecycle hooks, which are shell commands that run before or after Claude Code actions. For example, you could auto-run Prettier after every file edit or execute a type check before accepting changes.
Extensions & Integrations
Claude Code's extensibility comes from MCP servers, plugins, and native integrations. The /mcp command manages your Model Context Protocol server connections, which expose external tools and data sources directly inside your session. Connected MCP servers contribute their own slash commands in the /mcp__<server>__<prompt> format.
Plugins extend Claude Code with skills, agents, hooks, and even LSP servers. Use /plugin to discover and install them from marketplaces, and /reload-plugins to hot-reload after changes without restarting.
The GitHub and Slack integrations (/install-github-app and /install-slack-app) connect Claude to your team workflows. With the GitHub app, Claude can participate in pull request reviews via GitHub Actions.
Bundled Skills
Claude Code ships with several bundled skills that appear alongside built-in commands when you type /. The standout is /simplify, which replaced the older /review command and runs a three-agent parallel code review. /batch lets you run a task across multiple files, /debug provides a structured debugging workflow, and /security-review scans the current branch diff for vulnerabilities.
For quick questions that do not need to consume context, use /btw. It fires off a side question without adding to the main conversation, keeping your context clean.
The /loop skill is particularly useful for monitoring. Give it an interval and a prompt, and it creates a cron job that fires in the background: /loop 5m check if the deployment finished. Supported units are s (seconds, rounded to nearest minute), m, h, and d. These are session-scoped and stop when you exit.
CLI Flags
The -p (or --print) flag runs Claude Code non-interactively, making it scriptable for CI, cron jobs, and automation. Combined with --output-format json and --json-schema, you can get structured, machine-readable output.
For unattended execution, --dangerously-skip-permissions skips all approval prompts. Use it with care and scope your prompts tightly. The --allowedTools flag is a more granular alternative, letting you pre-approve specific tools like Bash, Read, and Edit.
System prompt customization is available through four flags. --append-system-prompt and --system-prompt-file are the most commonly used. Appending preserves Claude Code's built-in capabilities while adding your instructions, which is the right choice for most use cases.
The --bare flag is useful for CI scripts. It skips auto-discovery of hooks, skills, plugins, MCP servers, auto-memory, and CLAUDE.md, ensuring consistent behavior across machines.
Keyboard Shortcuts
Shift+Tab is perhaps the most useful shortcut, cycling between normal mode, auto-accept mode, and plan mode. Ctrl+O toggles verbose output so you can see Claude's extended thinking. And pressing Ctrl+F twice rapidly kills all background agents, which is a lifesaver when something gets stuck.
The @ prefix lets you attach files or directories to the conversation context without waiting for Claude to read them. And the ! prefix runs a shell command directly with conversation context, so ! git status runs in your shell and the output becomes part of the conversation.
Scheduling Prompts
Claude Code supports multiple scheduling approaches. For in-session recurring work, use /loop or /schedule (which creates cloud tasks on Anthropic infrastructure). For persistent unattended execution on your own server, the at command or cron combined with claude -p works well:
echo 'cd /project && claude --dangerously-skip-permissions -p "$(cat prompt.md)" > output.md 2>&1' | at 21:30Make sure to use the full path to the claude binary, cd into your project directory first (so Claude Code picks up your CLAUDE.md and project context), and redirect both stdout and stderr to capture the full output.
Creating Custom Skills
Beyond the built-in commands, you can create your own slash commands as skills. Create a directory under .claude/skills/ in your project (for team-shared skills) or ~/.claude/skills/ (for personal skills), add a SKILL.md file with YAML frontmatter and markdown instructions, and your new command appears in the / menu automatically.
Skills support frontmatter fields like allowed-tools (to grant tool access without per-use approval), model (to override the model for that skill), context: fork (to run in a sub-agent), and disable-model-invocation: true (to prevent Claude from auto-invoking the skill). For detailed guidance, see the Skills documentation.


