Claude Code: Best practices for agentic coding

anthropic.com ยท article ยท 2025-04-18 source โ†— Reader ๐Ÿ–ฅ๏ธ

Agent HarnessCapability Provisioning (right-sizing to the task)Claude CodeAgent Context Files (CLAUDE.md / AGENTS.md)Context EngineeringExtended Thinking / ReasoningFeedback LoopsMCP (Model Context Protocol)Multi-Agent OrchestrationTest-Driven Development
Because Claude Code is deliberately low-level and unopinionated, its effectiveness on your problem is set by the harness you engineer around the model โ€” the context, tools, and workflow you supply โ€” not by the raw model alone.

practical ยท expository prescriptive guide โ€” A best-practices guide: it argues 'you should do X' for agentic coding with Claude Code, grounding each recommendation in claims about how the tool and model behave. Organized as six numbered sections (customize setup, give more tools, common workflows, optimize workflow, headless mode, multi-Claude) of experience-derived patterns rather than a single sustained argument.

Structure

PartRole
Introduction โ€” Claude Code as an intentionally low-level, unopinionated, scriptable power tool with a resulting best-practices learning curveStates the design philosophy that makes the whole guide necessary: flexibility is pushed onto the user, so the user must supply the workflow
ยง1 Customize your setup โ€” CLAUDE.md files, tuning them as prompts, curating the tool allow-list, installing the gh CLIThe foundational harness-configuration layer: persistent context and permissions the model reads every session
ยง2 Give Claude more tools โ€” bash environment, MCP servers, custom slash commandsExtends the harness with the model's action surface โ€” shell tools, MCP integrations, and codified reusable prompts
ยง3 Try common workflows โ€” explore-plan-code-commit, TDD, screenshot-iterate, safe YOLO, codebase Q&A, git, GitHub, JupyterThe core catalogue of repeatable workflow patterns that structure how the human drives the agent
ยง4 Optimize your workflow โ€” be specific, give images, mention files/URLs, course-correct, /clear, checklists/scratchpads, pass dataCross-cutting techniques for steering the model and managing its context that apply across all workflows
ยง5 Use headless mode to automate infra โ€” issue triage, subjective code review/lintingExtends the tool from interactive assistant to programmatic building block in CI, hooks, and automation
ยง6 Uplevel with multi-Claude workflows โ€” writer/verifier separation, multiple checkouts, git worktrees, headless custom harness (fan-out, pipelining)Scales beyond a single interactive session by parallelizing and separating context across multiple instances

Key terms

Propositions

Arguments

You should invest effort in engineering the context and tools around Claude Code (CLAUDE.md, allow-list, MCP, custom scripts and slash commands) rather than just prompting the raw model. strength: high
Explicit premises:
Implicit premises:
Inferences:
Give Claude a clear, checkable target (tests, a visual mock, or expected output) and let it iterate against that target. strength: high
Explicit premises:
Implicit premises:
Inferences:
Intervene early โ€” force a plan before code and correct course continuously โ€” rather than letting Claude run to completion. strength: high
Explicit premises:
Implicit premises:
Inferences:

Narratives

Questions addressed

Gaps

Closes gaps elsewhere

Related documents