# Claude Code best practices: what Anthropic and its builders recommend

The habits that make the biggest difference, from Anthropic's own guide and the people who build Claude Code, with the commands for each.

Published 2026-10-07 by Richard Kaminsky and Mitchell Lipyansky, the co-founders of Poly. Canonical: https://usepoly.co/claude-code-best-practices
Poly is a multiplayer AI coding workspace: a shared room where your team works with one AI agent, together. Free to start: https://usepoly.co/

**The single most important Claude Code practice, according to both Anthropic's documentation and Boris Cherny, who created Claude Code, is to give Claude a way to check its own work: tests, a build or a screenshot to compare. Cherny says it improves quality "2-3x." The rest follow from how Claude works: its context window fills fast and performance drops as it does, so plan before large changes, keep CLAUDE.md short, clear context between tasks, use subagents for side work, and correct course early.**

## Key takeaways

- **Verify:** give Claude a test, build or screenshot it can run, and ask for evidence, not claims.
- **Plan first** for anything bigger than a one-sentence change. Plan mode is Shift+Tab.
- **Keep context clean:** `/clear` between tasks, `/compact` within long ones, subagents for noisy work.
- **Keep CLAUDE.md short,** under 200 lines, shared in git, and updated whenever Claude repeats a mistake.
- **Stay safe:** auto mode or allowlisted permissions over skipping them; bypass mode only in isolated containers.

*Claude Code practices and the commands for each, from Anthropic's docs, October 7, 2026.*

| Practice | How | Why |
| --- | --- | --- |
| Verify | Tests, builds, screenshots; a Stop hook or verifier subagent | Quality, and sessions you can walk away from |
| Plan first | Plan mode (Shift+Tab) | Fewer wrong turns on bigger changes |
| Short CLAUDE.md | /init; under 200 lines; update after mistakes | Instructions Claude actually follows |
| Clean context | /clear, /compact, subagents | Performance drops as context fills |
| Parallel work | Git worktrees, several sessions | More done at once |
| Shared setup | Commit .claude/settings.json, hooks, skills | The whole team works the same way |
| Safety | Auto mode or /permissions; sandbox; deny secrets | Fewer prompts without giving up control |

## Give Claude a way to verify its work

Anthropic's guide puts this first: "Give Claude a check it can run: tests, a build, a screenshot to compare. It's the difference between a session you watch and one you walk away from" ([Anthropic](https://code.claude.com/docs/en/best-practices)). Ways to enforce it, from loosest to strictest: ask in the prompt, set a goal, add a Stop hook that blocks finishing until checks pass, or have a separate subagent verify so the agent doing the work isn't grading it. Ask Claude to show evidence rather than say it's done.

Cherny, in January 2026, called it his most important tip: "give Claude a way to verify its work… it will 2-3x the quality" ([Boris Cherny on X](https://x.com/bcherny/status/2007179832300581177)).

## Explore, plan, then code

For anything bigger than a small fix, start in plan mode (Shift+Tab): let Claude read the relevant code, propose a plan, and edit the plan before it writes code. Anthropic's rule of thumb: "If you could describe the diff in one sentence, skip the plan." For a larger feature, have Claude interview you with questions, write the answers to a spec file, and build from it in a fresh session. Cherny's team adds a step: have a second Claude review the plan ([Boris Cherny on X](https://x.com/bcherny/status/2017742741636321619)).

## Be specific, and point to sources

Scope the task, name the files, point to existing patterns to follow, and describe symptoms rather than guesses. Pass context directly: `@file` references, pasted screenshots, URLs, or piped logs. Use command-line tools such as `gh`, which Anthropic calls the most context-efficient way to work with GitHub.

## Keep CLAUDE.md short and current

- Generate a starter with `/init`, commit it, and share it with the team; Cherny's team edits theirs several times a week.
- For each line, ask: "Would removing this cause Claude to make mistakes?" Anthropic warns that bloated files make Claude ignore your real instructions.
- After correcting Claude, tell it to update CLAUDE.md so it doesn't repeat the mistake.
- Move procedures you use often into skills: "If you do something more than once a day, turn it into a skill or command," Cherny's team advises.

More in [CLAUDE.md vs AGENTS.md](/claude-md-vs-agents-md).

## Manage context

- **`/clear`** between unrelated tasks. "If you've corrected Claude more than twice on the same issue," Anthropic says, clear and start again with a better prompt.
- **`/compact`** with instructions on what to keep, partway through a long task.
- **Subagents** for investigation and noisy work such as test runs, so only the result lands in your conversation ([agent teams vs subagents](/claude-code-agent-teams)).
- **Esc** stops Claude mid-step; `/rewind` returns to a checkpoint.

These also make your usage limits last ([Claude Code usage limits](/claude-code-usage-limits)).

## Run work in parallel

Cherny calls running three to five git worktrees in parallel "the single biggest productivity unlock," and runs several Claude sessions at once himself, in the terminal and on the web ([Claude Code worktrees](/claude-code-worktrees)). Other patterns from Anthropic's guide: a writer session and a separate reviewer session, `claude -p` in scripts and CI, and `/batch` for changes spread across many files.

## Set up your environment

- **Permissions:** allowlist safe commands with `/permissions` and commit them in `.claude/settings.json` so the team shares them.
- **Hooks** for what must happen every time, such as formatting after each edit.
- **MCP servers** and command-line tools for the systems Claude needs to reach.
- **Model and effort:** Cherny uses the most capable model with high effort; Anthropic's cost guide suggests Sonnet for most coding to save usage.

## Stay safe

- **Auto mode** cuts permission prompts with a classifier that blocks risky actions, but Anthropic says it "does not guarantee safety" ([Anthropic](https://code.claude.com/docs/en/permission-modes)).
- **Bypass permissions** only "in isolated environments like containers, VMs, or dev containers without internet access"; it offers no protection against prompt injection.
- **The sandbox** (`/sandbox`) limits what commands can touch, on macOS, Linux and WSL2 ([Is Claude Code safe?](/claude-code-security)).
- **Secrets:** add deny rules such as `Read(./.env)` so Claude can't read them.

## Where to learn more

Anthropic's free courses, Claude Code 101 and Claude Code in Action, are on its academy site, and the quickstart covers first steps ([Can non-technical people use Claude Code?](/claude-code-for-non-technical-people)).

## Best practices for a team

Most of these habits assume one person at the keyboard. When a team works with one agent, the plan, the checks and the approvals need to be shared too. Poly (usepoly.co) runs Claude Code in a browser room where everyone sees the plan and each step live, and any member can approve a change before it happens. Free to start. [What is Poly?](/what-is-poly)

## Common questions

**What is the most important Claude Code best practice?**

Give Claude a way to verify its work, such as tests, a build or a screenshot to compare. Both Anthropic's guide and Boris Cherny, who created Claude Code, put it first.

**How long should CLAUDE.md be?**

Short: Anthropic suggests under 200 lines. Keep only lines that would change Claude's behavior if removed, and move longer procedures into skills.

**When should I use plan mode in Claude Code?**

For anything bigger than a change you could describe in one sentence. Press Shift+Tab, let Claude explore and propose a plan, and edit it before Claude writes code.

**How do I make Claude Code use fewer tokens?**

Clear context between tasks with /clear, compact long sessions, use subagents for noisy work, keep CLAUDE.md short, use Sonnet for most coding and turn off MCP servers you don't need.

**Is it safe to skip permissions in Claude Code?**

Only in an isolated container or VM without internet access, Anthropic says. For fewer prompts elsewhere, use auto mode or allowlist safe commands with /permissions.

More guides: https://usepoly.co/guides · Security: https://usepoly.co/security · Pricing: https://usepoly.co/pricing
