Claude Code Cheat Sheet
Claude Code Cheat Sheet
Claude Code v2.1.81 Last updated: March 23, 2026
📋 Recent Changes ✕
--bare flag — minimal headless mode (no hooks/LSP/plugins) --channels — permission relay & MCP push messages (preview) effort frontmatter for skills & slash commands /fork renamed to /branch (alias kept) SendMessage auto-resumes stopped agents
⌨️ Keyboard Shortcuts
General Controls CtrlC Cancel input/generation CtrlD Exit session CtrlL Clear screen CtrlO Toggle verbose output CtrlR Reverse search history CtrlG Open prompt in editor CtrlB Background running task CtrlT Toggle task list CtrlV Paste image CtrlF Kill background agents (×2) EscEsc Rewind / undo Mode Switching ShiftTab Cycle permission modes AltP Switch model AltT Toggle thinking Input \Enter Newline (quick) CtrlJ Newline (control seq) Prefixes / Slash command ! Direct bash @ File mention + autocomplete Session Picker ↑↓ Navigate ←→ Expand/collapse P Preview R Rename / Search A All projects B Current branch
🔌 MCP Servers
Add Servers --transport http Remote HTTP (recommended) --transport stdio Local process --transport sse Remote SSE Scopes Local ~/.claude.json (per project) Project .mcp.json (shared/VCS) User ~/.claude.json (global) Manage /mcp Interactive UI claude mcp list List all servers claude mcp serve CC as MCP server Elicitation Servers request input mid-taskNEW
⚡ Slash Commands
Session /clear Clear conversation /compact [focus] Compact context /resume Resume/switch session /rename [name] Name current session /branch [name] Branch conversation (/fork alias) /cost Token usage stats /context Visualize context (grid) /diff Interactive diff viewer /copy Copy last response /export Export conversation Config /config Open settings /model [model] Switch model (←→ effort) /fast [on|off] Toggle fast mode /vim Toggle vim mode /theme Change color theme /permissions View/update permissions /effort [level] Set effort (low/med/high)NEW /color [color] Set prompt-bar color Tools /init Create CLAUDE.md /memory Edit CLAUDE.md files /mcp Manage MCP servers /hooks Manage hooks /skills List available skills /agents Manage agents /chrome Chrome integration /reload-plugins Hot-reload plugins Special /btw <question> Side question (no context) /plan [desc] Plan mode (+ auto-start) /loop [interval] Schedule recurring task /voice Push-to-talk voice (20 langs) /doctor Diagnose installation /rc Enable remote control /pr-comments [PR] Fetch GitHub PR comments /stats Usage streaks & prefs /insights Analyze sessions report /desktop Continue in Desktop app /remote-control Bridge terminal to claude.ai/codeNEW /stickers Order stickers! 🎉
📁 Memory & Files
CLAUDE.md Locations ./CLAUDE.md Project (team-shared) ~/.claude/CLAUDE.md Personal (all projects) /etc/claude-code/ Managed (org-wide) Rules & Import .claude/rules/*.md Project rules ~/.claude/rules/*.md User rules paths: frontmatter Path-specific rules @path/to/file Import in CLAUDE.md Auto Memory ~/.claude/projects/<proj>/memory/ MEMORY.md + topic files, auto-loaded
🧠 Workflows & Tips
Plan Mode ShiftTab Normal → Auto → Plan --permission-mode plan Start in plan mode Thinking & Effort AltT Toggle thinking on/off "ultrathink" Max effort for turn CtrlO See thinking (verbose) /effort ○ low · ◐ med · ● highNEW Git Worktrees --worktree name Isolated branch per feature isolation: worktree Agent in own worktree sparsePaths Checkout only needed dirsNEW /batch Auto-creates worktrees Voice Mode /voice Enable push-to-talk Space (hold) Record, release to send 20 languages EN, ES, FR, DE, CZ, PL… Context Management /context Usage + optimization tips /compact [focus] Compress with focus Auto-compact ~95% capacity 1M context Opus 4.6 (Max/Team/Ent) CLAUDE.md Survives compaction! Session Power Moves claude -c Continue last conv claude -r "name" Resume by name /btw question Side Q, no context cost SDK / Headless claude -p "query" Non-interactive --output-format json Structured output --max-budget-usd 5 Cost cap cat file | claude -p Pipe input Scheduling & Remote /loop 5m msg Recurring task /rc Remote control --remote Web session on claude.ai
⚙️ Config & Env
Config Files ~/.claude/settings.json User settings .claude/settings.json Project (shared) .claude/settings.local.json Local only ~/.claude.json OAuth, MCP, state .mcp.json Project MCP servers Key Settings modelOverrides Map model picker → custom IDs autoMemoryDirectory Custom memory dir worktree.sparsePaths Sparse checkout dirsNEW Key Env Vars ANTHROPIC_API_KEY ANTHROPIC_MODEL CLAUDE_CODE_EFFORT_LEVEL low/med/high MAX_THINKING_TOKENS 0=off ANTHROPIC_CUSTOM_MODEL_OPTION Custom /model entry CLAUDE_CODE_PLUGIN_SEED_DIR Multiple plugin seed dirs
🔧 Skills & Agents
Built-in Skills /simplify Code review (3 parallel agents) /batch Large parallel changes (5-30 worktrees) /debug [desc] Troubleshoot from debug log /loop [interval] Recurring scheduled task /claude-api Load API + SDK reference Custom Skill Locations .claude/skills/<name>/ Project skills ~/.claude/skills/<name>/ Personal skills Skill Frontmatter description Auto-invocation trigger allowed-tools Skip permission prompts model Override model for skill effort Override effort levelNEW context: fork Run in subagent $ARGUMENTS User input placeholder ${CLAUDE_SKILL_DIR} Skill's own directory !`cmd` Dynamic context injection Built-in Agents Explore Fast read-only (Haiku) Plan Research for plan mode General Full tools, complex tasks Bash Terminal separate context Agent Frontmatter permissionMode default/acceptEdits/dontAsk/plan isolation: worktree Run in git worktree memory: user|project Persistent memory background: true Background task maxTurns Limit agentic turns SendMessage Resume agents (replaces resume)NEW
🖥️ CLI & Flags
Core Commands claude Interactive claude "q" With prompt claude -p "q" Headless claude -c Continue last claude -r "n" Resume claude update Update Key Flags --model Set model -w Git worktree -n / --name Session name --add-dir Add dir --agent Use agent --allowedTools Pre-approve --output-format json/stream --json-schema Structured --max-turns Limit turns --max-budget-usd Cost cap --console Auth via Anthropic Console --verbose Verbose --bare Minimal headless (no hooks/LSP)NEW --channels Permission relay / MCP pushNEW --remote Web session --chrome Chrome
Permission Modes: default prompts · acceptEdits auto-accept edits · plan read-only · dontAsk deny unless allowed · bypassPermissions skip all
Key Env Vars: ANTHROPIC_API_KEY · ANTHROPIC_MODEL · CLAUDE_CODE_EFFORT_LEVEL (low/med/high) · MAX_THINKING_TOKENS (0=off) · CLAUDE_CODE_MAX_OUTPUT_TOKENS (def 32K) · CLAUDE_CODE_DISABLE_CRON |
Claude Code v2.1.81 represents a significant evolution in the code assistant, introducing several key advancements aimed at enhancing developer productivity and workflow management. The update focuses heavily on improved memory management, enhanced control over agent behavior, and streamlined integration with MCP (Mission Control Platform) servers. A major shift is the introduction of the `--bare` flag, offering a minimal headless mode without hooks, LSP, or plugins, catering to advanced users requiring a lightweight environment.
Several interface changes are worth noting, including the renaming of `/fork` to `/branch`, maintaining the existing alias for convenience. The auto-resumption of SendMessage agents has been disabled, prompting the user to actively manage agent states. Furthermore, the addition of “effort frontmatter” within skills and slash commands allows for granular control over the agent's intensity, configurable through the `/effort` command. The introduction of channels and MCP push messages via permission relay represents a preview feature enabling advanced scenarios.
Memory management has been improved with the addition of auto-memory and rules/import functionalities which allow for the storage and management of project data within a structured CLAUDE.md format. This system integrates local, project, and organization-wide settings, facilitating efficient knowledge sharing and contextual awareness. The worktree feature adds isolation and sparse paths capabilities, allowing developers to manage parallel branches and files efficiently—benefiting significantly from the “batch” command.
The slash command system has been expanded, adding features like /copy, /export, /stats, /insights, and desktop continuation. New commands such as /btw, /plan, /loop, /voice, /doctor, /rc, and /pr-comments have been introduced, creating more interactive and dynamic control.
Configuration options include model selection via `/model`, theme customization with `/color`, and permission management via `/permissions`. Furthermore, several key environment variables such as `ANTHROPIC_API_KEY`, `CLAUDE_CODE_EFFORT_LEVEL`, and `MAX_THINKING_TOKENS` can be adjusted.
The update includes a robust set of built-in skills, including /simplify (code review), /batch (large parallel changes), /debug (troubleshooting), and /loop (recurring tasks). These are supported by a range of agents, including explore, plan, and general, each designed to address specific development tasks. The SDK and headless capabilities continue to be supported, enabling integration with various development tools and environments. The CLI and flags provide flexible control over the assistant's behavior, with options for setting models, managing worktrees, input methods, and output formats.
Permission Modes continue to be a cornerstone of the assistant’s functionality, offering distinct behavioral settings based on the individual's needs and the specific task at hand. Key environment variables, like `ANTHROPIC_API_KEY` and model overrides, contribute to a highly customizable and adaptable development environment. |