Back to agent

Anthropic·Official

Best practices for Claude Code

Anthropic's own guide to working with Claude Code. Nearly every tip follows from one constraint: the context window fills up fast, and quality drops as it does.

  • Give Claude a check it can run, such as tests, a build or a screenshot comparison, so it can iterate without you as the only verifier.
  • Explore and plan in plan mode first, then implement and commit. Skip the plan when you could describe the diff in one sentence.
  • Be specific in prompts: name the files, point to existing patterns and describe a bug by its symptom.
  • Keep CLAUDE.md short and limited to what Claude can't infer from the code. Use hooks for rules that must always run and skills for knowledge needed only sometimes.
  • Manage context actively: clear between unrelated tasks, rewind bad turns, and send research to subagents.
  • Scale up with headless `claude -p`, parallel sessions and worktrees, and have a fresh session review the work.

This is a summary in our own words, not the article itself. Read the original for the full text.

Original article · Anthropic ↗