Claude Code, fast.

A working cheat sheet for engineers who already live in a terminal (Codex, Aider, Cursor CLI…) and want the shortest path to being productive in Claude Code. Optimized for the things that actually change how you work — not an exhaustive flag dump.

Current as of June 2026 Fable 5 / Opus 4.8 / Sonnet 4.6 / Haiku 4.5 Terminal · Desktop · Web · IDE

01 Install & first session

Native installer is the default now (no npm required, self-updates). Log in with your Claude subscription (Pro/Max) or an API key.

Install & launch core

# macOS / Linux
curl -fsSL https://claude.ai/install.sh | bash
# Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex
# or via npm if you prefer
npm install -g @anthropic-ai/claude-code

cd your-repo
claude            # interactive session in this repo
claude doctor     # verify install, version, MCP health
claude update     # manual update (auto-updates by default)

Run it from the repo root — Claude Code treats your working directory as its project scope and reads CLAUDE.md from there.

First 10 minutes in a new repo

claude
> /init          # generates CLAUDE.md from the codebase
> /model         # pick model (Fable 5 default tier)
> /terminal-setup # Shift+Enter newlines, key fixes
> /statusline    # model/branch/context in your prompt

Then ask a real question before asking for code: “give me an overview of this codebase”, “how does auth work here?”. Claude explores with its own search tools — you don’t feed it files manually.

Auth: /login uses your Claude.ai subscription; or set ANTHROPIC_API_KEY for API billing. /usage shows plan limits, /cost shows API spend.

02 Coming from Codex CLI

Same genre, different defaults. Claude Code leans agentic-by-default: it searches, edits, and runs commands itself, gated by a permission system you tune rather than approve-every-step.

You know (Codex)Claude Code equivalentNotes
codexclaudeInteractive REPL in cwd.
codex exec "…"claude -p "…"Headless “print mode”; add --output-format json for scripting.
AGENTS.mdCLAUDE.mdSame idea: persistent project instructions. CC also reads AGENTS.md if present, but CLAUDE.md is canonical and supports @file imports.
/approvals · --full-autoShift+Tab modes · --dangerously-skip-permissionsCycle default → auto-accept edits → plan mode. YOLO flag exists; prefer sandboxed environments for it.
codex resumeclaude -c / claude -r-c continues the last session, -r opens a picker. /resume inside a session too.
model reasoning effortTab thinking toggle · /modelExtended thinking is toggled per-session; “think hard / ultrathink” in a prompt still scales reasoning budget.
custom promptsSkills (.claude/skills/) + slash commandsSkills are folders of instructions + scripts that load on demand — more powerful than prompt snippets. See §09.
The big behavioral difference: don’t paste code in. Describe the outcome, point at files with @path/to/file if helpful, and let Claude explore. Course-correct early with Esc rather than letting a wrong direction run.

03 Slash commands that matter

There are ~50 built-ins; these are the ones experienced users actually run daily. Type / to fuzzy-search them all.

Session hygiene daily

  • /clear — wipe context between unrelated tasks. The single highest-leverage habit.
  • /compact — summarize context; accepts focus hints: /compact keep the API design decisions.
  • /context — visualize what’s eating your context window.
  • /resume — picker for past sessions (also claude -c / -r from shell).
  • /rewind — checkpoint time-machine: restore code, conversation, or both. Also EscEsc.

Setup & steering daily

  • /init — bootstrap CLAUDE.md for the repo.
  • /model — switch model mid-session (Fable 5, Opus 4.8, Sonnet 4.6, Haiku 4.5).
  • /fast — fast mode: Opus-quality output at much higher token speed. Great for long refactors.
  • /memory — open/edit CLAUDE.md files; # prefix adds a memory inline.
  • /permissions — view/edit allow & deny rules instead of clicking “yes” forever.
  • /add-dir — grant access to another directory (e.g. a sibling service).

Review & quality power

  • /code-review — review the current diff at an effort level (lowmax); --fix applies findings; /code-review ultra launches a multi-agent cloud review of the branch or a PR.
  • /security-review — security pass over pending changes.
  • /simplify — reuse/simplification cleanup of the changed code (quality, not bug-hunting).
  • /verify — actually run the app and observe that a change works.
  • /pr-comments — pull PR review comments into context.

Extending power

  • /mcp — manage/authenticate MCP servers.
  • /agents — create custom subagents (own prompt, tools, context window).
  • /plugin — browse marketplaces, install skill/command/agent bundles.
  • /hooks — wire shell commands to lifecycle events (format-on-edit, gate dangerous Bash).
  • /install-github-app — set up @claude mentions on your GitHub repo.

Automation 2026

  • /schedule — recurring or one-shot cloud agents on a cron (“run the triage routine every morning”).
  • /loop — re-run a prompt/skill on an interval in-session (poll a deploy, babysit CI).
  • /bashes — list/manage background shells (dev servers, tails).
  • /todos — view the agent’s current task list.

Diagnostics

  • /status — account, model, connectivity.
  • /doctor — health-check the install.
  • /usage / /cost — plan limits / API spend.
  • /export — export conversation to file/clipboard.
  • /vim — vim keybindings for the input. /config for everything else.

04 Keyboard & input tricks

The interrupt key is the steering wheel. Everything else is gravy.

While Claude is working

  • Escinterrupt. Claude stops cleanly; redirect it. Use early and often.
  • Esc Esc — open rewind/checkpoints: jump back, edit an earlier prompt, restore code state.
  • Queue messages — just keep typing while it works; messages are processed in order.
  • Ctrl+B — send the running task/command to the background (then /bashes).
  • Ctrl+O — toggle verbose output; Ctrl+R — full transcript.

Composing prompts

  • Shift+Tab — cycle permission modes (default → accept-edits → plan).
  • Tab — toggle extended thinking for hard problems.
  • @ — fuzzy file reference (@src/auth/jwt.ts) — pulls the file into context.
  • ! prefix — bash mode: run a shell command yourself; output lands in context.
  • # prefix — append a memory to CLAUDE.md (“# always use pnpm”).
  • Shift+Enter — newline (after /terminal-setup); Ctrl+V — paste images for UI work.
  • — history, across sessions; Ctrl+D — quit.

05 Permission modes — pick your autonomy

Reads are always free; edits and commands are gated by mode + your allow/deny rules. Tune rules once instead of approving forever.

ModeBehaviorUse when
DefaultAsks before file edits and non-allowlisted commands.Unfamiliar repo, risky surface area.
Accept edits Shift+TabFile edits auto-approved; commands still gated.The 90% case once you trust the plan.
Plan mode Shift+Tab×2Read-only research → produces a plan you approve before any mutation. Start it from the shell with claude --permission-mode plan.Big or ambiguous changes. The best feature for non-trivial work — use it.
Bypass --dangerously-skip-permissionsNo prompts at all.Containers/CI/sandboxes only. Pair with --allowedTools limits if you can.
Kill prompt fatigue properly: run /permissions and allowlist what you trust — e.g. Bash(npm test:*), Bash(git diff:*), Edit. Rules live in .claude/settings.json (commit it to share with the team) or ~/.claude/settings.json (personal). The built-in /fewer-permission-prompts skill mines your history and proposes an allowlist for you.

06 CLI flags, headless & scripting

Claude Code is also a Unix tool: pipe data in, get JSON out, wire it into CI.

Flags you’ll actually use

claude -c                        # continue last session
claude -r                        # resume picker
claude --model opus              # or sonnet / haiku / full model id
claude --permission-mode plan    # start read-only
claude --add-dir ../other-svc    # extra working dirs
claude --allowedTools "Bash(git:*)" "Edit"
claude --append-system-prompt "Prefer functional style"
claude --dangerously-skip-permissions   # sandboxes only

Headless / print mode CI

# one-shot, plain text out
claude -p "explain the failing test in CI logs"

# pipe anything in
cat error.log | claude -p "root-cause this stack trace"

# machine-readable
claude -p "lint my commit messages" --output-format json
claude -p "…" --output-format stream-json   # NDJSON events

# CI example: auto-triage
gh issue view 42 --json title,body | \
  claude -p "label and propose a fix plan" \
  --allowedTools "Read" "Grep" "Bash(gh issue:*)"

Building something bigger? The Claude Agent SDK (TypeScript/Python) exposes the same harness programmatically.

07 Context & CLAUDE.md

Context is your scarcest resource. CLAUDE.md is how you stop re-explaining your repo every session.

CLAUDE.md hierarchy

~/.claude/CLAUDE.md      # you, everywhere (style, tools)
./CLAUDE.md              # project — commit it
./CLAUDE.local.md        # project, personal (gitignored)
./packages/api/CLAUDE.md # subdir — loaded on demand

# imports keep it lean:
See @docs/architecture.md and @package.json

What belongs there: build/test commands, conventions Claude gets wrong, repo etiquette (“never commit to main”), gotchas. What doesn’t: anything derivable from the code. Keep it short — it’s loaded into every session; bloat costs you context and attention.

Iterate on it like a prompt: when Claude repeats a mistake, hit # and record the correction.

Working the context window

  • /clear between tasks. Stale context degrades quality more than anything else.
  • Auto-compaction kicks in near the limit, but a deliberate /compact focus on X at a natural breakpoint beats an automatic one mid-thought.
  • Subagents keep the main thread clean — “use a subagent to find every caller of X” burns a side context, returns only the conclusion.
  • /context shows the breakdown when things feel sluggish (MCP tools are a common silent hog — disable unused servers).
  • 1M-token context is available on Sonnet (and Fable) for monorepo-scale sessions, but discipline beats raw size.

08 Workflows that actually work

Field-tested patterns. The common thread: give Claude a target it can verify itself against — tests, a screenshot, a plan.

Explore → Plan → Code → Commit default

For anything non-trivial: Shift+Tab×2 into plan mode, ask it to research the change. Read the plan, push back, approve. Then let it implement in accept-edits mode and finish with commit and open a PR — it writes solid commit messages from the actual diff.

Skipping the plan step is the #1 cause of “it confidently did the wrong thing.”

TDD with an agent default

Ask for failing tests first, from the spec — tell it explicitly not to write implementation. Commit the tests. Then: “make these pass; don’t modify the tests.” The red/green loop gives Claude an objective target, and it will iterate against it autonomously.

Visual iteration

For UI: paste a mock (Ctrl+V), give it a way to see results (Playwright/Chrome DevTools MCP screenshots, or the /verify skill), and say “iterate until it matches.” Agents with eyes converge in 2–3 rounds; agents without them don’t.

Parallel sessions with worktrees power

git worktree add ../proj-auth feature/auth
cd ../proj-auth && claude

One Claude per worktree = independent tasks with zero collision. Many engineers run 2–4. The desktop app and claude.ai/code web sessions do the isolation for you for cloud-friendly tasks.

Safe YOLO loops

Long mechanical tasks (lint sweeps, codemods, dependency bumps): run in a devcontainer/Docker sandbox with --dangerously-skip-permissions and let it grind. Checkpoint with git; /rewind covers in-session mistakes, commits cover the rest.

Course-correct early

Watch the first minute of work. Wrong direction? Esc, refine, go again. EscEsc to fork from an earlier checkpoint beats arguing with a session that’s gone sideways — and /clear beats both when the task changes.

Review before merge

/code-review on the branch before you push — at high effort for risky diffs, or ultra for a multi-agent cloud review of a whole PR. Pair with /security-review on auth/input-handling changes and /simplify to strip the AI-generated flab.

GitHub automation

/install-github-app, then mention @claude on issues/PRs: “@claude fix the lint failures”, “@claude implement this issue”. It works in Actions, pushes a branch, opens a PR. Headless claude -p covers everything else in CI.

Subagents & custom agents power

“Spin up subagents to investigate these three hypotheses in parallel” — each gets a fresh context, you get the conclusions. Define reusable ones with /agents (e.g. a code-reviewer with read-only tools) in .claude/agents/, committed for the team.

09 Skills & plugins — extend the agent

A skill is a folder with a SKILL.md (instructions + optional scripts/resources) that Claude loads only when relevant — zero context cost until triggered. Plugins bundle skills, commands, agents, hooks and MCP servers for one-command install. This is the ecosystem’s biggest differentiator — use it.

Anatomy & install

.claude/skills/deploy-checks/SKILL.md   # project (committed)
~/.claude/skills/…                      # personal, all projects

# SKILL.md
---
name: deploy-checks
description: Pre-deploy validation for our k8s services.
  Use before any production deploy.
---
1. Run ./scripts/preflight.sh
2. Verify migrations are reversible…
# plugin marketplaces
claude plugin marketplace add anthropics/skills
/plugin                  # browse & install in-session

The description is the trigger — write it like a “when to use” sentence. Invoke explicitly with /skill-name or just describe the task and let it fire.

Third-party picks & why curated

  • anthropics/skills (official marketplace) — the document suite (pdf, docx, xlsx, pptx) produces real Office files via scripts instead of hallucinated markup; skill-creator scaffolds well-formed skills of your own; mcp-builder for writing MCP servers; webapp-testing for browser-driven verification.
  • obra/superpowers — the most-adopted community pack: disciplined TDD, systematic debugging, brainstorming and planning workflows encoded as skills. Why: it gives Claude a process, not just knowledge — noticeably better on gnarly multi-step work.
  • Trail of Bits security skills (trailofbits/skills) — professional-grade static analysis & audit workflows (semgrep/CodeQL-style sweeps). Why: written by actual auditors; far stronger than “please review for security.”
  • Your own — the highest-ROI skill is the one encoding your release process, migration checklist, or test conventions. If you’ve explained it twice, make it a skill.

Audit third-party skills before installing — they’re instructions + executable scripts running with your permissions.

10 MCP — connect your stack

Model Context Protocol servers give Claude tools beyond the filesystem: your issue tracker, browser, DB, error tracker. Add with one command; OAuth handled via /mcp.

Setup

# remote (HTTP/SSE) servers
claude mcp add --transport http github \
  https://api.githubcopilot.com/mcp/
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
claude mcp add --transport sse linear https://mcp.linear.app/sse

# local (stdio) servers
claude mcp add playwright -- npx @playwright/mcp@latest
claude mcp add pg -- npx -y @bytebase/dbhub \
  --dsn "postgresql://localhost:5432/app"

claude mcp list           # /mcp in-session to auth & inspect

Scopes: --scope local (you, this repo — default), project (writes .mcp.json, committed for the team), user (you, everywhere).

Servers worth the context cost

  • Playwright / Chrome DevTools — lets Claude drive a browser and see your app. The single biggest upgrade for frontend work.
  • GitHub — PRs, issues, CI runs without shelling out to gh (though gh via Bash is often enough).
  • Context7 — version-correct, up-to-date library docs on demand; kills “trained on the old API” bugs.
  • Sentry — pull the actual stack trace and breadcrumbs for the bug you’re fixing.
  • Linear / Jira / Notion — implement tickets from source, write status back.
  • Postgres (read-only) — schema-aware queries while debugging data issues.

Every connected server’s tool list consumes context. Connect what you use; prune with /mcp when /context shows bloat.

11 Hooks & settings

Hooks are deterministic shell commands at lifecycle points — guarantees, not suggestions. Settings cascade: enterprise → project local → project → user.

Hooks power

// .claude/settings.json
{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Edit|Write",
      "hooks": [{ "type": "command",
        "command": "npx prettier --write \"$CLAUDE_FILE_PATHS\"" }]
    }],
    "PreToolUse": [{
      "matcher": "Bash",
      "hooks": [{ "type": "command",
        "command": "./scripts/block-prod-db.sh" }]  // exit 2 = block
    }]
  }
}

Events: PreToolUse (can block), PostToolUse, UserPromptSubmit, Stop, SubagentStop, SessionStart, PreCompact, Notification. Classic uses: auto-format on every edit, block rm -rf/prod credentials, run typecheck when Claude says it’s done, desktop notify on permission prompts.

The files

~/.claude/settings.json        # you, global
.claude/settings.json          # team, committed
.claude/settings.local.json    # you, this repo (gitignored)
.mcp.json                      # team MCP servers
.claude/skills/  agents/  commands/   # committed extensions

Env vars to know: ANTHROPIC_API_KEY, ANTHROPIC_MODEL, CLAUDE_CODE_USE_BEDROCK=1 / CLAUDE_CODE_USE_VERTEX=1 (cloud-provider routing), BASH_DEFAULT_TIMEOUT_MS, DISABLE_TELEMETRY=1. Set them under "env" in settings.json to apply per-project.

A committed .claude/ directory is how you onboard the whole team at once — settings, permissions, hooks, skills, agents in one PR.

12 Models & thinking (Jun 2026)

ModelIDUse for
Fable 5claude-fable-5Latest flagship; default for new sessions. Best judgment on large, ambiguous tasks.
Opus 4.8claude-opus-4-8Deep reasoning workhorse; supports /fast mode (same model, much faster output).
Sonnet 4.6claude-sonnet-4-6Speed/cost sweet spot; 1M-token context option for monorepo-scale sessions.
Haiku 4.5claude-haiku-4-5Cheap + fast: headless pipelines, subagent fan-outs, simple chores.
Thinking: hit Tab to toggle extended thinking, or escalate in-prompt with “think hard” / “ultrathink” for architecture-grade problems. More thinking = slower + costlier — keep it off for routine edits. Switch models mid-session with /model; a common pattern is plan on Fable/Opus, implement on Sonnet.

13 Ten habits that separate power users

  • Plan mode for anything non-trivial. Cheap insurance against confident nonsense.
  • /clear between tasks. A fresh context outperforms a polluted one, every time.
  • Interrupt early. Esc in the first minute saves ten later.
  • Give it a feedback loop. Tests, a browser, a compiler — verifiable targets make the agent self-correcting.
  • Be specific. “fix the test” → “fix the flaky retry logic in auth.test.ts without widening the timeout.”
  • Invest in CLAUDE.md like you’d onboard a new hire — and keep it short.
  • Encode repeated explanations as skills. Twice explained = skill material.
  • Allowlist, don’t click. /permissions once beats a hundred approvals.
  • Parallelize with worktrees once one session feels slow — your review bandwidth becomes the bottleneck, which is the right bottleneck.
  • Review like it’s a teammate’s PR. /code-review + your own eyes; you still own the merge.