# Rethinking Claude Code Best Practices

Lydia Hallie, Anthropic | AI Engineer | 17:32

Source: https://www.youtube.com/watch?v=vlfCjWuv4es
Channel: AI Engineer (https://www.youtube.com/@aiDotEngineer). Summarised by AIE Talks.
Page: https://aietalks.com/talks/rethinking-claude-code-best-practices
Published: 2026-11-12
Tags: agents, coding-agents, multi-agent, security, testing

## TL;DR
- Claude Code sessions now run longer and handle more of the steering, so developers should remove instructions that newer models can already infer.
- Safety needs several layers: deny rules for actions that must never happen, sandboxes or cloud sessions for limiting side effects, and careful handling of secrets and network access.
- Tests, hooks, and CI let long-running sessions verify their own work, while orchestrator sessions can start and supervise multiple coding sessions.

## Summary
Lydia Hallie explains how Claude Code practices should change as models become better at understanding codebases, following intent, and checking their own work. Older setups often used detailed instructions, frequent approvals, and close human supervision. Hallie argues that much of this can now be removed. Claude Code should receive only information it cannot discover from the code, while auto mode handles routine approvals. Human control still matters for actions that cannot be undone, such as reading secrets or discarding changes. Sandboxes and cloud sessions limit what commands and child processes can access. Verification moves into tests, hooks, and CI, which can send a session back to fix failures. Hallie then describes orchestrator sessions that divide work among separate threads and review their results. The developer's role shifts toward configuring the environment, defining checks, starting larger tasks, and reviewing the output according to its risk.

## Key ideas
### Newer models reduce the need for session steering
[00:00](https://www.youtube.com/watch?v=vlfCjWuv4es&t=0s)
Hallie contrasts older Claude Code sessions with current ones. Earlier sessions stopped sooner, needed repeated corrections, and required people to approve commands manually. Current sessions can run for hours, verify their own results, and orchestrate other sessions. Anthropic went from about 2,500 changes a day in May to more than 30,000 in September, according to the blog post she cites. This changes the developer's job from directing each step to managing many sessions and checking the systems that now handle steering, approvals, and verification.

### Keep only instructions Claude cannot discover from the code
[02:45](https://www.youtube.com/watch?v=vlfCjWuv4es&t=165s)
Hallie says old CloudMD files often contain emphatic rules such as 'important' or 'never do this.' Current models may already understand the stack and where to look, so repeating those details can make them take more tool calls and produce worse results. The file should contain facts hidden from the code, such as a legacy service that is not directly referenced. She recommends the 'doctor prompt audit' command, which checks CloudMD and skills for instructions a specific model no longer needs.

### Auto mode handles routine approvals, but settings define its trust boundary
[04:10](https://www.youtube.com/watch?v=vlfCjWuv4es&t=250s)
Auto mode uses a separate classifier for commands beyond simple file reading and editing. It can allow actions such as running tests or installing dependencies, while blocking commands whose safety is unclear. Its default trust is limited to the current folder and repository, so a staging deployment involving another repository may still require approval. Hallie recommends configuring trusted repositories, buckets, and domains in plain English. Those settings are sent to the classifier and can also specify actions that should always be allowed or never allowed.

### Deny rules are still required for actions that must never happen
[05:38](https://www.youtube.com/watch?v=vlfCjWuv4es&t=338s)
Hallie separates reversible mistakes from irreversible or sensitive actions. Incorrect code can usually be reverted, so the model may handle that decision. Reading an environment file, exposing a secret, or throwing away uncommitted changes needs a deny rule. Claude Code checks deny rules before the auto mode classifier, and a matching tool call never reaches the classifier. She uses a rule blocking reads of an .env file as an example, including indirect commands such as cat.

### A sandbox limits what an approved command and its child processes can reach
[07:05](https://www.youtube.com/watch?v=vlfCjWuv4es&t=425s)
Permissions decide whether a tool call starts, but they cannot control what a running script accesses. An ordinary command such as npm test may run dependencies or a temporary script that reads SSH keys or sends data to an unapproved server. A sandbox moves those limits into the operating system. It can restrict files a command reads, folders it writes, and hosts it reaches, and the restrictions also apply to child processes. Hallie notes that Claude's own files, MCP servers, and hooks remain outside this sandbox.

### Cloud sessions provide disposable machines for long-running work
[09:26](https://www.youtube.com/watch?v=vlfCjWuv4es&t=566s)
A cloud session gives Claude a separate machine with a fresh copy of the repository and continues working after the laptop closes. Secrets such as .env files, SSH keys, and GitHub tokens are absent when they are not in Git. If an API key is needed, it can be added as a network secret without sending it to the model. Network access is limited by default to services such as package registries and GitHub, and other domains must be added explicitly. Hallie still recommends auto mode and deny rules because commits and messages sent outside the machine persist.

### Verification points let sessions prove progress without a full final review
[10:58](https://www.youtube.com/watch?v=vlfCjWuv4es&t=658s)
A broad request can produce several plausible outcomes, such as moving only new logins to a new API or logging everyone out. Hallie recommends defining what done means and adding checks throughout the work. These checks can be tests, builds, or screenshots. Prompts can ask Claude to split the work and show actual output, but hooks provide guarantees because they run at chosen points. A linter can run after every file edit, focused tests can run when a task is marked complete, and the full suite can run before the session ends. Scripts need to exit with code 2 to send Claude back to fix a failure.

### CI and orchestrator sessions reduce the remaining human coordination
[13:39](https://www.youtube.com/watch?v=vlfCjWuv4es&t=819s)
Once each session has its own machine and checks, CI can apply the same validation to every pull request. Autofix can let Claude respond to failed checks, and merge when ready can merge a pull request after all checks pass when the change is low risk. Hallie says Anthropic has Claude review pull requests with fresh context, then adjusts human review to the risk. She also describes Claude Code projects, still in beta, where one main session divides work into threads, starts them, and checks their results. The main session can use a model suited to judging work, while threads use one suited to implementing it.

## Notable quotes
- "So almost everything we used to do ourselves is now either the model, the harness or the environment." (16:38)
- "But if it throws away or uncommitted changes or it reads a key that's now in your transcript and you don't want that, that should still be a rule." (06:40)
- "Permissions only decide if a tool call runs, but they cannot limit what it can reach once it's running." (07:58)
- "Make sure your CI actually catches the things you care about and then spend a bit of time just configuring your environment like its network access, its secret, and its setup scripts." (17:13)

## Tools & references mentioned
- Anthropic
- Claude Code
- Opus 5.5
- Fable 5.2
- auto mode
- CloudMD
- doctor prompt audit
- MCP servers
- GitHub
- CI autofix
- Claude Code projects

## Who should watch
- You have a Claude Code setup filled with old emphatic instructions and want to know which ones still help current models.
- You run long sessions with auto mode and need a practical boundary between classifier settings, deny rules, sandboxes, and cloud environments.
- Your team wants coding agents to work through pull requests with tests, hooks, CI, and risk-based review instead of constant manual supervision.

## Related talks

- [How Claude Code Works](https://aietalks.com/talks/how-claude-code-works) (Jared Zoneraich, PromptLayer, 1:05:43)
- [Claude for Long-Horizon Tasks](https://aietalks.com/talks/claude-for-long-horizon-tasks) (Lance Martin, Anthropic, 25:19)
- [Claude Agent SDK [Full Workshop]](https://aietalks.com/talks/claude-agent-sdk-full-workshop) (Thariq Shihipar, Anthropic, 1:52:25)
- [Decoupling the Brain from the Hands: Claude Managed Agents (Part 1 of 4)](https://aietalks.com/talks/decoupling-the-brain-from-the-hands-claude-managed-agents-part-1-of-4) (Priyanka Phatak & Gabe Cemaj, Anthropic, 17:40)
- [Scheduled Agents, Dreaming and Q&A: Claude Managed Agents (Part 3 of 4)](https://aietalks.com/talks/scheduled-agents-dreaming-and-q-a-claude-managed-agents-part-3-of-4) (Priyanka Phatak & Gabe Cemaj, Anthropic, 26:31)
