Rethinking Claude Code Best Practices — Lydia Hallie, Anthropic
For long-running Claude Code work, shift oversight from constant approvals to explicit safety boundaries and automated verification.
- Keep CLAUDE.md focused on project facts the model cannot infer; use the prompt audit command to find outdated instructions.
- Use deny rules for actions that must never happen, and run risky shell commands in a sandbox or isolated cloud session.
- Add verification at task boundaries with tests, hooks, and CI; require exit code 2 when a failed check should send Claude back to fix it.
The safety, sandboxing, hooks, and orchestration walkthroughs add practical detail beyond the notes. · Best for: Developers using Claude Code for long-running or parallel coding tasks.
Lydia Hallie argues that as models handle larger tasks, developers should move from approving every step to designing safe environments and reliable checks. The transcript describes Claude Code features and practices for that shift.
From hands-on steering to managing sessions0:00
- Stronger models can work longer, understand codebases better, and verify their outputs.
- Developers increasingly manage multiple sessions rather than supervising every command.
Update instructions and permissions2:45
- Use current defaults such as Opus 5.5 and auto mode to reduce manual steering and approvals.
- Keep CLAUDE.md instructions to information unavailable from the code itself; excessive instructions can worsen results.
- Use the prompt audit command to identify instructions or skills the model no longer needs.
- Configure auto mode in plain English with trusted repositories, buckets, domains, and allowed or blocked actions.
Set safety boundaries beyond approvals5:18
- Use deny rules for actions that must never happen, such as reading a sensitive file or discarding uncommitted changes.
- A tool permission applies to whether a command runs, not what its scripts can access after launch.
- Use a sandbox to restrict command access to files, write locations, and network hosts; restrictions also apply to child processes.
- Cloud sessions use a separate machine and fresh repository copy; configure needed network domains and secrets explicitly.
- Keep auto mode and deny rules because commits and messages leaving the disposable machine can have lasting effects.
Make long-running work verifiable10:47
- Define pass/fail checkpoints such as tests, builds, or screenshots so the model can catch mistakes before finishing.
- Prompt the model to break work into tasks with tests and show actual outputs.
- Use hooks for checks that must run reliably, such as linting after edits and tests before task or session completion.
- The speaker says checks that should trigger a fix must exit with code 2; code 1 may still mark a task complete.
Use CI and review proportionally13:31
- Run consistent CI checks on every PR and enable autofix so Claude can respond to failures.
- Consider merge-when-ready only when appropriate to the change’s risk.
- Use fresh-context review and scale human review to risk; the speaker gives examples ranging from no person for small documentation changes to two reviewers for risky changes.
Delegate orchestration and start small15:20
- Claude Code Projects, described as beta, can use a main session to split work across sessions and track results.
- The main session can use a model suited to planning and judging work, while task sessions use one suited to implementation.
- Start by giving Claude one larger-than-usual task, strengthen CI, configure the environment, and observe where the session still gets stuck.
Step by step
- Trim CLAUDE.md to project-specific facts the model cannot infer; run the prompt audit command.
- Set auto mode trust settings and add deny rules for actions that must never occur.
- Run commands with side effects in a sandbox, or use a cloud session with only required network access and secrets.
- Define task completion checks; use hooks for checks that must always run and return exit code 2 when failures should trigger fixes.
- Run CI on every PR, enable autofix where useful, and set human review requirements according to risk.
- Try a larger task and use observed approval or verification gaps to improve the environment.
Tools & resources mentioned
- Prompt audit command — checks CLAUDE.md and skills for instructions a model may no longer need.
- Auto mode settings — describe trusted repositories, buckets, domains, and command rules for the classifier.
- Deny rules — block specified tool calls before the auto-mode classifier evaluates them.
- Sandbox — restrict shell commands’ file, write, and network access, including child processes.
- Cloud sessions — run work on a separate machine with a fresh repository copy and configurable network access and secrets.
- Hooks — run scripts at specified points, such as after file edits or before task completion.
- CI autofix — lets Claude respond to failed CI checks on a PR.
- Claude Code Projects — beta feature described as an orchestrator for splitting work across sessions and tracking results.
- GitHub merge when ready — merges a PR after its checks pass, when enabled.
Notes are AI-generated from the video's transcript and may miss nuance.