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

claude

One-shot, then exit

claude -p "query"

Continue last conversation

claude -c

Resume by name or ID

claude -r "<session>"

Update

claude update

Health check

claude doctor (terminal) or /doctor (in session)

Stop the model

Esc

Cycle permission mode

Shift+Tab

Add an MCP server

claude mcp add

Start and run

Command

What it does

claude

Interactive session

claude "explain this project"

Interactive session with a first prompt

claude -p "explain this function"

Answer through the SDK, then exit

cat logs.txt | claude -p "explain"

Pipe content in

claude -c

Continue the most recent conversation in this directory

claude -c -p "Check for type errors"

Continue, non-interactively

claude -r "auth-refactor" "Finish this PR"

Resume a named session with a new prompt

claude update

Update to the latest version

claude install [version]

Install or reinstall the native binary; accepts a version, stable or latest

claude doctor

Read-only install and settings diagnostics without starting a session

claude auth login, claude auth logout, claude auth status

Sign in, sign out, show status as JSON

claude setup-token

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

--model <alias>

Pick the model for this session, such as sonnet

--effort <level>

Set effort: low, medium, high, xhigh, max

--permission-mode <mode>

Start in default, acceptEdits, plan, auto, dontAsk or bypassPermissions

--add-dir <path>

Add another working directory

--allowedTools, --disallowedTools

Tools that run without a prompt, and tools to remove

--tools "Bash,Edit,Read"

Restrict the built-in tool set. "" disables all

--continue, -c / --resume, -r

Continue or resume

--name, -n

Name the session for the resume picker

--fork-session

When resuming, start a new session ID

--worktree, -w

Run in an isolated git worktree under .claude/worktrees/

--agents '<json>' / --agent <name>

Define subagents for a session / run as a given agent

--mcp-config <file>

Load MCP servers from JSON files or strings

--append-system-prompt "..."

Add text to the default system prompt

--system-prompt "..."

Replace the whole system prompt

--settings <file or json>

Override settings for this session (file up to 2 MiB)

--bare

Minimal mode: skip auto-discovery of hooks, skills, commands, subagents, plugins, MCP servers, auto memory and CLAUDE.md

--bg, --background

Start as a background agent and return

--debug, --debug-file <path>

Debug logging, optionally filtered, such as --debug='mcp,startup'

--verbose

Full turn-by-turn output

--version, -v

Print the version

Print mode only (-p)

Flag

What it does

--output-format text|json|stream-json

Choose the output shape

--input-format text|stream-json

Choose the input shape

--json-schema '<schema>'

Get validated JSON output matching a schema

--max-turns <n>

Limit agentic turns; exits with an error at the limit

--max-budget-usd <n>

Stop once estimated API spend reaches this amount

--no-session-persistence

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

Esc

Stop the current response so you can redirect; Claude keeps work done so far

Esc Esc

Clear the input draft (saved to history), or open rewind when empty

Ctrl+C

Interrupt; with nothing running, first press clears input, second exits

Ctrl+D

Exit (press twice)

Shift+Tab

Cycle permission modes: default, acceptEdits, plan, then bypassPermissions and auto when available

Option+P / Alt+P

Switch model without clearing the prompt

Option+T / Alt+T

Toggle extended thinking

Option+O / Alt+O

Toggle fast mode

Ctrl+O

Transcript viewer: detailed tool use, with timestamps and the model per message

Ctrl+R

Reverse-search your command history

Ctrl+B

Background running commands and agents (tmux users press twice)

Ctrl+T

Show or hide Claude's task checklist

Ctrl+G or Ctrl+X Ctrl+E

Edit your prompt in your editor

Ctrl+V (or Cmd+V in iTerm2, Alt+V on Windows and WSL)

Paste an image

Ctrl+S

Stash the prompt; press again on an empty prompt to restore it

Ctrl+L

Redraw the screen

Ctrl+Z

Suspend (Unix only); fg to resume

Ctrl+X Ctrl+K

Stop all running background subagents

Editing the prompt

Keys

Action

Ctrl+A / Ctrl+E

Start or end of line

Alt+B / Alt+F

Back or forward one word

Ctrl+K

Delete to end of line

Ctrl+U

Delete to start of line

Ctrl+W

Delete back to the previous whitespace; one press removes a whole path

Alt+D

Delete to end of word

Ctrl+Y, then Alt+Y

Paste deleted text, then cycle through earlier deletions

Ctrl+_

Undo the last input edit

Up / Down

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

/help

List commands

/clear

New conversation, empty context

/compact [focus]

Summarise to free context

/context

Show what fills the context window

/model

Switch and save the model

/effort

Set effort level

/plan [task]

Enter plan mode

/permissions

Manage tool rules

/resume

Pick a past conversation

/rewind

Roll back conversation, code, or both

/diff

Review working-tree changes

/code-review (alias /review)

Review a PR, branch or path

/security-review

Check the branch diff for vulnerabilities

/init

Create a CLAUDE.md

/memory

Edit CLAUDE.md files and auto memory

/mcp

MCP connections and OAuth

/skills, /skill-doctor

List skills; see what each costs in context

/plugin

Manage plugins

/hooks

See hook configuration

/usage

Cost, limits, stats (/cost and /stats are aliases)

/doctor

Setup checkup

/loop [interval] [prompt]

Repeat a prompt while the session is open

/background, /fork, /tasks

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

CLAUDE.md

Project and global

Yes

Instructions loaded every session

rules/*.md

Project and global

Yes

Topic-scoped instructions, optionally path-gated

settings.json

Project and global

Yes

Permissions, hooks, env vars, model defaults

settings.local.json

Project only

No

Your personal overrides

.mcp.json

Project only (repo root)

Yes

Team-shared MCP servers

skills/<name>/SKILL.md

Project and global

Yes

Reusable prompts, /name or auto

commands/*.md

Project and global

Yes

Single-file prompts; same mechanism as skills

agents/*.md

Project and global

Yes

Subagent definitions

output-styles/*.md

Project and global

Yes

Custom instruction sets

keybindings.json

Global only

n/a

Custom keyboard shortcuts

~/.claude.json

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

--scope local (default)

~/.claude.json, this project only

No

--scope project

.mcp.json in the repo

Yes, with an approval prompt

--scope user

~/.claude.json, all projects

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 plugin

Skill 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 json

Cap a scripted run

claude -p "Fix the failing tests" --max-turns 10 --max-budget-usd 2

Try a risky change in isolation

claude --worktree try-new-parser

Read-only exploration

claude --permission-mode plan

Resume 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

/context

Shows memory files, tools and history as shares of the window

Clear between unrelated tasks

/clear

Starts clean, so old tasks stop costing tokens

Shrink a long session

/compact with a focus note

Keeps the thread and drops the detail

See spend or plan usage

/usage

Shows where the budget went

Use a cheaper model for routine work

/model

Saves the larger model for hard problems

Cap a scripted job

--max-turns and --max-budget-usd

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.

  1. Morning. claude -c picks up yesterday's session, or claude starts a new one. Run /context to see what loaded.
  2. 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.
  3. Midday. Commit after each green test run. If a session sprawls, /compact it or /clear and restart from your notes.
  4. A side question. Use a subagent or a second terminal, so the main thread stays clean.
  5. Reviewing. Pipe a diff into claude -p for a quick second opinion, and read the findings yourself.
  6. End of day. Update CLAUDE.md with 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

/doctor, and /context; the docs have a debug-your-config page

A skill or command is missing

/reload-skills, or check the folder name for odd characters with claude --debug

An MCP server shows as pending

Project servers need your approval; claude mcp reset-project-choices resets choices

MCP server is slow to start

Raise the MCP_TIMEOUT environment variable

Output looks garbled

Ctrl+L redraws

Alt shortcuts do nothing on a Mac

Enable Option as Meta in your terminal

Context fills fast

/context, then /compact or /clear

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

Sources

  1. code.claude.com/docs/en/cli-reference.md
  2. code.claude.com/docs/en/interactive-mode.md
  3. code.claude.com/docs/en/commands.md
  4. code.claude.com/docs/en/claude-directory.md
  5. code.claude.com/docs/en/mcp
  6. code.claude.com/docs/en/skills.md
  7. code.claude.com/docs/en/sub-agents.md

Part of the Wbcom Designs family

The all-in-one WordPress community stack

Also ours: wbcomdesigns.comvapvarun.combrndle.com