Cheat sheet
Claude Code: what to use when
Skills, hooks, subagents, MCP, plugins and CLAUDE.md look alike on paper, but each answers its own question. Here is the one property you choose by, where each lives, and which lesson covers it in depth.
Updated
Extending Claude Code
CLAUDE.md
CLAUDE.md in the project rootClaude should always remember facts about the project: build commands, conventions, style. It’s advice — the model can miss it.
Lesson: CLAUDE.md — stop repeating yourself →Skill
.claude/skills/<name>/SKILL.mdYou keep giving Claude the same instructions or the same sequence of steps. Only the description lives in context; the body is read when needed.
Lesson: Skill patterns →Hook
the hooks block in .claude/settings.jsonSomething must ALWAYS happen at a given moment, whatever Claude decides: block an edit, format a file, call you.
Lesson: Hooks: a rule that cannot be forgotten →Subagent
.claude/agents/A side task should run in its own context window and return only the result — so it doesn’t clutter the main conversation.
Lesson: Choosing an orchestration pattern →MCP server
.mcp.json in the project rootClaude needs tools or data outside your files: a browser, a database, an external API.
Lesson: MCP — connecting outside tools →Folder rule
.claude/rules/<topic>.md with paths in the frontmatterAn instruction only matters when working on part of the project — say, the API. It loads when Claude reads a matching file, not in every session.
Lesson: Project memory, done properly →Plugin
enabledPlugins in the settings file of the scope you wantYou want to install, or hand your team, a ready-made kit — skills, subagents, hooks and MCP — in one install.
Lesson: Plugins and marketplaces →The key difference: CLAUDE.md and skills are advice the model takes into account; a hook is a rule that always fires. If something has to happen without exception, it’s a hook.
The session, under control
| /context | how full the context window is, and with what |
| /compact … | compress the conversation and carry on with the same task; after the command, say what to keep |
| /clear | a clean slate for a new task; the old conversation is kept |
| /rewind or Esc Esc | roll code and/or the conversation back to an earlier prompt; changes made by commands are not rolled back |
| claude --continue | return to the latest conversation in this folder |
| /resume | pick any past conversation |
| Shift+Tab | switch the permission mode: Manual → Accept edits → Plan, then Auto where it’s available |
| /model, /effort | the model and the effort level; with an argument, saved as the default |
| /permissions, /hooks, /status | which rules, hooks and settings files are in effect right now |
In depth: the level that starts with “The context window”.
More slash commands you’ll use
| /init | write a starting CLAUDE.md for the project |
| /help | help, and every command available in this session |
| /mcp | connect, reconnect and sign in to MCP servers |
| /memory | edit the CLAUDE.md files in play, and turn auto memory on or off |
| /config | the settings screen: theme, model, output style; /config key=value sets one directly |
| /diff | review the changes in your working tree, including the ones Claude made |
| /review | review the current diff, a PR or a branch for bugs; another name for /code-review |
| /usage | this session’s cost, your plan’s usage limits and activity; /cost does the same |
| /doctor | check the installation, settings and CLAUDE.md, and propose fixes |
| /add-dir <path> | let Claude read and edit another folder in this session |
The full list, including commands from your plugins and skills: type /help in a session, or see the official commands reference.
Keyboard shortcuts
| Esc | stop Claude mid-reply and redirect it; the work so far stays |
| Esc Esc | clear what you typed (Up brings it back); on an empty prompt, open the rewind menu |
| Shift+Tab | cycle permission modes |
| Ctrl+C | interrupt; with nothing running, clear the prompt, and press again to exit |
| Ctrl+R | search your earlier prompts |
| Ctrl+O | the transcript: every tool call in detail |
| Ctrl+G | write the prompt in your text editor |
| Ctrl+B | send a running command or agent to the background |
| ! at the start | shell mode: run a command yourself and add its output to the conversation |
| @ | mention a file, with path autocomplete |
| / at the start | a command or a skill |
| ? on an empty prompt | the shortcut help panel |
| \ then Enter | a new line without sending; Shift+Enter works too in most modern terminals |
Command-line flags
Added when you start it: claude -c, claude -p "…" --max-turns 5. claude --help lists them all.
| -p "…" | print mode: answer once and exit — for scripts and pipes |
| -c, --continue | continue the latest conversation in this folder |
| -r, --resume [name] | resume a session by ID or name, or pick one from a list |
| -n, --name "…" | name the session, so --resume can find it by name |
| --model <alias> | the model for this session: sonnet, opus, haiku, fable, or a full model name |
| --effort <level> | the effort level for this session: low, medium, high, xhigh or max |
| --permission-mode <mode> | start in default, acceptEdits, plan, auto, dontAsk or bypassPermissions |
| -w, --worktree [name] | start in an isolated git worktree under .claude/worktrees/ |
| --allowedTools "…" | tools that run without asking, as permission rules: "Bash(npm test *)" |
| --disallowedTools "…" | deny rules for this run |
| --add-dir <path> | another folder Claude may read and edit |
| --max-turns <n> | stop after this many agentic turns (with -p) |
| --output-format <fmt> | text, json or stream-json (with -p) |
Where settings live
| ~/.claude/settings.json | you, in every project — personal habits |
| .claude/settings.json | the whole team — committed to the repository |
| .claude/settings.local.json | you, in this project — stays out of git |
Allow and deny rules from different files add up, and within them the order is fixed: deny first, then ask, then allow. An allow rule can’t override a deny. The lesson on rules →
One agent or many
Choose by who holds the plan: you, the main conversation, a script or a team.
| Yourself, in one session | the task is small and you want to see every step |
| Subagents | something needs working out on the side, returning only the result; the main conversation holds the plan |
| Workflow | many agents, double-checking findings or re-running; a script holds the plan |
| Agent team | the workers need to talk to each other; an experimental feature |
| claude --worktree | two sessions edit code at the same time — each gets its own folder and branch |
Unattended
| What | What for | Required limit |
|---|---|---|
| claude -p | one request from a script: an answer, then exit | always --permission-mode; --max-turns, --allowedTools |
| unattended run | a long task with nobody watching | dontAsk, the sandbox, --max-budget-usd, no git commit/push |
| GitHub Actions | Claude answers @claude in issues and PRs | claude_args, the token’s permissions, timeout-minutes |
| /goal | keep going until a condition is met | a checkable condition and a turn limit |
| /loop | repeat a task on an interval | ask Claude to cancel it when you’re done — Esc doesn’t stop a fixed interval; recurring tasks expire after 7 days |
| claude agents | several background sessions, each in its own worktree | open with an explicit --permission-mode |
All of it, with practice in your browser
The course “Claude Code: Pro Level”: 28 lessons with a terminal simulator and a simulated session. Free.
Open the course →Checked against the Claude Code v2.1.306 docs, October 2026.
Written by Mikhail Kuzmitskii