Guide
Claude Code best practices, including for several projects at once
Anthropic's own advice comes down to a few habits. Give Claude a check it can run. Plan before it edits. Keep the context clean. Below are those habits, plus what helps when you run more than one project.
Dennis runs several projects at once with Claude Code and Codex. He built Project HQ to see them all on one screen.
The short answer
Anthropic's best practices start from one limit. Claude's context window fills up fast, and Claude does worse as it fills. The context window is everything Claude holds in mind at once: your messages, the files it read, the output of commands. Most good habits follow from that limit:
- Give Claude a way to check its work: tests, a build, a screenshot to compare.
- Explore, then plan, then code. Use plan mode for anything bigger than a one-line fix.
- Keep CLAUDE.md short. Only put in what Claude can't work out itself.
- Clear the context between tasks that don't belong together. Use
/clear. - Run separate sessions side by side for separate work. Where needed, give each its own copy of the code.
Below are the details, plus what helps when you run several projects.
1. Give Claude a check it can run
"Claude stops when the work looks done", Anthropic writes. Without a check, you have to catch every mistake yourself. So give Claude something that says pass or fail: tests, a build that succeeds or fails, a linter (a tool that checks code style), or a script that compares output. Claude can read that result and act on it. That is in the best practices.
Put the check in the prompt: "write the function, then run the tests and fix any failures". Ask for proof, not a claim that it works: the command that ran and what it returned.
2. Explore, plan, then code
Anthropic suggests four steps: explore, plan, build, commit.
Plan mode lets Claude read files, run commands to look around, and write a plan. It does not edit your code. There are three ways to turn it on, from the page on permission modes:
- press
Shift+Tabuntil the status bar shows plan mode - start a single prompt with
/plan - start the session with
claude --permission-mode plan
When the plan is ready, you approve it, with or without checking each edit. Or you say what to change. Press Ctrl+G to edit the plan in your own editor first.
Skip the plan for small, clear changes. Anthropic's rule of thumb: if you can describe the change in one sentence, don't plan.
3. Be specific in prompts
Name the file, the case and what "done" looks like. Point Claude to an example in your code to copy. Point to files with @ instead of saying where they are. For bigger features, Anthropic suggests a two-step approach. First let Claude interview you and write a spec. Then start a fresh session to build it.
4. Keep CLAUDE.md short
Claude reads CLAUDE.md at the start of every session. Anthropic's test for each line: would Claude make mistakes without it? If not, cut it. A bloated file makes Claude ignore the rules that matter, says the best practices page. The CLAUDE.md docs suggest staying under 200 lines per file.
Our CLAUDE.md guide has an example and a free template.
5. Manage context and correct early
Escstops Claude mid-task. The context stays, so you can steer.Esctwice, or/rewind, takes you back to an earlier point: in the chat, in the code, or both. These checkpoints only track edits made through Claude's own file tools. So they don't replace git./clearempties the context between tasks that don't belong together./compactwith instructions sums up a long session the way you want. For example:/compact Focus on the API changes.- Did you correct the same thing twice and it still failed? Anthropic suggests
/clearand a better first prompt that includes what you learned.
6. Use subagents for research
Reading many files fills your main context. So ask Claude to "use subagents to investigate" a question. A subagent is a helper that works in its own, separate context and reports back a summary. A subagent can also review a finished change with a fresh view. Then the agent that did the work isn't the one grading it.
7. Run sessions in parallel
Anthropic's best practices list several ways to run more than one session at a time:
- Git worktrees: separate copies of your project that git keeps track of. Each command-line session works in its own copy, so edits don't clash.
- The desktop app: sessions in a sidebar, two side by side in split view, each in its own worktree if you want. See the desktop app docs.
- Agent view: type
claude agentsto watch your background sessions on one terminal screen. By default it lists them across all your projects. It is still a test version, a "research preview". See agent view. - Non-interactive mode:
claude -p "prompt"for scripts and automatic builds.
Running several projects at once
The docs cover sessions. When you run several projects, a few habits of my own matter just as much.
One coordinating chat, one session per workstream
I keep one main "Hub" chat that coordinates the work. For each workstream I start a separate session. Every session gets a written prompt file. That file has a "Done when" check and a list of things the session must not do. The prompt is the contract. The session works until the check passes. The Hub then only has to verify the result.
Safe git habits
- Commit only the files you changed, by name. Never use
git add ., which sweeps in whatever else is lying around. - If the same check fails three times, stop and report what was tried. Don't try a fourth variation.
- Deploying, publishing and anything else that's hard to undo waits for an explicit OK.
Keep status in the project, not in the chat
Chats end, and context gets cleared. So have each session update a status file in the project: what's done, what's next, what's waiting on you. Then the next session, and you, can pick up from the file instead of from memory. The rule fits in one line of CLAUDE.md or AGENTS.md.
Avoid these patterns
Anthropic names five common mistakes:
- The kitchen-sink session: tasks that don't belong together, in one context. Fix:
/clearbetween tasks. - Correcting over and over. Fix: clear and rewrite the prompt.
- The CLAUDE.md that says too much: important rules get lost. Fix: cut it down.
- Trust, then verify: code that looks right but misses edge cases. Fix: always give a check.
- Endless exploring: an "investigate" with no limits. Fix: narrow it down, or use subagents.
To compare the places you can run Claude Code, see the guide to Claude Code's interfaces. If you also use Codex, the Codex vs Claude Code guide shows how to share instructions between them.
Where Project HQ fits
With several projects and several sessions, the hard part is knowing where each project stands. Project HQ reads the status files your AI keeps in each project folder. It shows progress, next steps and decisions for all of them on one screen. It runs on your own Windows PC and makes no AI calls of its own.
Join the waitlistRelated guides
Sources
We checked these official pages on 26 October 2026.