Planning
Always start in Plan Mode
Switch to Plan Mode (Shift+Tab) to inspect architecture and agree on the approach before any file is edited.
Planning
Interview first, execute in a fresh session
Start with a minimal spec and ask Claude to interview you via AskUserQuestion, then execute the finished spec in a clean session.
Planningautonomous
Slice vertically (tracer bullets)
Break PRDs into vertical slices across DB + service + UI. AI defaults to horizontal layers, delaying end-to-end feedback until the end.
Planning
Phase-gate every plan with tests
Attach explicit unit, integration, or end-to-end verification checks to each phase so Claude proves progress before moving on.
Planning
Review plans with a second Claude or Codex
Spin up a fresh Claude as a staff engineer—or run a cross-model review—to critique your plan before writing code.
Planning
Prototype rapidly when specs are uncertain
When building is cheap, generate multiple working prototypes to discover the right design instead of over-polishing a speculative PRD.
Context
Stay under ~40% context for hard work
Quality degrades in the 'dumb zone' past ~40% context (and ~300–400k tokens on 1M models). Reset aggressively on complex reasoning.
Contextautonomous
Rewind beats correcting in-place
Double-Esc or /rewind back before a failed attempt and re-prompt with what you learned instead of polluting context with failed retries.
Context
Manual /compact <hint> beats auto-compact
Pass an explicit focus hint (/compact focus on auth refactor, drop test logs). Auto-compact fires when context rot is already peaking.
Contextautonomous
Offload noisy searches to subagents
Ask: 'Do I need the raw tool outputs or just the conclusion?' 20 file reads and 12 greps stay in the subagent; only the answer returns.
Sessions
Treat every turn as a branching point
After each turn, consciously choose Continue, /rewind, /compact, /clear, or Subagent based on how much context truly helps next.
Sessions
New task = new session
Reuse context for tight follow-ups (like docs for what you just built), but start a clean session for unrelated tasks.
Sessions
Use 'summarize from here' before rewinding
Have Claude write a crisp handoff note from its future self before rewinding, keeping discoveries without the dead-end noise.
Sessions
/rename parallel sessions for easy /resume
When running multiple Claude instances across tasks or worktrees, label each with /rename so you can jump back cleanly.
CLAUDE.md & Rules
Target under 200 lines in CLAUDE.md
Long instruction files get ignored. Keep root CLAUDE.md tight (~60–200 lines) and split domain details into .claude/rules/.
CLAUDE.md & Rules
Lazy-load rules with paths: frontmatter
Files in .claude/rules/*.md auto-load by default—add paths: globs in YAML frontmatter so rules load only when matching files are touched.
CLAUDE.md & Rules
Wrap conditional rules in <important if="...">
Explicit conditional XML tags help prevent Claude from overlooking domain-specific rules as instructions grow.
CLAUDE.md & Rules
Use ancestor + descendant CLAUDE.md in monorepos
Ancestors load at startup; subdirectory CLAUDE.md files load lazily when Claude reads files there; sibling packages never pollute context.
CLAUDE.md & Rules
Make 'run the tests' work on the first try
If a fresh Claude session cannot immediately build and test your repo, your CLAUDE.md is missing essential setup commands.
CLAUDE.md & Rules
Enforce deterministic rules in settings.json, not prose
Never write 'NEVER add Co-Authored-By' in CLAUDE.md when attribution.commit: "" in .claude/settings.json is 100% deterministic.
CLAUDE.md & Rules
Finish partial framework migrations
Half-migrated codebases confuse models into copying legacy patterns instead of your preferred architecture.
Skills
Skills are folders, not single files
Organize references/, scripts/, and examples/ subdirectories for progressive disclosure instead of dumping everything into SKILL.md.
Skills
Write description as a model trigger, not a summary
Claude uses description (and when_to_use) to decide when to auto-invoke a skill—phrase it around concrete user intents.
Skills
Maintain a Gotchas section in every skill
Record real failure modes Claude hits over time—Gotchas are the highest-signal lines in any skill.
Skills
Use context: fork for isolated skill execution
Set context: fork (and optional agent:) in frontmatter so intermediate tool calls stay in a child subagent and only the final output returns.
Skills
Inject live shell output with !`command`
Embed !`command` in SKILL.md or commands to execute shell commands at invocation time so the model only sees the fresh output.
Skillsautonomous
Give goals and scripts, don't railroad every step
Include helper scripts so Claude composes rather than re-writing boilerplate, and focus prose on non-obvious constraints.
Agents & Commands
Build feature-specific subagents with preloaded skills
Domain-focused subagents with preloaded skills outperform generic 'QA engineer' or 'backend engineer' personas.
Agents & Commands
Turn any daily repeated task into a /command or skill
If you do an inner-loop workflow more than once a day (tech debt, context dump, release check), check it into .claude/commands/ or skills.
Agents & Commands
Use test-time compute with separate windows
A separate context window running the exact same model will often spot bugs the original coding session missed.
Agents & Commands
Pair git worktrees with Agent Teams for parallel work
Use claude -w (git worktrees) and tmux-backed Agent Teams to run independent features simultaneously without merge conflicts.
Hooks & Safetyautonomous
Use /sandbox and Auto Mode over skip-permissions
File/network sandboxing cuts permission prompts by ~84%, and Auto Mode uses a classifier to block risky actions.
Hooks & Safety
Auto-format with a PostToolUse hook
Let a deterministic PostToolUse hook handle the last 10% of formatting so CI never fails on style.
Hooks & Safety
Use Stop hooks and on-demand safety hooks
Add Stop hooks to nudge end-of-turn verification, and skill-scoped hooks like /careful (block destructive ops) or /freeze (lock edit scope).
Hooks & Safety
Run /fewer-permission-prompts to tune allowlists
Scan your session history for safe, repeated read-only Bash/MCP calls and generate wildcard allowlists like Bash(npm run *).
Git & Review
Keep PRs small (~118 lines median) and squash merge
One focused feature per PR with squash merge keeps linear history trivial to review, bisect, and revert.
Git & Review
Run /code-review and /simplify before merging
Use /code-review for multi-agent correctness & security bugs, and /simplify for cleanup and reuse—they serve distinct jobs.
Git & Reviewautonomous
Tag @claude on PRs to generate lint rules
Turn recurring human review feedback into automated lint rules so the same mistake never appears twice.
Git & Reviewautonomous
Build a /go or /ship end-to-end verification skill
Chain live app testing + /simplify + PR creation so you return to verified, ready-to-review code.
Debugging
Give Claude real eyes: screenshots + browser MCP
Paste screenshots when stuck, or enable Claude in Chrome / Playwright / Chrome DevTools MCP so Claude reads console errors itself.
Debugging
Run dev servers as background tasks
Ask Claude to launch the server whose logs you want inspected as a background task so it can read live errors while iterating.
Debugging
Agentic search (glob + grep) beats vector RAG
Claude Code relies on live glob/grep instead of stale vector indexes—keep file names and module boundaries clean so search excels.
Debugging
Use /doctor for CLI, auth, and config diagnostics
Run /doctor whenever authentication, MCP discovery, or settings behave unexpectedly.
Prompting & Limitsautonomous
Challenge Claude to prove it works
Ask 'grill me on these changes before opening a PR' or 'diff against main and prove this works' instead of rubber-stamping.
Prompting & Limitsautonomous
Scrap mediocre fixes for the elegant solution
When a patch feels hacky, tell Claude: 'Knowing everything you know now, scrap this and implement the elegant solution.'
Prompting & Limitsautonomous
Paste the bug, say 'fix', don't micromanage
Give the exact error, reproduction, and acceptance criteria—let Claude diagnose the root cause instead of dictating line edits.
Prompting & Limits
Tune effort, thinking, /focus, and /voice
Use Opus for planning, adaptive effort (low→max) or ultrathink for hard reasoning, /focus to hide noise, and /voice for fast dictation.
Prompting & Limits
Check /usage, free limit resets, and Console credits
Track limits with /usage, check Settings → Usage for occasional free resets, and link a Console org on Max/Ultra for monthly API credits.