Claude Code: Best practices for agentic coding
https://www.anthropic.com/engineering/claude-code-best-practices
#Claude_Code
1. Customize your setup
a. Create CLAUDE.md files
b. Tune your CLAUDE.md files
c. Curate Claude's list of allowed tools
d. If using GitHub, install the gh CLI
2. Give Claude more tools
a. Use Claude with bash tools
b. Use Claude with MCP
.mcp.json
c. Use custom slash commands
3. Try common workflows
a. Explore, plan, code, commit
b. Write tests, commit; code, iterate, commit
c. Write code, screenshot result, iterate
Puppeteer MCP server
d. Safe YOLO mode
e. Codebase Q&A
f. Use Claude to interact with git
g. Use Claude to interact with GitHub
h. Use Claude to work with Jupyter notebooks
4. Optimize your workflow
a. Be specific in your instructions
b. Give Claude images
c. Mention files you want Claude to look at or work on
d. Give Claude URLs
e. Course correct early and often
Double-tap Escape to jump back in history
f. Use /clear to keep context focused
g. Use checklists and scratchpads for complex workflows
h. Pass data into Claude
5. Use headless mode to automate your infra
a. Use Claude for issue triage
For example, the public Claude Code repository uses Claude to inspect new issues as they come in and assign appropriate labels.
b. Use Claude as a linter
6. Uplevel with multi-Claude workflows
a. Have one Claude write code; use another Claude to verify
b. Have multiple checkouts of your repo
Create 3-4 git checkouts in separate folders
Open each folder in separate terminal tabs
Start Claude in each folder with different tasks
c. Use git worktrees
Run parallel Claude Code sessions with Git worktrees
d. Use headless mode with a custom harness
claude -p (headless mode)
https://simonwillison.net/2025/Apr/19/claude-code-best-practices/