Claude Code cheat sheet.
Install, keybindings, slash commands, skills, hooks, MCP, subagents, plan mode — the working reference for the CLI I live in.
The ultimate reference for Claude Code. Everything here is what the fleet actually runs — 13 sites shipped, 60+ skills in production, and the guardrails that keep the harness stable. Copy freely.
Install & first run
6 entriesnpm i -g @anthropic-ai/claude-codeInstall the CLI globally. Requires Node ≥ 20.
claudeLaunch the interactive TUI in the current directory.
claude /loginSign in with your Anthropic account (browser flow).
claude --versionPrint CLI version. Update often — releases ship weekly.
claude updateSelf-update the CLI to the latest release.
claude doctorDiagnose install / permissions / MCP issues.
Everyday keybindings
8 entriesThe TUI layer — the muscle memory you build in week one pays back forever.
EnterSend the current prompt.
Shift + EnterNewline inside the prompt (multiline).
Ctrl + CCancel the running turn (interrupt tool calls).
Ctrl + DExit the session cleanly.
EscCancel autocomplete / close popups.
Up / DownCycle through prior prompts in this session.
!Prefix a line to run it as a raw shell command (result lands in context).
#Prefix to send a system-style note to the model without asking for action.
Built-in slash commands
15 entriesEverything with a leading slash is either built-in or a skill. Type / to see the picker.
/helpFull command list + docs pointers.
/clearReset the current context window (keeps CLAUDE.md loaded).
/compactManually compact history when you're low on tokens.
/configOpen the settings UI (theme, model, permissions).
/modelSwitch model mid-session (Opus / Sonnet / Haiku).
/fastToggle Fast mode on Opus 4.6/4.7 — faster output, same model.
/initCreate a CLAUDE.md scaffold from the current codebase.
/reviewReview a pull request.
/mcpList + manage MCP servers for this session.
/hooksInspect + edit the hook settings for this project.
/agentsList available subagents and their tool policies.
/goalSet a session-scoped goal with a Stop hook that keeps you focused.
/loopRun a prompt or slash command on a recurring interval.
/scheduleSchedule a remote agent (routine) on a cron.
/pushPush the current branch to origin with a pre-push summary.
CLAUDE.md — persistent context
5 entriesThe single most-leveraged file in the harness. Anything here is loaded every session.
~/CLAUDE.mdUser-scope preferences — applies to every project.
./CLAUDE.mdProject-scope — checked into the repo, applies to all contributors.
./.claude/CLAUDE.local.mdLocal-only overrides — .gitignore'd, per-machine.
Keep it smallUnder ~200 lines. Model reads it every turn — bloat costs tokens forever.
Rules > proseBulleted 'always / never' rules land better than paragraphs of context.
Skills
5 entriesReusable, invocable workflows. Live in ~/.claude/skills/<name>/SKILL.md.
~/.claude/skills/<name>/SKILL.mdThe skill definition — name, description, args, body.
description: fieldThe router. Write it as trigger phrases, not a summary.
/skill-creatorMeta-skill to create, edit, test, and optimize other skills.
plugin:skill formFully-qualified name for plugin-namespaced skills.
Args stringEverything after the skill name is passed as one args string.
Hooks
8 entriesDeterministic shell scripts that fire around tool calls. Run outside the model loop.
PreToolUseFires before a tool runs — can block or mutate arguments.
PostToolUseFires after — good for lint, format, dry-run gates.
UserPromptSubmitInjects a system reminder each time the user submits.
StopBlocks the session from ending until a condition holds (used by /goal).
SessionStart / SessionEndSet up / tear down env, log, or announce.
.claude/settings.jsonProject-scope hook config (checked into the repo).
.claude/settings.local.jsonLocal-only overrides — not committed.
/update-configSkill that safely edits settings.json for you.
MCP — external tools
6 entriesModel Context Protocol. Adds tools + resources from external services into the session.
claude mcp add <name>Register an MCP server (stdio or HTTP).
claude mcp listList configured MCP servers and their status.
claude mcp remove <name>Deregister a server.
mcp__<server>__<tool>Naming convention for MCP-provided tools in the session.
ListMcpResourcesToolEnumerate readable resources exposed by a server.
ReadMcpResourceToolFetch a resource by URI.
Subagents
7 entriesIsolated sub-Claude instances with their own context + tool policy. Great for parallel work.
~/.claude/agents/<name>.mdSubagent definition — tools, model, description.
subagent_type: ExploreFast read-only search subagent (files + grep + read).
subagent_type: PlanArchitect subagent — designs step-by-step plans.
subagent_type: general-purposeWildcard — research or multi-step tasks.
Agent toolLaunch a subagent from the main loop; get back a summary.
run_in_background: trueFire-and-forget parallel subagent (notified when done).
isolation: worktreeRun in an isolated git worktree; auto-cleanup on no-change.
Plan mode
4 entriesRead-only exploration and planning. No writes until you exit the mode.
EnterPlanModeSwitch into plan mode (usually via UI or a slash command).
ExitPlanModeCommit to a plan and get approval before implementing.
Use for big refactorsAsk for a plan before letting Claude touch files.
Combine with subagentsSend Plan-mode reads to subagents, keep main context clean.
Sessions & scheduling
5 entries/loop <interval> <cmd>Run a slash command every interval, e.g. `/loop 5m /watch-ci`.
/loop <cmd>Self-paced loop — Claude decides when to fire next.
/scheduleCreate a remote scheduled agent (routine) on a cron.
CronCreate / CronList / CronDeleteTool-level control over scheduled agents.
ScheduleWakeupIn-loop tool to pick the next wake time in dynamic loops.
Git workflow
5 entriesClaude Code is git-aware. These are the guardrails the harness enforces.
Always new commitsNever --amend or force-push unless the user explicitly asks.
Never --no-verifyHook failures are fixed at the root, not bypassed.
Add files by namePrefer `git add file1 file2` over `git add .` to avoid secrets.
gh pr createUse gh for PR/issues/checks — never guess GitHub URLs.
Co-Authored-By: ClaudeCommit trailer the CLI appends by default.
Permissions
5 entriesFine-grained control over which tools + shell commands auto-approve.
/permissionsOpen the permissions UI.
acceptEditsAuto-accept file edits (careful — pair with plan mode).
denyEditsBlock all edits (read-only mode).
permissions.allow[]Explicit allowlist of shell / tool patterns in settings.json.
/fewer-permission-promptsSkill that scans your transcript and adds safe allowlist entries.
Agent SDK & Managed Agents
4 entriesBuilding your own agent? Both paths use the same primitives as Claude Code.
npm i @anthropic-ai/claude-agent-sdkThe SDK Claude Code itself is built on.
Managed AgentsAnthropic-hosted agent runtime (April 2026 launch).
Same tool contractSkills, hooks, MCP all portable between local + managed.
/amaMaster agent skill for learning Managed Agents end-to-end.
Common gotchas
5 entriesBugs the fleet hit so you don't have to.
OpenRouter fallback orderAIOSPaid model first, then :free — free models 429 under load.
vercel link hangsAdd --non-interactive to CLI shells; --yes alone hangs.
Vercel injects AWS_REGIONSet S3_REGION explicitly or S3 mis-targets us-east-1.
WSL headed ChromiumDon't run Playwright headed via WSLg — crashes low-RAM laptops.
Mongo 500-coll capCentral cluster near 500/500 — fold to FLEET shape, don't add new collections.
Some entries reference internal fleet tooling (AIOS, APPAI, ABC skills). If you don't have those, the primitives (skills / hooks / MCP / subagents) still apply verbatim to any Claude Code install.