Claude Code Best Practices in 2026: Where They Moved

The Claude Code best practices you learned earlier this year are mostly still correct. They are just no longer your job. That is the uncomfortable shape of the advice coming out of Anthropic now, and it is worth sitting with before you go and reread your instruction files.
The clearest statement of it came from Lydia Hallie of the Claude Code team at Anthropic, in an AI Engineer talk published on 12 November 2026. The framing is a single session, tracked forward in time: take a typical session from early 2026, change one thing at a time, and watch each piece of human work get handed to something else. Almost none of it disappears. All of it moves.
TL;DR — Claude Code best practices in 2026 did not vanish, they changed owner. Steering moved to the model, which is why emphasis markers in your CLAUDE.md now hurt more than they help; approving moved to the harness, to auto mode and the deny rules it cannot override; containment moved to the environment, to a sandbox or a cloud session with its own disposable machine; and verifying moved to tests, hooks and CI. What is left for you is starting the work and reviewing what comes out. The knowledge you prune from an instruction file does not stop being true, so it needs somewhere durable and agent-readable to live — which is what a markdown workspace like MDflow is for. Start free.
What "Claude Code best practices" means in 2026
Claude Code best practices in 2026 are a question of ownership, not technique: for each job you used to do inside the loop, which of the model, the harness, or the environment now does it? The techniques themselves — write down what the model cannot infer, restrict what it can reach, check its work — are unchanged. What changed is that a human doing them by hand is now the bottleneck rather than the safeguard.
The scale that forced this is public. Anthropic merged around 2,500 code changes a day in May 2026 and more than 30,000 a day in September, and said so while explaining why it had to redesign its own source control: developer infrastructure built for human scale became the constraint. You cannot personally approve commands across dozens of concurrent sessions. The practice has to live somewhere that scales, which means somewhere that is not you.
Hallie's own description of the destination is blunt: sessions now run for hours, verify themselves along the way, and increasingly get started by other sessions, with the developer acting as a manager rather than a pair programmer.
Why your old instructions now cost you
Start with the instruction files, because this is the one piece of old advice that has inverted rather than moved. Earlier in 2026 the standard guidance was to be emphatic: IMPORTANT, NEVER DO THIS, capitals and exclamation marks, repeated across a CLAUDE.md file because the model kept drifting. Those markers were a workaround for a model that stopped early and needed reminding.
With a current model, Hallie's position is that the same markers can push it off track, producing more tool calls and a worse result overall. The rule they give is a clean one:
Your CLAUDE.md file should only include the things that Claude cannot see from your code.
Apply that honestly and most instruction files shrink hard. Your stack is visible. Your directory layout is visible. Your test command is in package.json. What is not visible is the part that lives in nobody's file: the service still reading from a legacy source that nothing in the repository references, the reason a module nobody likes has not been deleted, the limit a regulator imposed that the code enforces without saying why. Hallie points at a prompt audit under Claude Code's /doctor command that checks instruction files and skills against the model you are currently running, which makes the pruning pass mechanical rather than a judgment call.
This is the same force we wrote about in Skill Novelty: Stop Writing What the Model Already Knows — concepts are in the weights, specifics are not — and the same pruning discipline as Context Engineering for AI Agents. The new part is the cost direction. Redundant instructions used to be merely wasteful. Now they are actively negative.
For developers, the consequence is that instruction files need a maintenance habit, not a one-time write. For agents, the consequence is subtler: a pruned CLAUDE.md is a smaller, sharper context, but the pruned material is still true. It has to go somewhere an agent can reach deliberately rather than somewhere it loads by default. That distinction is the whole design problem, and we come back to it below.
Where each job went
Steering went to the model
The first thing to stop doing is mid-session correction. A model that understands your intent and your codebase does not need the running commentary, and the commentary itself is now a cost. This is the least interesting change and the easiest one to make: update the model, stop interrupting.
Approving went to the harness
Auto mode is now the default permission mode in Claude Code on the Pro, Max, Ultra and Team plans, and it is a classifier, not a rule engine. Anthropic's engineering write-up on how it was built, published in March 2026, lays out the pipeline: a fixed allowlist of state-free tools, then in-project file edits allowed without a classifier call, then everything else — shell commands, web fetches, external integrations, filesystem operations outside the project — through a two-stage transcript classifier. Stage one is a fast single-token filter tuned to over-block; stage two re-reads the same input with reasoning only when stage one flags it.
Two details are worth knowing before you trust it.
First, the measured numbers. On the evaluation in that March write-up, the deployed pipeline scores a 0.4% false positive rate on 10,000 real internal tool calls and a 17% false negative rate on 52 curated real overeager actions. Anthropic calls 17% "the honest number" and explains the failure mode precisely: the classifier usually does see the danger, and gets the consent question wrong. "Clean up the PR" is approval-shaped evidence that does not actually authorize a force push. Hallie cited a later comparison study in the same vein — around 14% of people in the loop caught a clearly dangerous command against auto mode's 89% — and the March write-up notes that users accept 93% of permission prompts anyway. Auto mode is a large improvement on bypassing permissions and a regression on genuinely careful human review. It is aimed at the first group.
Those figures are a snapshot of one evaluation on one pipeline, not a standing property. Treat them as the order of magnitude to plan against, and check the current write-up before quoting them.
Second, deny rules sit above it. Claude Code evaluates permission rules in the order deny, then ask, then allow, first match wins, and an allow rule cannot carve an exception out of a deny rule. So a deny rule is the only thing in this stack that is a guarantee rather than a judgment.
Which raises the question of what deserves one. Hallie's test is the best heuristic I have seen for it: if the agent gets this wrong once, can you take it back? Wrong code is revertible, so leave it to the model. Uncommitted work thrown away, or an API key read into a transcript, is not. Those are rules.
Containment went to the environment
Here is the gap that neither the classifier nor the deny rules close. npm test is an ordinary command and auto mode will run it. While it runs, it executes code you did not write — your dependencies, or a throwaway script the agent wrote to check something. If any of that is compromised, it can open the .env file your deny rule protects and ship it somewhere, and no permission check fires, because permissions decide whether a tool call runs and cannot limit what it reaches once it is running. A human in the loop would have clicked allow too. There was nothing to say no to.
The answer is to shrink the environment rather than the command. Claude Code's Bash sandbox is an OS-enforced boundary: you declare which paths and hosts shell commands can reach, and those limits apply to Bash, PowerShell and Monitor commands and the processes they start. The same deny rule that Claude Code was checking by itself now gets handed to the operating system, where a dependency opening a protected file is refused by the kernel rather than by a model's reading of a command string.
Note the stated limit, because it is easy to misread the protection as total: the sandbox covers shell commands only. Claude's own file tools, your MCP servers and your hooks run outside it.
Which is the argument for moving the whole session off your machine. A cloud session gets its own disposable machine with a fresh copy of the repository, and it keeps running with your laptop closed — which matters more than it sounds for sessions measured in hours. Your .env file is not in Git, so it is simply not there; neither are your SSH keys. One detail worth internalising: cloud sessions do not read your local ~/.claude/settings.json. Settings committed to the repository travel with it; settings on your laptop do not. If your deny rules live in your personal settings file, they are not protecting your cloud sessions.
And the machine is disposable, but the things that leave it are not. A pushed commit and a sent message both outlive the sandbox, which is why the rules still matter inside it. We went further into this architecture in AI Agent Sandboxing: Blast Radius Is an Architecture Choice.
Verifying went to tests, hooks and CI
The quiet loss in going unsupervised is not safety, it is knowledge. When you approved each step you knew the work was good because you had seen it. Now you will not read every file at the end.
The fix is verification points inside the run rather than a review at the end — anything that returns pass or fail: a test, a build, a screenshot. Ask for the same change twice and you can get three defensible answers — migrated with the old path left in, migrated for new logins only, migrated and everyone logged out — and the point of a checkpoint is that the unacceptable one dies at the first gate instead of surviving to your review.
Prompting for this works often and guarantees nothing. For the checks that must run, use hooks, and get the exit code right, because this is a real trap: in Claude Code, exit code 0 is success, exit code 2 is a blocking error, and any other exit code is a non-blocking error — the action goes ahead. Most test runners and linters exit 1 when they fail. Wire one straight into a TaskCompleted hook and the failure is noted and the task completes anyway. Wrap it so a real failure exits 2.
Past the session boundary, CI is the layer that does not care how any individual session was configured, and it is where review tiering belongs: on Hallie's team every pull request is reviewed by Claude first — with fresh context, not the session that wrote it — and human review scales with risk, from none for docs and copy, through one reviewer for ordinary changes, to two for risky ones. AI Pull Request Review: Prove, Judge, Escalate and Quality Gates for AI Agents cover the shape of that last layer in more detail.
Which teams benefit most
- Teams running more than a couple of sessions at once. The ownership question only bites when you are the bottleneck. One session at a time, you can afford to stay in the loop.
- Anyone whose instruction files predate mid-2026. The emphasis-marker inversion is a pure regression you are still paying for, and the audit is cheap.
- Repositories with secrets or infrastructure access on the same machine. The
npm testgap is not theoretical, and it is exactly the case where the environment layer, not the permission layer, is the fix. - Teams whose CI does not actually check what they care about. Every layer above eventually funnels into CI. A green pipeline that proves nothing is worse now than it was, because more is riding on it.
- Anyone considering orchestrator setups. One session planning and judging, others doing the work, is a real pattern now — and it only holds if the layers underneath it are solid.
How MDflow fits
There is a loose thread in all of this, and it is the instruction-file advice. "Only what the model cannot see from your code" is correct, and following it deletes material that is still true. The legacy data source, the regulatory limit, the architectural decision nobody wants to relitigate — pruning them from a CLAUDE.md does not make them less load-bearing. It just means they now need somewhere else to live, somewhere an agent reaches deliberately rather than loads by default.
That is the layer MDflow occupies. It is not a harness, and it does not compete with one.
What lines up today
Plain markdown, read by agents over open interfaces. MDflow stores documents as markdown with no export step. Agents read them through a remote MCP server or the HTTP API, so the same workspace is reachable from Claude Code, Cursor, Codex, the ChatGPT app and anything else that speaks either protocol. The point of a store that is not the repository is that it survives a fresh checkout on a disposable machine.
Connect Claude to MDflow: open the MDflow connector in Claude's Connectors Directory, click Connect to Claude, and sign in — no URL or token to paste. One connection covers claude.ai, the Claude desktop and mobile apps, and Claude Code when it is signed in with a Claude subscription. The ChatGPT app signs in the same way. A Personal Access Token is the legacy route for Claude, and the route for clients that send their own auth header — Cursor, Codex and the HTTP API.
Folder descriptions as the retrieval signal. A folder's description states what belongs inside it, and MDflow's retrieval ranks those descriptions above folder names and document titles — the mdflow_get_context tool is the topic-first route, the API the explicit one with a Personal Access Token. This is the mechanism that makes pulled-on-demand context work: this folder holds the constraints on the billing service that are not visible in its code is a scope an agent can retrieve against when the task touches billing, and ignore when it does not.
Version history (Pro) covers the pruning risk directly. Delete a clause during an audit, find three weeks later that a real task needed it, and the line-by-line diff and restore beat an archaeology session. It is private to the document owner and deliberately not exposed through the API or MCP server, so an agent cannot read or rewrite a document's past.
The Document Log records every create, edit, share and delete with its actor, and marks anything arriving through the API or MCP server as automated, with the token name. When several agents are writing to shared project knowledge, that is the feed that answers which one changed a procedure.
What MDflow is not, and we will not imply otherwise. It is not an enforcement layer. It does not sandbox anything, does not evaluate permission rules and does not gate commands. Worth stating plainly for a post about permissions: a Personal Access Token (mdf_) is account-wide and grants both read and write, with no read-only option and no workspace scoping — only Team access tokens (mdt_) are scoped. If you need least privilege for an agent touching MDflow, that constraint is real and belongs in your planning. Containment belongs in the harness and the environment, exactly where this post puts it.
Where we are headed
Direction, not a dated commitment. The folder description is the primitive we keep returning to, and the distance between what a folder is for and what an agent retrieves from it is where the useful work sits. The other thread is the round trip: MDflow already edits markdown in place in GitHub, Google Drive and OneDrive, and agent instructions increasingly live in repositories, so narrowing the gap between where that prose is version-controlled and where it is edited is worth closing. Treat both as interests.
The bottom line
Claude Code best practices did not get simpler, they got redistributed. Steering is the model's. Approving is auto mode's, with deny rules above it for anything you could not take back. Containment is the sandbox's, or a cloud session's, because permissions cannot follow a command into the code it runs. Verification is your tests, your hooks — exiting 2, not 1 — and your CI. What is left for you is starting the work and reviewing what comes out, and the honest way to find the next thing to hand over is to watch where your sessions keep pulling you back in.
The knowledge you prune out of an instruction file in the process has to land somewhere. Put it where an agent can fetch it on purpose. Start free, connect an AI agent, or read the API docs.
Frequently asked questions
What changed about Claude Code best practices in 2026?
The practices did not disappear, they changed owner. Six months ago a developer steered the session, approved every command, and reviewed the diff at the end. Today the model does the steering, the harness does the approving through auto mode and deny rules, and the environment does the containment through a sandbox or a cloud session. What is left for the human is starting the work and reviewing what comes out. Anything you are still doing by hand is the next thing to hand over.
What should go in a CLAUDE.md file now?
Only what the model cannot see from the code itself. A service that is still using a legacy data source nothing references is worth writing down. Your stack, your directory layout and where to look for things are not, because a current model reads those straight from the repository. Emphasis markers like IMPORTANT or NEVER DO THIS, which were common advice earlier in 2026, can now push a model off track and produce more tool calls and a worse result.
Is Claude Code auto mode safe enough to leave running?
Safer than a human clicking approve, and not a guarantee. Anthropic's March 2026 engineering write-up evaluated the deployed two-stage pipeline at a 0.4% false positive rate on real internal traffic and a 17% false negative rate on a curated set of 52 genuinely overeager actions, and calls 17% the honest number. Those are one evaluation's figures, not a standing property, so check the current write-up before quoting them. Auto mode is aimed at people who would otherwise bypass permissions entirely. It is explicitly not a drop-in replacement for careful human review on high-stakes infrastructure.
What is the difference between a deny rule and the auto mode classifier?
A deny rule is a deterministic rule in your settings; the classifier is a model making a judgment call. Claude Code evaluates permission rules in the order deny, then ask, then allow, and the first match decides, so a deny rule settles the question before anything else looks at the call. An allow rule cannot carve an exception out of a deny rule. The useful test for which to use is whether you could take the mistake back: wrong code can be reverted, so leave it to the model, but a secret read into a transcript cannot be, so make it a rule.
Why should a hook exit with code 2 rather than 1?
Because only exit code 2 blocks. In Claude Code hooks, exit 0 is success, exit 2 is a blocking error that stops the action on events that can block, and any other exit code is a non-blocking error — the action goes ahead and you see a hook error notice. Most test runners and linters exit 1 on failure, so a verification hook wired up naively reports a failure that Claude Code lets through. Wrap the command so a real failure exits 2.
Where should project knowledge live if it should not live in CLAUDE.md?
Somewhere durable that is not the repository checkout, because the pruning advice removes material from the instruction file without making it less true. A markdown workspace like MDflow is one answer: plain markdown an agent reads over MCP or the HTTP API, folder descriptions that scope what a set of documents is for, and version history on Pro so you can see what a decision said before someone edited it. MDflow is a store, not an enforcement layer — permissions, sandboxing and CI belong in the harness.
Further reading
- Rethinking Claude Code Best Practices — Lydia Hallie, Anthropic, at AI Engineer (12 November 2026). The talk this post is built on.
- How we built Claude Code auto mode — Anthropic Engineering, March 2026. The threat model, the three permission tiers, the classifier decision criteria, and the measured false positive and false negative rates.
- Auto mode is now the default in Claude Code — which plans it is the default on.
- Configure permissions — rule syntax and the deny / ask / allow precedence.
- Configure the sandboxed Bash tool — what the OS-enforced boundary covers, and what runs outside it.
- Hooks reference — hook events, and the exit code table.
- Redesigning source control at Anthropic — Anthropic Engineering, on the merge volume that forced the change.
- AGENTS.md, CLAUDE.md, SKILL.md, llms.txt Explained — what each instruction file is and who reads it.
- AI Agent Sandboxing: Blast Radius Is an Architecture Choice — the containment layer in more depth.
- AI Agent Approvals: Approve the Job, Not the Step — changing the unit of approval rather than the approval rate.
- Connect an AI agent to MDflow — the MCP server, and the Personal Access Token that authenticates it.