
Printable single-page A4 JPEG reference for developers
Last updated: 12/05/2026
Concise reference for the Claude Code CLI only: terminal sessions, claude -p, CLI flags, settings, permissions, MCP, skills, subagents, hooks, and automation.
I regularly write about agentic coding tools and workflows. If you want updates like these in your inbox, subscribe below. Thanks!
🚀 Start Here
Command | Use |
|---|---|
| Start an interactive Claude Code session in the current directory |
| Start an interactive session with an initial prompt |
| Print mode: run a one-off query, output the answer, then exit |
| Continue the most recent conversation in the current directory |
| Resume a previous session by ID or name |
| Continue most recent session; long form of |
| Pick a previous conversation to resume |
| Update Claude Code when supported by your install method |
| Print installed version |
| Diagnose installation, configuration, and runtime issues |
| Sign in from the shell |
| Sign out from the shell |
| Configure MCP servers |
| Manage plugins |
| Clear local project state |
| Show available in-session commands |
| Sign in or out from inside Claude Code |
🖥️ Interactive Terminal
Input | Action |
|---|---|
| Open command, skill, plugin, and MCP prompt menu |
| Mention files/directories with path autocomplete |
| Run a shell command directly and add output to context |
| Cancel input, response, or tool work |
| Exit the session |
| Redraw the terminal; in fullscreen, double-press can clear |
| Toggle transcript viewer with detailed tool usage |
| Reverse-search prompt history |
| Edit prompt in |
| Background a running bash command or agent task |
| Toggle task list |
| Cycle permission modes |
| Switch model |
| Toggle fast mode |
| Toggle extended thinking |
| Rewind or summarize from a previous point |
| Paste image from clipboard, terminal-dependent |
| Insert newline in multiline prompt |
⚡ Slash Commands
Type / in the TUI for the exact commands available in your version, plan, platform, plugins, and MCP servers.
Command | Use |
|---|---|
| Show version, model, account, and connectivity state |
| Open settings UI |
| Manage tool approval rules |
| Enter plan mode before architectural or risky work |
| Switch model, such as Sonnet or Opus |
`/effort [low | med |
`/fast [on | off]` |
| Start a fresh conversation while keeping memory |
| Summarize conversation history to free context |
| Inspect context-window usage |
| Ask an ephemeral side question without tools |
| Open interactive diff viewer |
| Review local changes or a PR |
| Review branch diff for security issues |
| Review recent files and apply quality fixes |
| Restore code and/or conversation to a checkpoint |
| Manage |
| Create a starter |
| Manage and inspect MCP servers |
| Manage custom subagent configurations |
| Manage active subagents |
| List background tasks |
| Detach session as a background agent |
| Orchestrate large work across worktrees |
| Run a repeated prompt |
| Keep Claude working until a condition is met |
| Show usage, cost, and activity stats |
| Diagnose and fix install/runtime issues |
| Open keyboard shortcut config |
| Change terminal theme |
`/tui [default | fullscreen]` |
| Export conversation as text |
| Copy recent response(s) |
MCP servers can add commands as /mcp__<server>__<prompt>.
⚙️ CLI Flags
Flag | Use |
|---|---|
| Print mode: run, print, and exit |
| Continue most recent session in current directory |
| Resume a named/specific session |
| Add another working directory for file access |
| Faster startup; skips hooks and plugins |
| Set effort: |
| Pick model, e.g. |
| Start in |
| Restrict tools available for the session |
| Allow only specified tools/rules; also appears as |
| Deny specific tools/rules |
| Cap agentic turns for automation |
| Structured non-interactive output |
| Constrain structured output where supported |
| Load MCP config for automation/CI |
| Per-run settings override |
| Run main thread as a named subagent |
| Define session-only subagents |
| Start directly as a background agent |
| Start in isolated git worktree under |
| Fetch PR |
| Resume the session linked to a PR |
| Replace default system prompt |
| Replace default prompt with file contents |
| Append instructions to the default system prompt |
| Append file contents to the default system prompt |
| Enable debug logging |
| Write debug log to a known file |
| Show full turn-by-turn output; overrides |
| Print version |
| Alias for bypassing permission prompts; isolated envs only |
| Make bypass mode available in the mode cycle without starting in it |
Prefer append system-prompt flags for normal customization; full replacement removes Claude Code's built-in operating instructions.
🧾 Print Mode & Scripts
Pattern | Use |
|---|---|
| One-off answer for scripts or quick questions |
| Machine-readable one-shot output |
| Stream structured events for real-time processing |
| Non-interactive autonomous run with classifier checks |
| API-key auth takes precedence in non-interactive mode |
| Generate one-year OAuth token for CI/scripts; set as |
--bare skips hooks/plugins for faster script startup, but does not read CLAUDE_CODE_OAUTH_TOKEN; use ANTHROPIC_API_KEY or apiKeyHelper for bare scripts.
🔐 Auth & Credentials
Item | Use |
|---|---|
| Browser login for Claude.ai, Teams, Enterprise, or Console |
| Remove current login |
| Bearer-token auth for gateways/proxies |
| Console API key auth |
| Dynamic/rotating API key script |
| Long-lived OAuth token from |
| Prefer cloud-provider credentials |
Credential precedence: cloud provider env > ANTHROPIC_AUTH_TOKEN > ANTHROPIC_API_KEY > apiKeyHelper > CLAUDE_CODE_OAUTH_TOKEN > /login OAuth.
🌱 Environment Variables
Variable | Use |
|---|---|
| Route API traffic through proxy/gateway |
| One-session model override |
| Pin model aliases |
| Override effort level |
| Default model for subagents |
| Hide/disable 1M context variants |
| Disable fast mode |
| Disable background Bash/subagent tasks |
| Disable agent view/background agents |
| Disable scheduled tasks |
| Enable PowerShell tool |
| Set Git Bash path on Windows |
| Use system |
| Tune Bash command timeouts |
| Raise Bash output preview limit |
| Raise MCP output warning/limit |
| Tune MCP startup/tool timeouts |
| Disable update checks or all update paths |
| Disable prompt caching globally |
Any env var can be placed under env in settings.json to apply it consistently.
🧩 Config Files
Path / Key | Use |
|---|---|
| User settings for every project |
| Shared project settings; commit when appropriate |
| Personal project overrides; normally gitignored |
| App state, UI preferences, and personal MCP state; not for permissions/hooks/env |
| Override config/state directory for clean or isolated runs |
| Custom keyboard shortcuts from |
| Custom terminal themes |
| Per-invocation settings override |
| Show active settings sources and managed-policy state |
| Validate config files and show schema issues |
Precedence: managed settings > CLI arguments/--settings > .claude/settings.local.json > .claude/settings.json > ~/.claude/settings.json.
Common Setting | Use |
|---|---|
| Initial model selection |
| Restrict selectable models, strongest from managed settings |
| Default effort: |
| Enable extended thinking by default |
| Toggle auto memory |
|
|
| Default permission mode |
| Tool permission rules |
| Persistent equivalent of |
| Environment variables for Claude Code sessions |
| Lifecycle hook definitions |
| Enable/disable installed plugins |
| Pre-register plugin marketplaces |
🔐 Permissions
Mode | What Runs Without Asking | Best For |
|---|---|---|
| Reads only | Normal work and sensitive repos |
| Reads, edits, and common in-scope filesystem commands | Fast code iteration with later review |
| Reads only; proposes a plan before editing | Large or risky changes |
| Most actions, checked by a safety classifier | Long tasks with fewer prompts |
| Only pre-approved tools and read-only commands | CI or locked-down automation |
| Everything except root/home deletion circuit breakers | Isolated containers/VMs only ⚠️ |
Control | How |
|---|---|
Switch in session |
|
Start in mode |
|
Persist mode |
|
Manage rules |
|
Block optional modes |
|
Inspect auto defaults |
|
Inspect effective auto config |
|
Critique custom auto rules |
|
Protected paths are never auto-approved except in bypassPermissions: .git, .vscode, .idea, .husky, most .claude files, .mcp.json, shell startup files, .gitconfig, .gitmodules, and .ripgreprc.
Auto mode trusts the working directory and current repo remotes by default. Add trusted orgs, buckets, domains, and services in autoMode.environment; include "$defaults" when extending built-in environment, allow, soft_deny, or hard_deny lists.
🧱 Permission Rules
Rule | Meaning |
|---|---|
| Match all Bash commands |
| Match exact command |
| Match command prefix with wildcard |
| Match PowerShell commands; aliases canonicalized |
| Match file relative to current directory |
| Match from project root |
| Match from home directory |
| Match absolute filesystem path |
| Match edits in project |
| Match web fetches to a domain |
| Match all tools from an MCP server |
| Match one MCP tool |
| Match a named subagent |
Evaluation order is deny → ask → allow; first match wins. Read/Edit patterns use gitignore-style matching, where * is one directory level and ** is recursive.
🧰 Built-In Tools
Tool | What It Does | Prompts? |
|---|---|---|
| Spawn a subagent | No |
| Run shell commands | Yes, except read-only commands/rules |
| Run native PowerShell commands when enabled | Yes |
| Read files, images, PDFs, notebooks | No |
| Exact string replacement in files | Yes |
| Create or overwrite full files | Yes |
| Find files by pattern | No |
| Search file contents with ripgrep regex | No |
| Definitions, references, diagnostics via code intelligence plugins | No |
| Edit Jupyter notebook cells | Yes |
| Run a skill | Yes |
| Watch background process/output and react | Uses Bash rules |
| Fetch URL and extract markdown-summary content | Yes by domain |
| Return web result titles/URLs | Yes |
Important behavior:
Behavior | Note |
|---|---|
Read-before-edit | Claude must read an existing file before |
Bash timeout | 2 min default; Claude can request up to 10 min; env vars can change limits |
Bash output | 30k chars default; long output saved to session file |
Bash cwd | Main-session |
Env vars |
|
Grep | Uses ripgrep syntax and respects |
Glob | Finds gitignored files by default unless configured otherwise |
WebFetch | Caches for 15 min, upgrades HTTP to HTTPS, and is lossy by extraction prompt |
WebSearch | Returns URLs/titles only; Claude follows with |
🧠 Models, Effort, Context
Control | Use |
|---|---|
| Open model picker or switch model |
| Start with a model/alias |
| One-session model override |
| Persistent model preference |
| Clear override and use recommended model for account/provider |
| Latest Sonnet for daily coding |
| Latest Opus for complex reasoning |
| Fast, efficient model for simple tasks |
| Most capable available model; currently Opus |
| Opus in plan mode, Sonnet for execution |
| Use 1M context when available |
Effort / Thinking | Use |
|---|---|
| Set |
| One-session effort override |
| Env override; takes precedence |
| One-turn request for deeper reasoning |
| Toggle extended thinking |
| Disable thinking output regardless of effort |
⚡ Fast Mode
Control | Use |
|---|---|
| Toggle or inspect fast mode |
| Keyboard toggle |
| Persist in user settings |
| Managed setting requiring opt-in each session |
| Disable fast mode |
Fast mode is a higher-cost, lower-latency configuration for Opus 4.6 only. It is not a separate model; enabling it switches to Opus 4.6 and disabling it leaves you on Opus 4.6.
📝 Memory & Context
File / Command | Use |
|---|---|
| Project/team instructions loaded every session |
| Personal global instructions |
| Personal per-project instructions; gitignore it |
| Topic/path-scoped rules loaded on demand |
| Import more instruction files |
| Generate starter project |
| Inspect and manage loaded memory and auto memory |
| Show actual context-window usage |
| Summarize current history and preserve essentials |
| Start fresh while retaining memory files |
Auto memory stores project notes under ~/.claude/projects/<project>/memory/MEMORY.md. Keep root CLAUDE.md concise; move specialized workflows into skills so they load only when needed.
🔌 MCP
Command / Config | Use |
|---|---|
| Inspect, approve, authenticate, reconnect, or disable servers |
| Add recommended remote HTTP server |
| Add legacy SSE server |
| Add local process server |
| Pass env to stdio server |
| Add HTTP/SSE auth header |
| List configured servers |
| Show one server |
| Remove a server |
| Reset approvals for project |
| Project-scoped MCP config committed at repo root |
| User/local MCP config |
Scope | Loads In | Shared | Stored In |
|---|---|---|---|
| Current project | No |
|
| Current project | Yes |
|
| All projects | No |
|
Option ordering matters: claude mcp add [options] <name> -- <server-command>. Server name workspace is reserved.
🛠️ Skills
Surface | Use |
|---|---|
| Browse available skills |
| Invoke a skill manually |
| Project skill; share with team |
| Personal skill across projects |
| Legacy custom command; behaves like a skill |
| Helps Claude decide when to auto-invoke |
| Manual-only skill |
| Pre-approve tools for the skill |
| Run skill in a subagent context |
| Inject dynamic shell output into skill context |
| Read skill arguments |
Built-in skill-style commands include /simplify, /batch, /debug, /loop, /review, /security-review, /test, /terminal, and /search.
🔧 Plugins
Command / Setting | Use |
|---|---|
| Browse, install, uninstall, enable, or disable plugins |
| Enable/disable plugins by |
| Make project/team marketplaces available |
| Managed allowlist for marketplace sources |
| Managed blocklist for marketplace sources |
Plugins can bundle skills, subagents, hooks, and MCP servers. Project settings can recommend marketplaces, but users still consent when trusting the folder.
👥 Subagents
Item | Use |
|---|---|
| Manage subagent library and running subagents |
| Manage active subagents |
`claude agents | cat` |
| Explicitly ask Claude to use a subagent |
| Run the main session as a subagent |
| Persist main-thread subagent for a project |
| Define session-only subagents at startup |
| Kill all running background subagents in session |
Subagent Location | Priority / Scope |
|---|---|
Managed settings | Highest; organization-wide |
| Current session only |
| Project/team |
| Personal |
Plugin | Where plugin is enabled |
Core frontmatter:
Field | Use |
|---|---|
| Required unique identifier |
| Required delegation trigger |
| Restrict tool access |
|
|
| Override reasoning effort while agent runs |
| Agent-specific mode; ignored for plugin agents |
| Limit or inline MCP servers for this agent |
| Preload skills into agent context |
| Agent-scoped hooks |
|
|
| Prefer background execution |
| Give agent its own git worktree |
| Stop after a fixed number of turns |
Built-ins: Explore is fast/read-only for code search, Plan researches during plan mode, and general-purpose handles broader multi-step work.
🧵 Background Agents & Worktrees
Command | Use |
|---|---|
| Open agent view for background sessions |
| Start a background session from shell |
| Background current session, optionally with one more instruction |
| Detach current background session to agent view |
| Attach to background session |
| Print recent output |
| Stop a session |
| Restart stopped session(s) |
| Remove session from list |
| Disable agent view/background agents |
Agent view sessions that need to edit files move into isolated worktrees automatically.
Worktree Control | Use |
|---|---|
| Start in |
| Auto-generate worktree name |
| Start from GitHub PR |
| Branch from |
| Branch from local |
| Copy gitignored files, such as |
| Give a subagent its own temporary worktree |
| Manual cleanup |
Add .claude/worktrees/ to .gitignore.
🪝 Hooks
Hook Surface | Use |
|---|---|
| Browse active hooks; read-only UI |
| Define user/project/local hooks |
| Disable hooks from settings |
| Trace hook matching and execution |
| Write debug log to known path |
| Stable project root passed to hook commands |
| Write shell preamble for future Bash commands |
Event | Typical Use |
|---|---|
| Inject setup context or clean up |
| One-time CI/script preparation for init/maintenance |
| Add context or block prompts before Claude sees them |
| Intercept slash command or skill expansion |
| Validate, rewrite, or block tool calls |
| Auto-answer specific approval dialogs |
| React to auto-mode classifier denials |
| Format, lint, log, or inspect tool results |
| Add context after parallel tool batches |
| Desktop/chat alerts when Claude needs input |
| Continue until criteria pass, or log API failures |
| Inject or validate subagent work |
| Enforce task naming or completion gates |
| React around context compaction |
| Audit settings/skills changes |
| Debug |
| Refresh env when directories/files change |
| Override worktree creation/cleanup |
| Observe MCP user-input flows |
Hook Type | Use |
|---|---|
| Run shell command; JSON arrives on stdin |
| POST event JSON to a service |
| Ask a model for an |
| Spawn a subagent to verify code or run tools |
matcher is exact for simple names like Bash or Edit|Write, regex when it contains regex characters, and */empty/omitted for all. Use if: "Bash(git *)" to filter tool hooks with permission-rule syntax before spawning a handler.
🎯 Goals, Loops, Scheduling
Command / Feature | Use |
|---|---|
| Keep working turn-after-turn until a model verifies condition is met |
| Show active or last achieved goal status |
| Stop active goal; aliases include |
| Run a goal non-interactively until met or interrupted |
| Re-run a prompt on fixed interval |
| Let Claude choose the next interval dynamically |
| Run built-in maintenance prompt, or |
/goal is for a verifiable end state; /loop is for polling on time intervals; Stop hooks are for custom persistent completion checks.
⏪ Checkpoints & Sessions
Command / Action | Use |
|---|---|
| Open checkpoint menu |
Restore code and conversation | Revert both files and history to a prompt |
Restore conversation | Rewind chat only, keep current files |
Restore code | Revert Claude file edits only, keep chat |
Summarize from here | Compress selected point forward without changing files |
| Name a session for easier resume |
| Switch to previous session in TUI |
| Branch current conversation |
| Fork a resumed/continued session from shell where supported |
Checkpoints track Claude's file-editing tools, not files changed by Bash commands, external tools, or other sessions. Keep using git for permanent history.
🖱️ Computer Use
Item | Use |
|---|---|
| Turn on built-in screen-control MCP server |
macOS Accessibility | Allows click/type/scroll |
macOS Screen Recording | Allows Claude to see approved app windows |
Per-app approval | Required each session before controlling an app |
| Abort current computer-use action and release lock |
CLI computer use is macOS-only, interactive-only, research preview, and requires eligible Pro/Max claude.ai auth. It is not available with -p, Team/Enterprise, Bedrock, Vertex, or Foundry.
🔄 CI & Automation
Surface | Use |
|---|---|
GitHub Action |
|
GitHub setup | Run |
GitHub trigger |
|
GitHub | Run automation immediately for any workflow event |
GitHub | Pass CLI flags like |
GitHub secret | Store direct API key as |
GitLab CI/CD | Run |
GitLab variables | Store |
Bedrock/Vertex CI | Prefer OIDC/WIF instead of long-lived cloud keys |
Keep CI prompts specific, cap turns with --max-turns, set job timeouts, and route every code change through normal PR/MR review.
✅ Workflow Patterns
Goal | Prompt / Command Pattern |
|---|---|
Understand a repo |
|
Find feature code |
|
Debug | Provide command, error, repro steps, and "fixed when" check |
Refactor | Ask to preserve behavior, make small changes, and run tests |
Add tests | Name file/function, behavior, edge cases, and test runner |
Create PR |
|
Review |
|
Visual/UI work | Paste image/screenshot and ask Claude to compare result after changes |
Large research |
|
Parallel edits | Use |
Clean context |
|
Course-correct | Press |
Prompt template: Goal + context + constraints + verification. Put durable project facts in CLAUDE.md, reusable procedures in skills, external live systems in MCP, hard guarantees in permissions/hooks, and noisy research in subagents.



