Anthropic Gives Claude Coding Best Practices One Pager

The highlights of the Anthropic Claude Coding Best practices:

1. Tailor Your Environment

Use CLAUDE.md files: Placed in your repo (root, parent, child, or home directory), this auto-included file allows you to document project-specific instructions—bash commands, style guidelines, setup tips, common caveats, etc. Keep it concise and iterate it over time.

Tune permissions: Claude Code prompts for permission when performing actions like file editing or running bash commands. You can customize allowed tools via prompts, using .claude/settings.json, or CLI flags to streamline workflows.

Integrate gh CLI: Installing GitHub CLI enhances Claude’s ability to manage issues, PRs, and more directly.

2. Expand Claude’s Toolbox

Leverage bash tools: Claude inherits your shell tools—just document custom tools in CLAUDE.md so it recognizes them.

Use MCP (Model Context Protocol): Claude can access external MCP-capable tools (e.g., Puppeteer, Sentry). Define them in project/global configuration or .mcp.json so they’re automatically recognized.

Create custom slash commands: Store reusable workflows (e.g., “fix GitHub issue”) in .claude/commands using $ARGUMENTS placeholders. These show up as slash commands for easy reuse across your team.

3. Follow Established Workflows

Explore → Plan → Code → Commit: Have Claude inspect files, plan using “think” commands (like “think harder”), write code, then commit with a PR. Planning first improves effectiveness.

Test-driven development (TDD) cycle: Ask Claude to write tests, commit them, then write code to pass tests—and iterate, possibly using subagents to verify correctness.

Visual iteration workflow: Supply prototypes (e.g., screenshots), ask Claude to implement, review results, and iterate. Repeat until visually accurate.

Safe YOLO mode: Use –dangerously-skip-permissions in quarantined containers for bulk edits—risky but efficient in isolated environments.

Codebase Q&A: Claude can answer questions about unfamiliar codebases—substitute for pair programming to explain logic, file behavior, or code design.

Git and GitHub integration: Claude can write commit messages, handle revert or rebase conflicts, generate and triage pull requests, review code, and interact with GitHub using gh.

Jupyter notebook support: Claude can interpret outputs and visuals in notebooks, reshape code aesthetics, and improve readability.

4. Optimize Your Workflow

Be precise in prompts: Clear, detailed instructions yield better results and reduce iterations. For example: specify edge cases, avoid vague commands like “add a calendar widget.”

Use visuals: Paste or embed images to help Claude align to visual requirements—essential for UI tasks.

Reference files and URLs: Use tab-complete to specify files, and include URLs for docs. Use allowlists to avoid repeated permission prompts.

Course-correct early: Use /clear, interrupt with Escape, or tweak prompts to guide Claude. Regularly clean context to avoid drift.

Use checklists/scratchpads: For multi-step tasks (like refactoring or bulk lint fixes), have Claude produce checklists in Markdown and tick them off as it progresses.

Use data injection: Feed logs or CSVs via pipes, bash, or tools to help Claude reason over real data.

5. Automate with Headless Mode

Use claude -p for non-interactive usage (e.g., CI scripts), combined with –output-format stream-json for structured responses—great for automating reviews, migrations, or batch processing.

Use Claude as a linter: Automate code reviews via styles or semantic checks that traditional linters miss.

6. Advance with Multi-Claude & Parallel Workflows

Claude reviewing itself: Run one Claude to write code and another (separate session) to review. Repeat context resets to refine output.

Parallel worktrees: Use multiple Git worktrees or clones with separate Claude sessions running independent tasks—great for parallel feature work.

Headless harnesses & pipelining: Programmatically call Claude in loops or pipelines for bulk tasks like migrations or scraping.