Add-ons
Claude Code Cheat Sheet
Checked 2026-10-31
Loading poll...
This is the short list of Claude Code commands, flags, keys and file paths we reach for, each one checked against Anthropic's documentation on 31 October 2026. Start a session with claude, run one question with claude -p "...", continue with claude -c, stop with Esc, cycle modes with Shift+Tab, and manage extras with /mcp, /skills and /plugin.
Quick facts
Start a session |
|
One-shot, then exit |
|
Continue last conversation |
|
Resume by name or ID |
|
Update |
|
Health check |
|
Stop the model |
|
Cycle permission mode |
|
Add an MCP server |
|
Start and run
Command | What it does |
|---|---|
| Interactive session |
| Interactive session with a first prompt |
| Answer through the SDK, then exit |
| Pipe content in |
| Continue the most recent conversation in this directory |
| Continue, non-interactively |
| Resume a named session with a new prompt |
| Update to the latest version |
| Install or reinstall the native binary; accepts a version, |
| Read-only install and settings diagnostics without starting a session |
| Sign in, sign out, show status as JSON |
| Make a long-lived OAuth token for CI and scripts. Needs a Claude subscription |
Flags you will use
claude --help does not list every flag, so an absence there does not mean a flag is gone.
Flag | What it does |
|---|---|
| Pick the model for this session, such as |
| Set effort: |
| Start in |
| Add another working directory |
| Tools that run without a prompt, and tools to remove |
| Restrict the built-in tool set. |
| Continue or resume |
| Name the session for the resume picker |
| When resuming, start a new session ID |
| Run in an isolated git worktree under |
| Define subagents for a session / run as a given agent |
| Load MCP servers from JSON files or strings |
| Add text to the default system prompt |
| Replace the whole system prompt |
| Override settings for this session (file up to 2 MiB) |
| Minimal mode: skip auto-discovery of hooks, skills, commands, subagents, plugins, MCP servers, auto memory and CLAUDE.md |
| Start as a background agent and return |
| Debug logging, optionally filtered, such as |
| Full turn-by-turn output |
| Print the version |
Print mode only (-p)
Flag | What it does |
|---|---|
| Choose the output shape |
| Choose the input shape |
| Get validated JSON output matching a schema |
| Limit agentic turns; exits with an error at the limit |
| Stop once estimated API spend reaches this amount |
| Do not save the session to disk |
One flag to treat with care: --dangerously-skip-permissions is equivalent to --permission-mode bypassPermissions. The name is the warning. Use it only in a sandbox or container you can throw away.
Keyboard shortcuts
On macOS, the Alt shortcuts (Alt+B, Alt+F, Alt+D, Alt+Y, Alt+P) need Option set as Meta in your terminal.
General
Keys | Action |
|---|---|
| Stop the current response so you can redirect; Claude keeps work done so far |
| Clear the input draft (saved to history), or open rewind when empty |
| Interrupt; with nothing running, first press clears input, second exits |
| Exit (press twice) |
| Cycle permission modes: default, acceptEdits, plan, then bypassPermissions and auto when available |
| Switch model without clearing the prompt |
| Toggle extended thinking |
| Toggle fast mode |
| Transcript viewer: detailed tool use, with timestamps and the model per message |
| Reverse-search your command history |
| Background running commands and agents (tmux users press twice) |
| Show or hide Claude's task checklist |
| Edit your prompt in your editor |
| Paste an image |
| Stash the prompt; press again on an empty prompt to restore it |
| Redraw the screen |
| Suspend (Unix only); |
| Stop all running background subagents |
Editing the prompt
Keys | Action |
|---|---|
| Start or end of line |
| Back or forward one word |
| Delete to end of line |
| Delete to start of line |
| Delete back to the previous whitespace; one press removes a whole path |
| Delete to end of word |
| Paste deleted text, then cycle through earlier deletions |
| Undo the last input edit |
| Move through history |
Multiline input
Option+Enter (after enabling Option as Meta on macOS) and Ctrl+J start a new line. Ctrl+J works in any terminal without configuration. Run /terminal-setup to install a Shift+Enter binding in VS Code, Cursor and similar terminals.
Slash commands
The full list is in our slash commands guide. These are the ones for daily use.
Command | What it does |
|---|---|
| List commands |
| New conversation, empty context |
| Summarise to free context |
| Show what fills the context window |
| Switch and save the model |
| Set effort level |
| Enter plan mode |
| Manage tool rules |
| Pick a past conversation |
| Roll back conversation, code, or both |
| Review working-tree changes |
| Review a PR, branch or path |
| Check the branch diff for vulnerabilities |
| Create a CLAUDE.md |
| Edit CLAUDE.md files and auto memory |
| MCP connections and OAuth |
| List skills; see what each costs in context |
| Manage plugins |
| See hook configuration |
| Cost, limits, stats ( |
| Setup checkup |
| Repeat a prompt while the session is open |
| Run work in the background and manage it |
A command is recognised only at the start of your message. Up to six skills can be chained in one message: /skill-a /skill-b do XYZ.
The .claude folder
Project files live in your repo; global ones live in ~/.claude/.
File | Scope | Commit it | What it does |
|---|---|---|---|
| Project and global | Yes | Instructions loaded every session |
| Project and global | Yes | Topic-scoped instructions, optionally path-gated |
| Project and global | Yes | Permissions, hooks, env vars, model defaults |
| Project only | No | Your personal overrides |
| Project only (repo root) | Yes | Team-shared MCP servers |
| Project and global | Yes | Reusable prompts, |
| Project and global | Yes | Single-file prompts; same mechanism as skills |
| Project and global | Yes | Subagent definitions |
| Project and global | Yes | Custom instruction sets |
| Global only | n/a | Custom keyboard shortcuts |
| Global only | No | App state, account details, personal MCP servers |
Precedence, per the docs: managed settings beat every settings file, and CLI flags such as --permission-mode or --settings beat settings.json for that session.
MCP in one screen
# remote server
claude mcp add --transport http <name> <url>
# with a header
claude mcp add --transport http secure-api https://api.example.com/mcp \
--header "Authorization: Bearer your-token"
# local server (the -- separates Claude's flags from the server's)
claude mcp add --transport stdio myserver -- npx server
# with an environment variable
claude mcp add --env KEY=value --transport stdio myserver -- python server.py
# from JSON
claude mcp add-json example '{"command":"npx","args":["-y","@example/mcp-server"]}'Scope flag | Stored in | Shared |
|---|---|---|
|
| No |
|
| Yes, with an approval prompt |
|
| No |
Check servers with /mcp in a session. Sign in to an OAuth server from the shell with claude mcp login <name>. The SSE transport is deprecated; use HTTP where you can. For worked setups, see Playwright MCP, GitHub MCP and Context7 MCP, or the Claude Code MCP servers guide.
Skills, subagents and plugins in one screen
~/.claude/skills/<name>/SKILL.md personal skill, all projects
.claude/skills/<name>/SKILL.md project skill, commit it
~/.claude/agents/<name>.md personal subagent
.claude/agents/<name>.md project subagent
/plugin marketplace add <owner/repo> add a plugin marketplace
/plugin install <plugin>@<market> install a pluginSkill frontmatter you will reach for: description, disable-model-invocation: true, allowed-tools, argument-hint. Subagent frontmatter: name and description required, then tools, model, permissionMode, skills. Guides: skills, subagents, plugins.
Recipes
Review a branch from CI-style scripts
git diff main...HEAD | claude -p "Review this diff for bugs and security issues. List findings by severity." --output-format jsonCap a scripted run
claude -p "Fix the failing tests" --max-turns 10 --max-budget-usd 2Try a risky change in isolation
claude --worktree try-new-parserRead-only exploration
claude --permission-mode planResume the work you left yesterday
claude -c
claude -r "auth-refactor"Run with only the tools you choose
claude --tools "Read,Grep,Glob"A starter settings.json
The folder table says settings.json holds permissions, hooks and environment variables. A small project file removes most repeat prompts without opening the door wide. This is our suggested starting point, so edit the commands to match your project, and check the permissions page for the rule syntax your version supports.
{
"permissions": {
"allow": [
"Bash(npm test:*)",
"Bash(npm run lint:*)",
"Bash(git status)",
"Bash(git diff:*)"
],
"deny": [
"Read(./.env)",
"Read(./.env.*)",
"Bash(rm -rf:*)"
]
}
}Commit it so teammates get the same rules, and keep personal changes in settings.local.json, which stays out of git. The allow list covers commands you run constantly and that cannot do harm, and the deny list protects secrets and the most destructive command. A deny rule is the right tool for "never", because instructions in CLAUDE.md are advice the model can miss, while a permission rule is enforced by the program. Add to the allow list when a prompt annoys you three times, not before.
Which permission mode when
Shift+Tab cycles the permission mode, and --permission-mode sets it at launch. The right mode depends on how much you trust the task and the environment.
Situation | Mode to pick | Why |
|---|---|---|
Exploring code you do not know | Plan | Read-only, so nothing changes while you learn |
A small, reviewed change on a branch | Default, with a short allow list | You see each edit and each risky command |
Repetitive edits across many files | Accept edits | Saves clicking, and the diff is still reviewed in git |
A throwaway container with no secrets | The most permissive mode your policy allows | Nothing to protect, and no one to answer prompts |
A shared or production machine | Default or Plan only | The cost of a mistake is high |
Whatever mode you use, the real safety net is version control. Commit before a long run, so any result can be reviewed as a diff and any mistake reverted in one command.
Cost and context habits
Sessions get more expensive as they grow, because each turn carries the history. A few commands from the tables above keep that in check.
Habit | Command | Effect |
|---|---|---|
Check what fills context |
| Shows memory files, tools and history as shares of the window |
Clear between unrelated tasks |
| Starts clean, so old tasks stop costing tokens |
Shrink a long session |
| Keeps the thread and drops the detail |
See spend or plan usage |
| Shows where the budget went |
Use a cheaper model for routine work |
| Saves the larger model for hard problems |
Cap a scripted job |
| Stops a stuck run at a known cost |
A rule of thumb: one task per session. When you finish, commit, clear and start the next one with a short prompt that points at the files that matter.
A day with the cheat sheet
Here is how the pieces fit in an ordinary day, so the tables above have a story behind them.
- Morning.
claude -cpicks up yesterday's session, orclaudestarts a new one. Run/contextto see what loaded. - First task. Switch to plan mode, ask for a read-only summary of the area you will touch, then leave plan mode and make the change.
- Midday. Commit after each green test run. If a session sprawls,
/compactit or/clearand restart from your notes. - A side question. Use a subagent or a second terminal, so the main thread stays clean.
- Reviewing. Pipe a diff into
claude -pfor a quick second opinion, and read the findings yourself. - End of day. Update
CLAUDE.mdwith anything you had to tell the agent twice, and commit it.
Keep this page open for the first week, and by the second you will need only the short list under Quick facts.
Common problems
Symptom | Try |
|---|---|
Config does not seem to apply |
|
A skill or command is missing |
|
An MCP server shows as pending | Project servers need your approval; |
MCP server is slow to start | Raise the |
Output looks garbled |
|
Alt shortcuts do nothing on a Mac | Enable Option as Meta in your terminal |
Context fills fast |
|
Our take
We compiled this from the docs and did not time any workflow. Treat it as a map, not a benchmark.
If you only memorise four things, make them Esc to stop, Shift+Tab to change mode, /compact and /clear to manage context, and claude -c to resume. Together they cover most of the friction of a long session.
The -p flag with --output-format json, --max-turns and --max-budget-usd is the part most people skip, and it turns Claude Code from a chat into a scriptable tool with a spending cap. If you run it in CI, start there.
Command lists change quickly. The docs mark several commands as removed and add new ones every few releases. Run claude --help, /help and claude update before you trust a screenshot, including ours. A cheat sheet is only as current as the date on it, and ours says 31 October 2026.
Frequently asked questions
How do I run Claude Code once and exit? claude -p "your question". Pipe content in with cat file | claude -p "explain".
How do I continue my last conversation? claude -c, or claude -r with a session ID or name.
What does Shift+Tab do? It cycles permission modes.
How do I stop Claude mid-response? Press Esc. Press it twice to clear a draft or open rewind.
Where do project settings and MCP servers live? .claude/settings.json and .mcp.json.
*Product names are used descriptively. We are not affiliated with Anthropic.*
Questions
How do I run Claude Code once and exit?
Use claude -p 'your question'. The -p flag prints the response and exits, and you can pipe content in with cat file | claude -p 'explain'.
How do I continue my last conversation?
Run claude -c for the most recent conversation in the current directory, or claude -r with a session ID or name to pick one.
What does Shift+Tab do?
It cycles permission modes: default, acceptEdits, plan, and when available bypassPermissions and auto.
How do I stop Claude mid-response?
Press Esc. Claude keeps the work done so far so you can redirect. Press Esc twice to clear a draft or open rewind.
Where do project settings and MCP servers live?
Project settings are in .claude/settings.json, and team-shared MCP servers are in .mcp.json at the project root.
Loading poll...