Daily Brief AI Agents

Rethinking Claude Code Best Practices: From Steering Sessions to Managing Them

Curated with AI, reviewed by Nazmul

Picked by Nazmul

Lydia, who works on the Claude Code team at Anthropic, argues that the best practices developers adopted for coding agents earlier in the year no longer fit the models they now run. She walks through an old-style session and changes it step by step into the kind of session her team runs today, then asks what has to take over each job a human used to do. Everywhere a developer steps out of the loop, something else must take over: the model, the harness, or the environment the agent runs in.

How sessions have changed

She points to newer models, Opus 55, which she calls her favorite daily driver, and Fable 52, launched the same week, as good at long-running tasks and at understanding a codebase, with Fable also strong at verifying its own output. Earlier in the year, sessions on a model like Opus 45 stopped much earlier, needed constant correction and reminders (including "important!" markers in the CLAUDE.md file), and had no auto mode, so developers either approved every command manually or used the riskier dangerously-skip-permissions option. Humans stayed in the loop for nearly every step.

Now, at Anthropic, sessions run in the dozens at once, for hours, verifying their own results, and some sessions orchestrate other sessions. Developers have become managers of dozens of sessions rather than participants in one or two. She cites Anthropic's October blog post: the company went from about 2,500 changes a day in May to more than 30,000 a day in September. The old best practices, steering sessions, approving commands, restricting what Claude could do, checking output, starting sessions, are still needed, but the model, the harness, or the environment now performs them. That raises two questions: how code quality is kept high without approving every command, and how hours-long unsupervised sessions are kept safe.

Step one: use today's defaults

She starts from the defaults sessions now begin with, which she says developers should not have to think about: move the model from Opus 45 to Opus 55 and switch manual permission to auto mode. Opus 55 understands intent and the codebase well enough that mid-session steering is largely unnecessary, and auto mode has been the default permission mode since August, so approving every command is no longer required.

Step two: rewrite the CLAUDE.md file

Better intent and codebase understanding means the instructions in the repository need rethinking. Markers like "important" or "never do this!" are unnecessary with current models and can push the model off track, producing more tool calls and worse results. The CLAUDE.md file should contain only what Claude cannot see from the code itself, for example a service still using a legacy source that the code does not directly reference. Stack details and where-to-look guidance are no longer needed. Anthropic provides a command, doctor prompt audit, that checks the CLAUDE.md and skills against a specific model and reports what the new model no longer needs.

Step three: auto mode and its limits

Auto mode runs a separate classifier on essentially everything that is not just reading or editing files in the project. It allows commands it knows are safe, such as running tests or installing dependencies, and blocks commands whose safety it is unsure of. The catch: by default it trusts only the current folder and repository, so a request to ship to staging, which would push to a deploy repo, gets blocked and the human is back in the loop. If many commands still need approval in auto mode, the first place to look is settings, where auto mode can be configured in plain English: which repos, buckets and domains are trusted, and what should always be allowed or never done. That text goes to the classifier, which decides whether to allow or reject.

With defaults alone, she says, most in-the-loop work disappears: the model took over steering and auto mode took over approving. The harder question is whether it is acceptable to be absent.

Safety: what auto mode catches and misses

Upgrading the model and using auto mode is still just working with a model, which usually does what it is told but offers no guarantee. In an August study Anthropic tested auto mode against real people in the loop: only about 14% of people caught a clearly dangerous command, while auto mode blocked 89% of them, better than humans, but roughly one in ten still got through. A guarantee can only be enforced in the harness, which is where older best practices still matter, specifically permissions.

A deny rule for a tool call is checked before the auto-mode classifier sees the call; if it matches, the classifier never sees it. Deny rules remain the best way to ensure Claude never does something. Deciding what needs a rule versus what the model can be trusted with comes down to whether a mistake can be taken back: wrong code can be reverted, so it can be left to the model, but discarding uncommitted changes or reading a key that then sits in the transcript should be a rule. Her example: auto mode would happily let Claude read a .env file, so a deny rule is needed, and commands like cat then cannot open it either.

Side effects complicate this. A normal command like npm test runs code the developer did not write, dependencies, or a quick script Claude wrote to check something, and a compromised script could open the .env file or SSH keys and send them to an unknown server. Even a human approving everything would have clicked allow, because there is nothing to say no to. Permissions decide whether a tool call runs but cannot limit what it reaches once running, and blocking tests is not an option because running tests is how Claude checks its own work. The answer is limiting the environment: locally, run such commands in a sandbox that controls which files a command can read, which folders it can write to, and which hosts it can reach, enforced by the operating system and applying to child processes too. The deny rule Claude checked only saw npm test, not the files the script opens; in the sandbox the same rule passes to the operating system, which refuses when a dependency tries to open the .env file. By default the sandbox can still read most of the machine, so SSH keys need another rule, and it cannot reach unapproved hosts.

The sandbox covers only shell commands and what they start; Claude's own files, MCP servers and hooks still run outside it, on the developer's machine. Ideally the whole session runs where none of that exists, a cloud session, which gets its own machine with a fresh copy of the repo and keeps running with the laptop closed, which she says is what long sessions need. The .env file, SSH keys and GitHub token are not in git, so they are absent. If an API key is needed, it can be added as a network secret; Claude reports mid-session that it is missing a key and can use it without the key ever being sent to the model. Network access in a cloud session is limited by default to things like package registries and GitHub, and other domains must be explicitly added.

She notes the machine is disposable but what leaves it is not, a pushed commit or a message sent through a connector. So the cloud session still runs in auto mode with deny rules committed into the repo, which can still catch a force push or a secret in a commit.

Verification: checking work nobody watched

In the loop, developers knew work was good because they saw every change. Now Claude works for hours in the background and nobody will read every file at the end. Her example: asking Claude to move an OAuth flow to a new API. Claude understands the goal, but many small decisions arise, and the same prompt might leave the old API in place, migrate only new logins, or log everyone out, all of which look reasonable. Verification points along the way, anything that returns pass or fail (tests, a build, a screenshot), let Claude keep checking itself, and reviewing those points is much shorter than reviewing the whole change at the end. A run that would log everyone out fails the first check and must find another way.

There are several ways to set this up:

  • In the prompt: state what done looks like and ask Claude to split it into tasks with their own tests, and ask it to show the actual output since nobody was there to see it. Prompting is not a guarantee the model will comply.
  • Hooks: scripts Claude Code runs at specific points, where the developer decides when they run, what they run and what they check. For example, run the linter every time a file is edited, run the tests for changed code whenever Claude wants to mark a task complete (touching auth code means passing the auth tests), and run the full test suite when it wants to finish the session; a failure sends Claude back to fix it until it passes.
  • Exit codes: most tools exit with code 1 on failure, but Claude Code marks the task completed anyway. Scripts should exit with code 2, which is what sends Claude back to fix the problem.

Scaling to many sessions, and CI

With one session she is comfortable leaving alone, she adds more: each has its own machine, so they are not in the same folder and worktrees need less thought. Starting every session and reviewing every one is already a good place to be, full control over what starts and when a task is done, but the developer is still in the loop for all of them. The most important thing to have in place is CI, because every session eventually opens a PR and CI runs the same checks regardless of how the session was set up or what Claude decided. With CI autofix on, Claude sees a failing check and goes back to fix it, so review time is not spent on what a check could have caught. Merge-when-ready lets GitHub merge a PR once all checks pass; that is not the default and depends on how risky the change is.

On her team, every PR is reviewed by Claude first, not by the session that wrote it, so it comes with fresh context, plus a separate group of agents to double-check every bug it finds. How much humans review depends on risk: small changes like docs copy need no person once automated checks are green, ordinary product changes need one reviewer, and risky changes may need two.

Orchestrator sessions

Where she sees things heading, and what Anthropic already does more of, is not starting sessions yourself at all. She admits she is bad at context switching, so managing many sessions at once does not always go well. Instead, one main session acts as orchestrator: Claude Code projects, still in beta, takes a description of what is needed, splits it up, starts a session for each task, tracks what comes back, and starts and verifies these threads automatically, one conversation instead of eight. The main session does not write code, so it wants a model good at deciding what to do and judging results, like Fable, sending back anything not actually done until it passes everything; the threads want a model good at doing the work, like Opus 55. The two can be set separately. With projects, context is managed automatically, so there is no need to think about when to compact or clear.

Where the old best practices went

She closes by mapping each old practice to its new owner: the model steers, auto mode approves, deny rules and the environment restrict what is possible, tests, hooks and CI check the work, and Claude can start the sessions. Developers start the first session and review what comes out.

Her advice for trying it: take one task much bigger than what you would normally give Claude, make sure CI catches what you care about, spend time configuring the environment (network access, secrets, setup scripts), then start in the cloud and watch where sessions get stuck and where you are still in the loop, that is the next thing to hand over to Claude. She also recommends Anthropic's best-practices documentation.

Source: AI Engineer on YouTube

Thoughts? Reply to the email or join the Lab →

Get it by email.

Choose the Daily Brief, Articles, or both. Free.