Skip to content
zero2vibecodelearn vibe coding

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 root

Claude 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.md

You 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.json

Something 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 root

Claude 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 frontmatter

An 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 want

You 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

/contexthow 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
/cleara clean slate for a new task; the old conversation is kept
/rewind or Esc Escroll code and/or the conversation back to an earlier prompt; changes made by commands are not rolled back
claude --continuereturn to the latest conversation in this folder
/resumepick any past conversation
Shift+Tabswitch the permission mode: Manual → Accept edits → Plan, then Auto where it’s available
/model, /effortthe model and the effort level; with an argument, saved as the default
/permissions, /hooks, /statuswhich 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

/initwrite a starting CLAUDE.md for the project
/helphelp, and every command available in this session
/mcpconnect, reconnect and sign in to MCP servers
/memoryedit the CLAUDE.md files in play, and turn auto memory on or off
/configthe settings screen: theme, model, output style; /config key=value sets one directly
/diffreview the changes in your working tree, including the ones Claude made
/reviewreview the current diff, a PR or a branch for bugs; another name for /code-review
/usagethis session’s cost, your plan’s usage limits and activity; /cost does the same
/doctorcheck 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

Escstop Claude mid-reply and redirect it; the work so far stays
Esc Escclear what you typed (Up brings it back); on an empty prompt, open the rewind menu
Shift+Tabcycle permission modes
Ctrl+Cinterrupt; with nothing running, clear the prompt, and press again to exit
Ctrl+Rsearch your earlier prompts
Ctrl+Othe transcript: every tool call in detail
Ctrl+Gwrite the prompt in your text editor
Ctrl+Bsend a running command or agent to the background
! at the startshell mode: run a command yourself and add its output to the conversation
@mention a file, with path autocomplete
/ at the starta command or a skill
? on an empty promptthe shortcut help panel
\ then Entera 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, --continuecontinue 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.jsonyou, in every project — personal habits
.claude/settings.jsonthe whole team — committed to the repository
.claude/settings.local.jsonyou, 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 sessionthe task is small and you want to see every step
Subagentssomething needs working out on the side, returning only the result; the main conversation holds the plan
Workflowmany agents, double-checking findings or re-running; a script holds the plan
Agent teamthe workers need to talk to each other; an experimental feature
claude --worktreetwo sessions edit code at the same time — each gets its own folder and branch

Unattended

WhatWhat forRequired limit
claude -pone request from a script: an answer, then exitalways --permission-mode; --max-turns, --allowedTools
unattended runa long task with nobody watchingdontAsk, the sandbox, --max-budget-usd, no git commit/push
GitHub ActionsClaude answers @claude in issues and PRsclaude_args, the token’s permissions, timeout-minutes
/goalkeep going until a condition is meta checkable condition and a turn limit
/looprepeat a task on an intervalask Claude to cancel it when you’re done — Esc doesn’t stop a fixed interval; recurring tasks expire after 7 days
claude agentsseveral background sessions, each in its own worktreeopen 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