Claude Code CLI Cheat Sheet
Current to June 10, 2026

Get effective with Claude Code fast.

A pragmatic field guide for engineers who already understand agentic coding CLIs. Focus: the commands that matter, the workflows that compound, and the extensions that make Claude Code behave like a reliable teammate instead of a clever REPL.

No matching entries. Clear the filter or try a command name such as plan, verify, plugin, context, or review.

Mental Model

Claude Code is not autocomplete. It is a terminal-native agent that reads files, edits code, runs commands, coordinates parallel agents, and carries memory through project configuration.

Core loop

Explore, change, verify

Claude performs best when the task includes a pass/fail signal it can run. Make the verifier explicit in the prompt or encode it with /goal or hooks.

Scarce resource

Context is budget

Use /context, /compact, /btw, and subagents to keep the main thread clean. Long transcripts degrade judgment.

Extension stack

Pick the right layer

CLAUDE.md is durable repo context. Skills are reusable workflows. MCP is external data and tools. Hooks are deterministic gates. Subagents isolate focus.

Scale pattern

Parallelize deliberately

Use /fork for side investigation, /background for long tasks, and /batch for large independent migrations in worktrees.

If you come from Codex

  • Treat /plan as a first-class mode, not just a planning prompt.
  • Use /rewind when the agent takes a bad path; checkpointing is part of the workflow.
  • Expect more built-in orchestration: background agents, cloud reviews, routines, and web handoff.

Common mistakes

  • Stuffing tutorials and file maps into CLAUDE.md. It should be short and behavioral.
  • Approving every prompt manually until approval fatigue makes permission review meaningless.
  • Asking for broad "make it better" changes without a verifier or target diff size.

Commands That Matter

Memorize these first. The full command surface is large; these are the ones that change day-to-day throughput.

claude
Start an interactive session in the current project. Use this for real work where context and iteration matter.
claude -p "query"
Non-interactive query, then exit. Best for scripts, CI, log analysis, and Unix pipelines.
claude -c
Continue the most recent conversation in this directory. Use after closing the terminal or switching context.
claude -r "<session>"
Resume by session ID or name. Prefer naming sessions when work spans days.
/plan [task]
Enter plan mode for exploration and implementation design before edits. Best for unfamiliar or multi-file work.
/goal [condition]
Set an objective Claude keeps checking across turns, such as "tests pass and no visual regression remains".
/context | /compact | /clear
Inspect context use, summarize the thread, or start fresh. This is performance hygiene, not housekeeping.
/diff | /code-review | /simplify
Inspect changes, find correctness bugs, and run cleanup-focused review. Use before commits and after agent-heavy runs.
/run | /verify | /run-skill-generator
Launch and inspect your app, verify behavior beyond tests, and record the launch recipe as a project skill.
/permissions | /sandbox
Tune approval rules and isolation. Use allowlists for known-safe commands and sandboxing for broader autonomy.
/mcp
Manage MCP servers for external systems: GitHub, Sentry, databases, Figma, docs, ticketing, and internal tools.
/plugin
Browse, install, enable, disable, and inspect plugins. Check token cost and installed components before trusting one.
/agents | /fork | /background | /batch
Manage custom agents, spawn side investigations, detach long work, or fan out large independent changes.
/rewind | /branch | /resume
Recover from a bad direction, try an alternative conversation path, or return to prior work.
/teleport | /remote-control | /desktop
Move work across web, terminal, mobile, and desktop surfaces when a task outgrows one environment.

Useful Workflows

These are prompt-and-command patterns that keep Claude Code grounded and auditable.

1

First session in a repo

Bootstrap memory, connect tools, and reduce prompt friction.

/init
/memory
/mcp
/permissions

Read the test/build commands you found. Keep CLAUDE.md short:
only non-obvious commands, style rules, architecture constraints, and gotchas.
2

Feature work

Separate discovery from edits, then insist on evidence.

/plan add GitHub SSO using the existing auth patterns

Implement the approved plan. Add focused tests, run the smallest relevant
test target first, then run the project typecheck. Show commands and results.

/diff
/code-review high --fix
3

Bug fix with root-cause pressure

Make the agent prove it can reproduce the failure before editing.

Users report login fails after session timeout.
Find the auth/session flow, write or identify a failing test first,
then fix the root cause. Do not suppress the symptom.
Run the failing test, then the relevant suite.
4

UI change

Use visual verification instead of relying on static code review.

/run-skill-generator

Implement the layout change. Use /run to launch the app and inspect it.
Take desktop and mobile screenshots, compare them to the requested behavior,
then fix any overlap, clipping, or spacing issues.

/verify
5

Large migration

Use worktree isolation when the work is truly parallelizable.

/batch migrate the src/components directory from Enzyme tests to Testing Library.
Preserve behavior. Each unit should update tests and run only its package suite.
6

PR feedback and CI

Let Claude gather the remote context, then constrain the fix scope.

Use gh to inspect this branch's PR, CI failures, and unresolved review comments.
Fix only actionable failures. Run the relevant checks locally.
Summarize which comments were addressed and what remains.

/autofix-pr only fix lint and type errors

Configuration Map

Most Claude Code productivity comes from putting the right information in the right place.

Artifact Use it for Do not use it for Typical scope
CLAUDE.md Durable repo guidance: build commands, architecture decisions, style constraints, PR etiquette, gotchas. Tutorials, generated file maps, API docs, or anything Claude can infer by reading the code. Project, checked in. Personal overrides in CLAUDE.local.md.
.claude/settings.json Shared project settings: permissions, hooks, plugins, status line, model defaults. Secrets, machine-specific paths, experimental local preferences. Project, checked in.
.claude/settings.local.json Personal project overrides and trial settings before sharing with the team. Team conventions or required safety gates. Local, gitignored.
.claude/skills/*/SKILL.md Repeatable workflows and domain knowledge that should load only when relevant. Always-on instructions. Put those in CLAUDE.md. Project for team workflows; user for personal habits.
.claude/agents/*.md Specialized read-heavy or review-heavy agents with restricted tools and focused instructions. Simple command aliases. Use skills instead. Project or user.
.mcp.json External tool access: issue trackers, docs, design files, DBs, observability, internal APIs. Static project facts. Avoid tool access when a short note would do. Project for shared servers; user/local for private auth.
Hooks Deterministic policy: format after edits, block sensitive files, run mandatory checks before stopping. Soft preferences. Hooks should be rules with consequences. Project for team gates; managed for enterprise policy.
Settings precedence: managed settings win, then command-line arguments, local, project, and user settings. Permission rules merge across scopes, so audit effective permissions when things feel surprising.

Skills and Plugins Worth Installing

Use skills for on-demand procedures and plugins when you want shareable bundles of skills, agents, hooks, MCP servers, LSP servers, monitors, or defaults.

First install

Code intelligence plugins

Install the language LSP plugin for your stack from the official marketplace. Symbol navigation and edit-time diagnostics reduce blind grep-driven changes.

Safety

security-guidance

Runs security guidance while Claude edits. Useful in web apps, auth code, data paths, and any repo where agent-written code may bypass human threat modeling.

Shipping

commit-commands

Adds repeatable git workflows for staging, commits, pushes, and PR creation. Good for standardizing commit shape across agent sessions.

Review

pr-review-toolkit

Specialized PR-review agents help separate correctness, cleanup, test, and security review instead of asking one saturated thread to do everything.

Agent builders

agent-sdk-dev

Use when building with the Claude Agent SDK or Managed Agents. It keeps API details and common migration pitfalls close to the work.

Team reuse

plugin-dev

Install when turning team-specific skills, hooks, subagents, and MCP configs into a distributable plugin.

Community

Third-party marketplace

Add anthropics/claude-plugins-community, then prefer plugins with clear source, narrow tool access, recent updates, and low token cost.

Bundled

/run and /verify

Not third-party, but install nothing until you use these. Generate a run skill once per project so every future session can launch and verify reliably.

Output style

Learning output styles

Use explanatory or learning styles when onboarding to a codebase or mentoring; disable for production tasks where terse evidence matters more.

Install pattern

/plugin
/plugin marketplace add anthropics/claude-plugins-community
/plugin install <plugin-name>@claude-community
/reload-plugins
/skills

Before installing, inspect the plugin detail pane: context cost, last updated date, and every command, agent, skill, hook, MCP server, LSP server, and monitor it will add.

Prompt Patterns

The highest-leverage prompts constrain scope, point to evidence, and define the verification loop.

Research before edits

/plan
Read src/auth, the session middleware, and recent git history for token refresh.
Explain the current flow and list the smallest safe fix. Do not edit files yet.

Implement with verifier

Implement the approved plan. Add a failing test first if one does not exist.
Run only the relevant test target, then run typecheck. Iterate until both pass.

Adversarial review

Review this diff as if you did not write it. Prioritize correctness bugs,
data loss, security issues, and missing tests. Give file/line references.
Do not comment on style unless it hides a bug.

Isolated investigation

/fork Investigate why the importer is slow. Read code and profiles only.
Return root-cause hypotheses, evidence, and low-risk fixes. Do not edit files.

Safety and Control

Claude Code can move quickly. The engineering move is to reduce low-value interruptions while preserving meaningful control over risky actions.

Friction

Use allowlists narrowly

Allow known-safe commands such as lint, test, typecheck, git diff, and read-only gh calls. Keep destructive shell commands in ask or deny.

Isolation

Prefer sandboxing for autonomy

For unattended work, OS-level sandboxing is cleaner than blanket permission bypass. Restrict filesystem and network access to the task.

Policy

Hooks are hard gates

Use hooks for actions that must always happen: format after edits, block secrets, stop until checks pass, or prevent writes to protected directories.

Supply chain

Treat plugins as code

Review plugin source, tool access, hooks, monitors, and MCP servers. Third-party skills can inject dynamic shell output into model context.

Data

Deny sensitive paths

Use settings to exclude secrets, production dumps, credential files, and local env files unless the task explicitly needs them.

Reviewability

Demand evidence

Ask for command output summaries, failing-then-passing tests, screenshots, and exact files changed. Assertions are not verification.