Best Practices
The rules below are not theoretical best practices. They are distilled from hundreds of hours of production use by engineering teams working with Claude Code daily. Every rule exists because someone learned it the hard way. Internalizing these from day one will save you significant time and frustration.
Rule 01: Start With Least Privilege
To revisit our quarterback-and-coach analogy, a quarterback may be able to run the entire offense, but the coach does not yet know how they will perform within the system. The coach needs to see how they read complicated defenses, follow the playbook, respond under pressure, and recover when a play breaks down. The same is true when getting comfortable with AI agents. The model may be capable of operating autonomously, but the uncertainty is on the human side.
Start with least privilege:
- ☐ Give it contained tasks with clean boundaries.
- ☐ Limit access to sensitive information and destructive commands.
- ☐ Require tests and other forms of validation.
- ☐ Review its decisions closely enough to understand its tendencies.
As you become more comfortable with its performance, expand its permissions and the scope of work it can handle. Move from isolated fixes to complete features, broader repository changes, and long-running autonomous tasks.
Once you are comfortable using Claude Code, you should not approve every command or edit. That prevents autonomy.
Instead, humans should step in where business knowledge, architectural judgment, risk tolerance, or irreversible decisions are required. Claude Code owns the execution; we own the direction and consequential changes. The workflow should define when control changes hands.
We covered this in the context window section, but it bears repeating as a rule: monitor your context usage and compact proactively.
Watch the Ctx(u) indicator in your statusline. When it hits 70%, run /compact. When it hits 85%, start a fresh session — but do not just quit. Write a handoff note first so the new session can pick up exactly where you left off.
A handoff is how you transfer knowledge between sessions. Before ending a session, ask Claude to summarize the current state — what was accomplished, what is left to do, what decisions were made, and any gotchas the next session should know about. Paste that summary into the new session's first message. This gives fresh Claude full context in a fraction of the token cost.
Keep CLAUDE.md focused, concise, and operational. When it becomes too large, it competes with the task prompt and makes important instructions easier for Claude to overlook.
A common mistake is placing every workflow in CLAUDE.md. Instead, reserve it for project-wide rules and recurring guidance. Move task-specific workflows and specialized instructions into separate SKILL.md files that Claude can load only when they are relevant.
This is what makes agentic development reliable at scale.
Prompts and CLAUDE.md instructions are useful, but they depend on the model remembering and interpreting them correctly. Permissions, hooks, tests, CI, sandboxing, and protected paths make important rules deterministic.
This is especially important as autonomy increases. The more freedom Claude has, the less you should rely on reminders.
Together, these three form a complete operating model:
- Define the outcome and the proof.
- Let the agent work until it reaches a meaningful decision boundary.
- Use guardrails to keep autonomous execution inside safe limits.
If Claude makes the same mistake twice, do not just correct it in the current session. Put the guidance in CLAUDE.md, create a repeatable skill, or add a test that catches the mistake.
Over time, your Claude Code setup should require less supervision because every failure becomes an opportunity to improve its instructions, guardrails, and feedback loops.
Your role in the Claude Code workflow is not to write code. It is to orchestrate work. You are the CPU scheduler — you decide what gets processed, in what order, with what priority. Claude is the execution engine that carries out your decisions.
This means your most valuable skills are: decomposing large tasks into well-scoped units of work, providing clear context and intent for each unit, reviewing output for correctness and alignment with the broader system, and making architectural decisions that Claude cannot make because they require business context or taste.