Most Claude Code cheat sheets go stale within weeks. One course PDF that still ranks for this query is stamped v2.1.81 and lists /vim and /pr-comments, and both of those commands were removed before v2.1.93. This Claude Code cheat sheet was checked line by line against Anthropic’s official reference on 16 November 2026, on the build my containers run (claude --version → 2.1.292).
It’s also opinionated. Between 16 October and 14 November my fleet ran Claude Code 402 times across 20 scheduled skills with no human at the keyboard, and every one of those runs came from a single command line. So below you get two things. First, the interactive commands, shortcuts and files worth memorising. Second, the headless recipe that actually runs a business while I sleep, along with the guard rails I haven’t added yet.
Bookmark it, then check /help when something doesn’t match. The tool ships faster than any reference can follow, this one included.
How to Use This Claude Code Cheat Sheet (and Why Most Go Stale)

Claude Code ships updates constantly. The official docs already describe flags that need v2.1.302 and v2.1.319, which are newer than the 2.1.292 build in my container. The docs are written ahead of the build most people actually have installed, so any cheat sheet is really a snapshot of one moment.
Use this one in three passes:
- Check your version first. Run
claude --version. If a flag below says “requires v2.1.x” in the docs and you’re older, runclaude updateor pin a channel withclaude install stable. (I wrote up how to update Claude Code without breaking a running agent fleet separately.) - Learn the 20%. Each section below opens with the handful of entries you’ll use every day, and the long tail sits in the table after that.
- Audit any other sheet you find. Use the table below. If a sheet lists one of these as current, it’s older than you think.
Removed or renamed: what old cheat sheets still list
| Old entry | Status (official docs, 16 Nov 2026) | Use instead |
|---|---|---|
/vim | Removed in v2.1.92 | /config → Editor mode |
/pr-comments | Removed in v2.1.91 | Ask Claude to read the PR comments |
/ultraplan | Removed | Plan mode (/plan or Shift+Tab) |
--enable-auto-mode | Removed in v2.1.111 | --permission-mode auto |
/cost | Now an alias | /usage |
/stats | Now an alias | /usage (Stats tab) |
/bashes | Now an alias | /tasks |
--remote | Deprecated alias | --cloud |
Aliases still work, so old muscle memory won’t break. Removed commands just fail, and that’s usually how people discover their cheat sheet is out of date.
Claude Code CLI Commands: Start, Resume, Update

These are what you type in your shell before a session exists. The daily five are claude, claude -c, claude -r, claude -p and claude update. Everything else here is setup or maintenance.
| Command | What it does |
|---|---|
claude | Start an interactive session in the current folder |
claude "explain this project" | Start interactive with a first prompt |
claude -p "query" | Print mode: answer once, then exit (the scripting/cron entry point) |
cat logs.txt | claude -p "explain" | Pipe content in (stdin is capped at 10 MB) |
claude -c | Continue the most recent conversation in this folder |
claude -r "auth-refactor" | Resume a session by ID or name (name it with -n or /rename) |
claude update | Update to the latest version |
claude install stable | Install or pin a version or channel |
claude auth login / claude auth status | Sign in; status prints JSON and exits 0 if logged in, 1 if not |
claude doctor | Read-only install and settings diagnostics, no session started |
claude mcp | Configure MCP servers |
claude plugin install <name> | Manage plugins |
claude agents | Agent view for parallel background sessions (--json for scripts) |
claude setup-token | Long-lived OAuth token for CI and scripts (needs a subscription) |
claude purge <path> --dry-run | Preview deleting all local state for a project |
Two of these matter more for unattended work than they look. claude auth status exits non-zero when you’re logged out, so you can use it as a pre-flight check in a cron script. And claude doctor catches settings-file validation errors without spending a single token. My dispatcher doesn’t run either one before a job. It checks the log after the fact for auth-shaped errors instead, which is cheaper but slower to notice a problem.
Slash Commands Worth Memorizing (the Claude Code Cheat Sheet Core)

The official commands reference now has more than 100 entries, and some of them are bundled skills rather than built-in commands. Nobody needs all of them. Here they are grouped by the job you’re trying to do, with the ones to learn first in bold.
Keep the context clean
/clear [name]: start fresh with an empty context. Passing a name labels the old conversation in/resume./compact [instructions]: summarise the conversation so far. You can steer it, e.g./compact keep the API decisions./context: a coloured grid of what’s eating your context window, plus suggestions for fixing it./usage: session cost, plan limits and activity stats./costand/statsboth open this now./btw [question]: ask a side question without adding it to the conversation.
Steer the model
/model [model]: switch model and save it as your default for new sessions./effort [level]:lowthroughxhigh,max, orauto./plan [description]: go straight to plan mode, optionally with the task./rewind: roll back conversation and/or code to an earlier point./undoand/checkpointare aliases./fast [on|off]: toggle fast mode.
Set the project up once
/init: generate a starterCLAUDE.md. Then edit it hard, because the generated version is generic. (My notes on what belongs in a CLAUDE.md that runs a business.)/memory: edit CLAUDE.md files and switch auto memory on or off./permissions: allow, ask and deny rules by scope./hooks,/mcp,/skills,/reload-skills,/plugin: inspect and manage extensions./reload-skillspicks up skill files you edited on disk without a restart./doctor: a setup checkup that can also apply the fixes it proposes. It’s the in-session cousin ofclaude doctor.
Long-running and background work
/loop [interval] [prompt]: repeat a prompt while the session stays open./goal [condition]: keep working across turns until a condition is met./background,/tasks,/fork,/subtask: detach the session, list background work, copy the conversation into a background session, or spawn a forked subagent./schedule: cloud scheduled tasks (formerly called routines).
I’ve written about the trade-offs in two of these groups already: /loop and /goal versus a plain cron loop, and when subagents help and when they hurt. The short version is that anything you need to run every day belongs in a scheduler outside the session, not a /loop inside it. A session-bound loop stops the moment the session does.

Get the AI Playbook
The skill files, verification gates and run logs behind my unattended Claude Code agents, including the exact dispatcher line in this post. Free, and you can leave whenever you like.
Keyboard Shortcuts and Prompt Prefixes

If you only learn three shortcuts, learn Esc, Shift+Tab and Ctrl+O. Esc interrupts Claude mid-turn without losing the work done so far. Shift+Tab cycles permission modes. Ctrl+O opens the transcript, so you can see what the agent actually did instead of what it says it did.
Prompt prefixes
| Type | Effect |
|---|---|
/ at start | Command or skill |
! at start | Shell mode: run a command, add its output to the session, and have Claude respond to it |
@ | File path autocomplete (and, with cross-session messaging, your other live sessions) |
: | Emoji shortcode |
? on empty input | Toggle the shortcut help panel |
Older sheets say # adds a line to memory. That prefix isn’t in the current quick-commands table, so use /memory or just tell Claude what to remember.
Shortcuts
| Keys | What it does |
|---|---|
Esc | Interrupt Claude, or close a dialog |
Esc Esc | Clear the draft; on an empty prompt, open the rewind menu |
Shift+Tab | Cycle permission modes (Manual → acceptEdits → plan, then bypass/auto where enabled) |
Ctrl+C | Interrupt; on an idle prompt, first press clears, second exits |
Ctrl+D twice | Exit |
Ctrl+O | Transcript viewer with full tool calls |
Ctrl+R | Reverse-search prompt history |
Ctrl+G | Write the prompt in your $EDITOR |
Ctrl+B | Send running Bash commands and agents to the background |
Ctrl+T | Show/hide Claude’s task checklist |
Ctrl+S | Stash the prompt; press again on an empty prompt to restore it |
Ctrl+V (Alt+V on Windows/WSL) | Paste an image from the clipboard |
Alt+P / Option+P | Switch model without clearing the prompt |
Alt+T / Option+T | Toggle extended thinking (no effect on models that always think, such as Opus 5.5) |
Alt+O / Option+O | Toggle fast mode |
\ + Enter or Ctrl+J | New line in any terminal (Shift+Enter works natively in iTerm2, WezTerm, Ghostty, Kitty, Warp and Windows Terminal) |
macOS note: most Alt word-editing shortcuts need “Option as Meta” turned on in your terminal. Option+T works without it.
Headless Claude Code: the -p Recipe Behind 402 Unattended Runs

This is the section the other cheat sheets skip, and it’s the one that pays the bills. Every scheduled job in my brand containers calls exactly this line:

⚡ GET THE AI EDGE
Weekly AI tips that actually save you time and money. No fluff, no hype — just what works.
claude --print --dangerously-skip-permissions -p "$INSTRUCTION" < /dev/null >> "$LOG_FILE" 2>&1
Here’s what that one line did between 16 October and 14 November, measured from the dispatch logs:
- 402 runs across 20 scheduled skills, totalling 34.5 hours of wall-clock time. The median run took 4.1 minutes, and blog-writer averaged 11.0.
- 402 of 402 exited with code 0. But by their own end-of-run report, 385 succeeded, 9 skipped, 4 failed and 4 printed no result line at all. Exit code 0 doesn’t mean the job worked. My watchdog grades on the result line, not the exit code. I explained why an empty result is a claim, not a fact.
- The model is set once in
~/.claude/settings.json("model": "opus"), not per call. < /dev/nullis there so a job that would otherwise wait on stdin can’t hang forever. The scheduler also kills any slot that runs past its timeout (blog-writer gets 5,400 seconds).
The permission flag, honestly
--dangerously-skip-permissions equals --permission-mode bypassPermissions. Anthropic’s guidance is blunt: only use it “in isolated environments like containers, VMs, or dev containers without internet access.” My containers are isolated from the host but they do have internet, because every skill calls APIs. That’s a trade-off I’ve chosen knowingly, not a best practice, and I covered the blast-radius thinking in what four months of container runs taught me about the Claude Code sandbox. On your laptop, don’t copy my line.
Permission modes at a glance
| Mode | A call that would need approval… | Good for |
|---|---|---|
default (Manual) | Prompts you; in -p it’s denied unless a rule or hook approves it | Sensitive work, learning |
acceptEdits | File edits go through; other actions still prompt | Hands-on coding |
plan | Claude plans without editing | Big changes, unfamiliar repos |
auto | A classifier decides | Long sessions with fewer prompts |
dontAsk | Denied | Locked-down CI with an explicit allowlist |
bypassPermissions | Allowed | Isolated containers/VMs only |
The safer headless flags (the ones I’d add first)
claude -p "Fix the failing test in auth.py" \
--permission-mode dontAsk \
--allowedTools "Read,Edit,Bash(npm test *)" \
--max-turns 30 \
--max-budget-usd 2 \
--output-format json
--allowedTools/--disallowedTools: tool-level allow and deny rules, including scoped rules likeBash(rm *).--max-turns: caps agentic turns (print mode only; no limit by default).--max-budget-usd: stops the run at an estimated spend (print mode only). It’s a client-side estimate, so it can differ from your bill.--output-format json: the payload includestotal_cost_usd, so a script can log spend per run.--bare: skips hooks, skills, plugins, MCP servers, auto memory and CLAUDE.md for fast, reproducible CI. Don’t use it if your job depends on CLAUDE.md, as every one of mine does.--fallback-model: a model chain to try when the primary is overloaded.
My dispatcher uses none of the last five yet. Turn and budget caps are the obvious next guard rails, and the timeout is currently my only brake. If you’d rather have someone wire this kind of unattended pipeline into your own business than learn it flag by flag, that’s exactly the work I take on as done-for-you automation builds.
Files and Settings: Where Everything Lives

Half of “Claude Code ignored my instruction” problems are really “the setting lives in a different file than you think”. Here’s the map.
Instruction files (CLAUDE.md)
| Scope | Location | Shared? |
|---|---|---|
| Managed (org) | /etc/claude-code/CLAUDE.md on Linux/WSL; /Library/Application Support/ClaudeCode/CLAUDE.md on macOS | Everyone IT deploys it to |
| User | ~/.claude/CLAUDE.md | Just you, all projects |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md | Team, via git |
| Local | ./CLAUDE.local.md | Just you, this project (gitignore it) |
Auto memory, the notes Claude writes for itself, loads into every session too, but only the first 200 lines or 25 KB. If you keep your own memory file the way my agents do, give it a size alarm. I learned that the hard way when one run cut my agent’s memory file from 10,460 lines to 8.
Settings files, highest precedence first
- Managed (
managed-settings.json, MDM, or the claude.ai console). Your own files can’t override these. - Command line:
claude --settings file.jsonfor this session only. - Project local:
.claude/settings.local.json. - Shared project:
.claude/settings.json(commit it). - User:
~/.claude/settings.json.
Environment variables aren’t a level in that stack. Precedence is decided per variable, so ANTHROPIC_MODEL exported in your shell beats the model key in any file. If a model choice seems to be “ignored”, check env before you edit JSON. Skills live in .claude/skills/ (project) or ~/.claude/skills/ (user), and you call them with /skill-name. For the bigger picture on structuring all of this, see my Claude Code best practices from four months of unattended runs.
Claude Code Cheat Sheet FAQ

Is there an official Claude Code cheat sheet?
Not as a single printable page. The official sources are the CLI reference, the commands reference and the interactive-mode page at code.claude.com/docs. Inside a session, /help lists commands and ? on an empty prompt shows shortcuts. Those are always current for your installed build, which no PDF can promise.
How do I see what a session cost?
Run /usage (/cost is now an alias). For scripts, add --output-format json to claude -p and read total_cost_usd. Both are client-side estimates, so reconcile against your actual bill. If you’re still choosing a plan, here’s what Claude Code really costs in 2026.
What’s the difference between -c and -r?
-c continues the most recent conversation in the current folder. -r resumes a specific session by ID or name, or opens a picker if you pass nothing. Name important sessions with -n "name" so you can find them later.
Can I run Claude Code on a schedule?
Yes, in two ways. Inside Anthropic’s cloud, /schedule sets up scheduled tasks. On your own server, call claude -p from cron or a scheduler, which is how all 402 runs above happened. If you’re starting from zero, begin with my Claude Code tutorial for beginners and add scheduling once a single manual run works end to end.
Is --dangerously-skip-permissions safe?
Only inside something you can afford to lose: a container or VM, ideally without internet access. For anything else, use --permission-mode dontAsk with an explicit --allowedTools list, or auto mode when you’re working interactively.
Why doesn’t a command from this sheet work for me?
Almost always a version gap. Run claude --version, compare it with the version the docs mention for that feature, then claude update. The other usual cause is a managed setting from your organisation that blocks it, which you can usually spot with /status and claude doctor.
Final Thoughts: Learn a Dozen Commands, Then Automate the Rest
A Claude Code cheat sheet is useful for a week and misleading after a quarter, so don’t treat any of them as gospel, this one included. Learn the core: -p, -c, -r, /clear, /compact, /context, /model, /plan, /init, /memory, Esc, Shift+Tab and Ctrl+O. Check your version whenever something doesn’t match.
Then notice where the real leverage is. It isn’t in typing commands faster. It’s in the one claude -p line you put in a scheduler and never type again. Mine ran 402 times last month. Grade it on what it reports, not on its exit code, and add turn and budget caps before you trust it with anything that costs money. That last part is on my own list too.

Get the AI Playbook
Every week: one real job I hand to an agent, what it costs, and what broke. No fluff, unsubscribe anytime.

📥 FREE: THE AI PLAYBOOK
The exact tools and workflows I use to run a one-person agency. 25 years of marketing experience distilled into an actionable guide. Yours free.
