Claude Code

Claude Code v2.1.x & Claude API Reference

Claude & Claude Code Reference Guide & Cheat Sheet

Every CLI command, flag, slash command, keyboard shortcut, and API parameter in one searchable sheet — with badges marking what's terminal-only, what's API-only, what's newly added, and what's been removed.

Total Entries: 0
Category Surface / Availability Name Syntax Accepted Values / Range Example Description & Notes
1. Session & Startup Claude Code Interactive session claude ["query"] Optional opening prompt claude "explain this project" Starts the REPL in the current directory. Pass a query to open with that prompt already sent.
1. Session & Startup Claude Code Print / headless --print, -p Toggle + query string cat logs.txt | claude -p "explain" Runs one query, writes to stdout, exits. The entry point for every scripted or CI use. Accepts piped stdin.
1. Session & Startup Claude Code Continue --continue, -c Toggle claude -c -p "check for type errors" Loads the most recent conversation in the current directory, including sessions that added it via /add-dir.
1. Session & Startup Claude Code Resume --resume, -r Session ID, name, or blank for picker claude -r "auth-refactor" "finish this PR" Resumes a specific session, or opens an interactive picker. Background sessions appear marked bg.
1. Session & Startup Claude Code Session name --name, -n Text label claude -n "my-feature-work" Names the session for /resume and the terminal title. Rename mid-session with /rename.
1. Session & Startup Claude Code Fork on resume --fork-session Toggle (use with -r / -c) claude --resume abc123 --fork-session Creates a new session ID instead of reusing the original, leaving the source conversation untouched.
1. Session & Startup Claude Code Worktree --worktree, -w Name, #PR, or PR URL claude -w feature-auth --tmux Runs in an isolated git worktree under .claude/worktrees/ so parallel sessions don't collide.
1. Session & Startup Claude Code Maintenance commands claude update | doctor | install stable, latest, or a version claude install stable doctor prints read-only install and settings diagnostics without starting a session.
1. Session & Startup Claude Code Authentication claude auth login|logout|status --email, --sso, --console, --text claude auth login --console status exits 0 when signed in, 1 when not — useful as a CI precondition check.
1. Session & Startup Claude Code CI token claude setup-token Toggle claude setup-token Generates a long-lived OAuth token for CI and scripts. Printed once, never saved. Requires a Claude subscription.
2. Model & Reasoning Claude Code Model --model opus, sonnet, haiku, fable, or full ID claude --model claude-sonnet-5 Sets the session model. Overrides the model setting and ANTHROPIC_MODEL. Aliases resolve to the latest in that tier.
2. Model & Reasoning Claude Code Effort level --effort low, medium, high, xhigh, max, ultracode claude --effort xhigh How much reasoning the model spends per turn. Available levels depend on the model. ultracode starts at xhigh with automatic workflow orchestration.
2. Model & Reasoning Claude Code Fallback chain --fallback-model Comma-separated model list claude --fallback-model sonnet,haiku Tried in order when the primary model is overloaded or retired. Persist it with the fallbackModel setting.
2. Model & Reasoning v2.1.210+ Advisor --advisor opus, sonnet, or a full model ID claude --advisor opus Pairs a stronger second model that Claude consults at key decision points. Fable 5 isn't offered as an advisor.
2. Model & Reasoning Claude Code Subagents --agent, --agents Agent name, or inline JSON definitions claude --agent my-custom-agent --agents defines subagents on the fly using subagent frontmatter fields plus a prompt field.
3. Permissions & Safety Claude Code Permission mode --permission-mode default (manual), acceptEdits, plan, auto, dontAsk, bypassPermissions claude --permission-mode plan Sets the starting mode; cycle live with Shift+Tab. Overrides defaultMode in settings.
3. Permissions & Safety Claude Code Allow rules --allowedTools Permission-rule patterns --allowedTools "Bash(git log *)" "Read" Tools that run without prompting. Same syntax as permissions in settings.json — Bash(*) does not mean "match all Bash".
3. Permissions & Safety Claude Code Deny rules --disallowedTools Tool names or scoped rules --disallowedTools "Bash(rm *)" "mcp__*" A bare name removes the tool from context entirely; a scoped rule keeps the tool and denies only matching calls.
3. Permissions & Safety Claude Code Restrict toolset --tools "", "default", or a name list claude --tools "Bash,Edit,Read" Limits built-in tools. Does not affect MCP tools — pair with --disallowedTools "mcp__*" to cover those too.
3. Permissions & Safety Claude Code Extra directories --add-dir One or more paths claude --add-dir ../apps ../lib Grants file access only — most .claude/ configuration is not discovered from added directories.
3. Permissions & Safety v2.1.169+ Safe mode --safe-mode Toggle claude --safe-mode Disables every customization (CLAUDE.md, skills, plugins, hooks, MCP, themes) to isolate a broken config. Auth, models, tools, and permissions still work.
3. Permissions & Safety Claude Code Skip permissions --dangerously-skip-permissions Toggle claude --dangerously-skip-permissions Equivalent to --permission-mode bypassPermissions. Reserve for sandboxed containers and disposable CI runners.
4. Headless & Scripting Claude Code Output format --output-format text, json, stream-json claude -p "list endpoints" --output-format json | jq json returns one structured envelope with cost, duration, and turn count; stream-json emits live events.
4. Headless & Scripting Claude Code Input format --input-format text, stream-json claude -p --input-format stream-json Lets you feed structured turns in rather than a single prompt string. Print mode only.
4. Headless & Scripting Claude Code Bare mode --bare Toggle claude --bare -p "does this handle null?" Skips auto-discovery of hooks, skills, plugins, MCP servers, auto memory, and CLAUDE.md. Leaves Bash, read, and edit available. Fastest, most reproducible scripted start.
4. Headless & Scripting Claude Code Turn limit --max-turns Integer (no limit by default) claude -p --max-turns 3 "query" Caps agentic turns in print mode and exits with an error at the limit.
4. Headless & Scripting v2.1.217+ Spend cap --max-budget-usd Dollar amount claude -p --max-budget-usd 5.00 "query" Stops once API spend reaches the cap. Subagent spend counts toward it, and running background subagents are stopped.
4. Headless & Scripting v2.1.205+ Structured output --json-schema JSON Schema string claude -p --json-schema '{"type":"object",...}' "query" Returns validated JSON matching your schema after the agent finishes. Invalid schemas now exit with an error rather than falling back silently.
4. Headless & Scripting Claude Code Streaming detail --include-partial-messages Toggle claude -p --output-format stream-json --verbose --include-partial-messages "q" Emits token-level events. Requires --print and --output-format stream-json.
4. Headless & Scripting Claude Code Cache-friendly prompt --exclude-dynamic-system-prompt-sections Toggle claude -p --exclude-dynamic-system-prompt-sections "query" Moves per-machine sections (cwd, env, memory paths, git flag) into the first user message so the prompt cache is reused across users and machines.
5. System Prompt Claude Code Append text --append-system-prompt Text string claude --append-system-prompt "Always use TypeScript" Preferred for scripts: keeps default tool guidance, safety instructions, and coding conventions, and adds only what differs.
5. System Prompt Claude Code Append file --append-system-prompt-file File path claude --append-system-prompt-file ./style-rules.txt Same as above but sourced from a file you can version-control and share.
5. System Prompt Claude Code Replace prompt --system-prompt Text string claude --system-prompt "You are a Python expert" Drops the entire default prompt including tool guidance and safety instructions. Use only when the identity and permission model genuinely differ.
5. System Prompt Claude Code Replace from file --system-prompt-file File path claude --system-prompt-file ./prompts/review.txt Mutually exclusive with --system-prompt. Append flags can combine with either replacement flag.
5. System Prompt v2.1.205+ Subagent prompt --append-subagent-system-prompt Text string claude -p --append-subagent-system-prompt "Cite file paths" "q" Appends to every subagent's prompt, including nested ones. Print mode only.
6. Parallel & Background Claude Code Background session --bg, --background Toggle + prompt claude --bg "investigate the flaky test" Starts detached and returns immediately with a session ID. Cannot be combined with -p.
6. Parallel & Background Claude Code Shell job --exec Shell command string claude --bg --exec 'pytest -x' Runs a PTY-backed background job instead of a Claude session — useful for parking long test runs next to your agents.
6. Parallel & Background Claude Code Agent view claude agents --json, --all, --cwd claude agents --json One screen showing every parallel session and which ones need input. --json makes it scriptable.
6. Parallel & Background Claude Code Session control claude attach|logs|stop|respawn|rm Session ID claude attach 7c5dcf5d Manage background sessions from the shell. respawn --all restarts every running session, e.g. to pick up a new binary.
6. Parallel & Background v2.1.186+ Teammate display --teammate-mode in-process (default), auto, tmux, iterm2 claude --teammate-mode tmux How agent-team teammates render. The default changed from auto in v2.1.179.
7. Extensions & Config Claude Code MCP servers --mcp-config, --strict-mcp-config JSON file paths or inline JSON claude --strict-mcp-config --mcp-config ./mcp.json Loads servers from file. The strict flag ignores all other MCP configuration — the reproducible choice for CI.
7. Extensions & Config v2.1.186+ MCP auth claude mcp login|logout <name> Server name, --no-browser claude mcp login sentry --no-browser Runs a server's OAuth flow from the shell without opening /mcp. Use --no-browser over SSH.
7. Extensions & Config Claude Code Plugins --plugin-dir, --plugin-url Directory, .zip, or URL claude --plugin-dir ./my-plugin Session-scoped plugin loading. Repeat the flag for multiple plugins.
7. Extensions & Config Claude Code Settings override --settings, --setting-sources File path or inline JSON; user,project,local claude --settings '{"fastMode": true}' Overrides matching keys in settings.json for this session; omitted keys keep their file values. Max 2 MiB.
7. Extensions & Config Claude Code Browser & IDE --chrome, --ide Toggle (--no-chrome to disable) claude --chrome Chrome integration for web automation and testing; --ide auto-connects when exactly one valid IDE is available.
7. Extensions & Config Claude Code Debugging --debug, --debug-file Category filter, e.g. "api,mcp" or "!statsig" claude --debug "api,hooks" Category filtering keeps the log readable. --debug-file implicitly enables debug mode.
8. Slash Commands In-session Initialize project /init None /init Generates a starter CLAUDE.md. Set CLAUDE_CODE_NEW_INIT=1 for a guided flow covering skills, hooks, and personal memory.
8. Slash Commands In-session Inspect context /context [all] all expands the breakdown /context all Colored grid of what's filling the window, with warnings for context-heavy tools and memory bloat. Run this before compacting.
8. Slash Commands In-session Compact /compact [instructions] Optional focus instructions /compact keep the auth flow and test results Summarizes the conversation to free space while staying on the same task. Focus instructions control what survives.
8. Slash Commands In-session Clear /clear [name] Optional label for the old session /clear auth-work Empty context, project memory intact. Aliases /reset, /new. Recover the prior conversation with /resume or the rewind menu.
8. Slash Commands In-session Plan mode /plan [description] Optional task description /plan fix the auth bug Enters plan mode straight from the prompt so Claude researches and proposes before touching files.
8. Slash Commands In-session Model & effort /model, /effort Model name; low → ultracode, or auto /effort xhigh Both apply immediately without waiting for the current response. In /model, press s to switch for this session only.
8. Slash Commands In-session Code review /code-review [level] [--fix] low…max, ultra; --fix, --comment /code-review high --fix Reviews the diff for correctness bugs plus reuse and simplification cleanups. ultra runs a deep multi-agent review in the cloud.
8. Slash Commands In-session Security review /security-review None /security-review Checks the working diff for security vulnerabilities specifically, separate from the correctness pass.
8. Slash Commands In-session Side question /btw [question] Question text, or blank to reopen /btw what was that config file called? Ephemeral answer in an overlay — sees the full conversation, has no tools, never enters history. Works while Claude is mid-turn.
8. Slash Commands In-session Rewind /rewind None (or Esc Esc) /rewind Rolls code and conversation back to a checkpoint, or summarizes part of the conversation. Can restore context from before a /clear.
8. Slash Commands In-session Goal /goal [condition|clear] Completion condition /goal all tests pass and lint is clean Claude keeps working across turns until the condition holds. clear, stop, or cancel ends it early.
8. Slash Commands In-session Loop /loop [interval] [prompt] Interval like 5m; omit to self-pace /loop 5m check if the deploy finished Repeats a prompt while the session stays open. Omit the prompt to run .claude/loop.md. Alias /proactive.
8. Slash Commands In-session Batch /batch <instruction> Change description /batch migrate src/ from Solid to React Decomposes a codebase-wide change into 5–30 units, then runs one background subagent per unit in its own worktree, each opening a PR. Requires git.
8. Slash Commands In-session Branch / fork /branch, /fork, /background Optional name or prompt /fork try the Redis approach instead /branch switches you into a copy; /fork runs a copy as a separate background session; /background detaches this one and frees the terminal.
8. Slash Commands In-session Memory /memory None /memory Edit CLAUDE.md files, toggle auto-memory, and review what Claude has learned automatically.
8. Slash Commands In-session Permissions /permissions None /permissions Interactive allow / ask / deny rule editor by scope, plus working directories and recent auto-mode denials. Alias /allowed-tools.
8. Slash Commands v2.1.181+ Config /config [key=value ...] Any settable key /config theme=dark model=sonnet Sets settings without opening the UI. Run /config --help to list every key. Alias /settings.
8. Slash Commands In-session Diagnostics /doctor, /debug, /usage Optional issue description /doctor /doctor checks install health, trims bloated CLAUDE.md files, and flags unused skills and slow hooks before changing anything. /cost is an alias of /usage.
8. Slash Commands In-session Diff & export /diff, /export, /copy Optional filename; /copy N /export review-notes.txt /diff opens an interactive viewer for uncommitted and per-turn changes; /copy picks individual code blocks.
9. Keyboard & Input In-session Cycle permission mode Shift+Tab Alt+M on some Windows runtimes Shift+Tab → plan mode Cycles Manual → acceptEdits → plan, plus any modes you've enabled such as auto or bypassPermissions.
9. Keyboard & Input In-session Interrupt Esc Single press Esc → redirect mid-turn Stops the response or tool call mid-turn and keeps the work done so far. Closes a dialog instead when one is open.
9. Keyboard & Input In-session Rewind menu Esc Esc Double press on empty prompt Esc Esc → checkpoint list On an empty prompt, opens the rewind menu. With text in the prompt, clears the draft and saves it to history.
9. Keyboard & Input In-session Transcript viewer Ctrl+O Toggle Ctrl+O → full tool detail Shows detailed tool usage with timestamps and per-message model, and expands collapsed MCP calls.
9. Keyboard & Input In-session History search Ctrl+R Ctrl+S cycles scope in fullscreen Ctrl+R → search past prompts Reverse-searches prompt history across all projects. In fullscreen it opens a dialog scoped to session, project, or everything.
9. Keyboard & Input In-session Background a task Ctrl+B Press twice in tmux Ctrl+B → detach the build Moves a running Bash command or agent to the background so the turn continues.
9. Keyboard & Input In-session External editor Ctrl+G Ctrl+X Ctrl+E also works Ctrl+G → write prompt in $EDITOR Composes long prompts in your default editor. Optionally prepends Claude's last reply as commented context.
9. Keyboard & Input In-session Toggle thinking / fast Option+T, Option+O Alt+ on Windows and Linux Option+T → extended thinking off Thinking toggle has no effect on Fable 5, which always uses extended thinking. Option+P switches model without clearing your prompt.
9. Keyboard & Input In-session Input prefixes / ! @ : First character of the prompt ! npm test / command, ! shell mode, @ file path autocomplete, : emoji shortcode. Shell output lands in context and Claude responds to it.
9. Keyboard & Input In-session Multiline input Shift+Enter, \+Enter, Ctrl+J Terminal dependent Ctrl+J → newline anywhere Ctrl+J works in any terminal with no setup. For VS Code, Cursor, Alacritty, and Zed, run /terminal-setup to install the Shift+Enter binding.
10. Claude API Messages API Model model claude-opus-5, claude-sonnet-5, claude-haiku-4-5-20251001, claude-fable-5, claude-opus-4-8 model="claude-opus-5" Required. Opus for complex agentic work, Sonnet for balanced throughput, Haiku for fast and cheap.
10. Claude API Messages API Max tokens max_tokens Integer, model dependent max_tokens=16000 Required. Hard ceiling on total output for the turn, thinking tokens included.
10. Claude API Messages API Messages messages Array of {role, content} [{"role":"user","content":"Hello"}] The API is stateless — send the full conversation every request. Content can mix text, images, documents, and tool results.
10. Claude API Messages API System prompt system String or content-block array system="You are a technical editor." Top-level, not a message role. Use the array form to attach cache_control breakpoints for prompt caching.
10. Claude API Messages API Thinking thinking {"type":"adaptive"|"enabled"|"disabled"}, display, budget_tokens thinking={"type":"adaptive","display":"summarized"} Adaptive lets Claude decide how much to reason and is the path forward on newer models. With manual enabled, budget_tokens must be ≥1024 and below max_tokens.
10. Claude API Messages API Tools tools Array of {name, description, input_schema} tools=[weather_tool] Description quality is the single biggest driver of tool-use accuracy: say what it does, when not to use it, and what each parameter means.
10. Claude API Messages API Tool choice tool_choice auto, any, tool, none tool_choice={"type":"tool","name":"get_weather"} With extended thinking, only auto and none are supported. disable_parallel_tool_use forces one call at a time.
10. Claude API Messages API Streaming stream true / false (default false) stream=True Server-sent events: message_start → content blocks → message_deltamessage_stop. Token counts in message_delta are cumulative.
10. Claude API Messages API Stop sequences stop_sequences Array of strings stop_sequences=["\n\nHuman:"] Ends generation when a sequence appears. The matched value comes back in stop_sequence on the response.
10. Claude API Messages API Beta headers betas e.g. interleaved-thinking-2025-05-14 betas=["interleaved-thinking-2025-05-14"] Interleaved thinking lets Claude think between tool calls, and is the one case where budget_tokens may exceed max_tokens. Newer models enable it automatically with adaptive thinking.
11. Deprecated & Removed Legacy — API Sampling controls temperature, top_p, top_k Default value only on newer models temperature=0.3 # 400 error Not supported on Claude 4.7 and later or Mythos Preview — a non-default value returns 400. Omit them and steer behavior through the prompt instead.
11. Deprecated & Removed Legacy — API Response prefill assistant turn as last message Removed on 4.6+ {"role":"assistant","content":"The answer is ("} Returns 400 on Claude 4.6 and later and on Mythos Preview. Use structured outputs or system-prompt instructions to shape the response instead.
11. Deprecated & Removed Removed v2.1.111 Auto mode flag --enable-auto-mode claude --permission-mode auto Auto mode is now in the Shift+Tab cycle by default. Use --permission-mode auto to start in it.
11. Deprecated & Removed Removed v2.1.91 PR comments /pr-comments "show me the review comments on this PR" Just ask Claude directly now. Related: /review still gives a fast read-only pass over a GitHub PR.
11. Deprecated & Removed Deprecated alias Remote flag --remote Task description claude --cloud "Fix the login bug" Deprecated alias for --cloud, which creates a web session on claude.ai. Pull it back down locally with --teleport.

Prompt Architecture & Working Vocabulary

[Context & Role] + [Concrete Task] + [Constraints & Guardrails] + [Reference Material] + [Output Contract]

1. Context & Role

Say what world this lives in and who's asking (e.g. this is a Rails 7 monolith; I'm the on-call engineer, it's 2am). Persistent context belongs in CLAUDE.md, not every prompt.

2. Concrete Task

One verb, one outcome. Find why the checkout webhook times out beats look at the webhook. Vague asks produce vague diffs.

3. Constraints & Guardrails

State the boundaries up front (e.g. don't change public APIs, smallest diff that passes tests, ask before installing anything).

4. Reference Material

Point at real artifacts: @src/auth.ts, a pasted stack trace, ! git diff. Specific beats descriptive every time.

5. Output Contract

Name the shape you want back — a plan, a unified diff, a JSON object, three options ranked. Ambiguous format is the most common cause of rework.

Task Verbs (A–Z)

Audit Benchmark Bisect Consolidate Document Extract Instrument Migrate Profile Refactor Reproduce Trace

Constraint Phrases (A–Z)

Ask before editing Don't add dependencies Don't touch public APIs Match existing patterns No new abstractions Smallest diff that works Stop after the plan Tests must stay green

Output Contracts (A–Z)

Bulleted list, no prose Comparison table JSON matching this schema One paragraph, no headers Plan first, then confirm Ranked shortlist of 3 Unified diff only

Reasoning Depth (A–Z)

Consider the failure modes Flag what you're unsure about List 3 approaches, then pick Read before you write State assumptions first What would break this?

Verification Demands (A–Z)

Cite file:line Prove it with a script Reproduce before fixing Run the tests, show output Show the failing case Verify, don't assume

Context Anchors (A–Z)

@path/to/file ! git diff ! npm test /context CLAUDE.md Pasted stack trace Screenshot paste

Top 20 High-Signal CLAUDE.md Entries (A–Z)

Branch naming convention Build command Commit message format Deploy is manual — never trigger Directories that are generated Error-handling convention Files never to edit Formatter and lint command Known flaky tests Local dev setup gotchas Logging convention Migration workflow Package manager (npm vs pnpm) Preferred test framework Secrets live in X, never inline Single test command Style rules that differ from defaults Test command Type-check command Where new modules go

Cool Tips & Tricks

Diagnose Before You Compact
/compact is a blunt instrument. Run /context first to see what's actually eating the window — it's often one enormous file read or an MCP server you forgot you connected. /context all → /compact keep the auth flow and test results Same task → compact. Different task → clear.
Bare Mode for Scripts
Skipping auto-discovery of hooks, skills, plugins, MCP servers, and CLAUDE.md makes scripted calls start noticeably faster and behave reproducibly across machines. claude --bare -p "does this handle null inputs?" < src/parse.ts Docs note this will become the default for -p.
Plan Before Big Changes
For anything spanning more than a couple of files, enter plan mode first so Claude researches and proposes before editing. Cheaper to redirect a plan than to unwind a diff. Shift+Tab → plan | /plan fix the auth bug
/btw vs. Subagent
They're exact inverses. /btw sees your whole conversation but has no tools — for asking about what Claude already knows. A subagent has full tools but starts empty — for going and finding out something new. /btw which file did you say held the retry logic? Both keep the main context clean.
Parallel Work Without Collisions
Worktrees give each session its own checkout, so two agents can't stomp each other's files. Pair with claude agents to watch them all from one screen. claude -w feature-auth --bg "implement the token refresh"
Shell Mode Round-Trip
Prefix with ! to run a command directly. The output lands in context and Claude responds to it — so you get an explanation of the failure without a second prompt. ! npm test Set respondToBashCommands: false to silence the auto-response.
Cap Spend in CI
Unattended runs deserve a hard ceiling. Subagent spend counts toward the cap, and running background subagents get stopped when it's reached. claude -p --max-budget-usd 3.00 --max-turns 10 "triage this failure"
When Config Goes Weird
--safe-mode disables every customization at once, so you can tell in one run whether a plugin, hook, or skill is the culprit. Unlike --bare, permissions and models still work normally. claude --safe-mode Then narrow it down with /doctor.

Project Standards & Framework

Rule 1: CLAUDE.md Discipline

CLAUDE.md loads into every session, so every line costs context forever. Keep only what Claude can't work out by reading the code:

  • Keep the non-derivable: pitfalls, rationale, and conventions that differ from tool defaults. Claude can read your directory layout; it can't guess that make test is broken and you use pytest -x.
  • Cut the derivable: directory listings, dependency lists, and architecture overviews belong in the codebase, not in permanent context. /doctor will offer to trim these for you.
  • Push detail down: move on-demand guidance into skills and nested per-package CLAUDE.md files so it loads only when relevant.
  • Never mid-session: CLAUDE.md edits don't apply until the next session — the prompt cache is already built. Use /memory to edit and restart to apply.
Rule 2: Permission Posture by Environment

Match the mode to the blast radius, not to your patience:

  • Exploring an unfamiliar repo: plan mode. Claude reads and proposes, nothing is written.
  • Normal feature work: acceptEdits or auto, with a project allowlist so read-only commands stop prompting. Build it with /fewer-permission-prompts.
  • Unattended CI: --strict-mcp-config, an explicit --tools list, --max-turns, and --max-budget-usd. Constrain the agent rather than trusting the prompt.
  • bypassPermissions: containers and disposable runners only. It skips the checks that stop a bad command, and the mode persists across supervisor restarts for background sessions.
Rule 3: Session Hygiene

Context quality degrades long before the window is full. Defaults worth adopting:

  • New task, new session. /clear beats fighting drift from an unrelated conversation. Project memory survives.
  • Name sessions you'll come back to with -n or /rename, so /resume is a list of tasks rather than a list of timestamps.
  • Branch instead of arguing. Trying a second approach? /branch preserves the first so you can compare rather than reconstruct.
  • Review before you ship: /diff to see it, /code-review for correctness, /security-review for vulnerabilities.
Standard CLAUDE.md Template
# Project: [name] ## Commands - Test: [single command] - Type-check: [single command] - Lint: [single command] - Build: [single command] ## Conventions that differ from defaults - [e.g. we use tabs, not spaces — the formatter enforces it] - [e.g. errors are returned, never thrown, outside the HTTP layer] - [e.g. new modules go in src/features/<name>/, not src/lib/] ## Gotchas - [e.g. the auth tests are flaky in CI; rerun once before investigating] - [e.g. never edit db/schema.rb by hand — it's generated by migrations] ## Do not - Deploy, or run anything under scripts/prod/ - Add dependencies without asking - Touch [generated directory]

Claude & Claude Code Reference Guide • Claude Code v2.1.x • Claude API

Verified against the official docs at code.claude.com and platform.claude.com. Claude Code ships frequently — check /release-notes for changes.

All rights reserved 2026 | Made with in Los Angeles, CA | Built by Tyler N.