# Rethinking Claude Code Best Practices — Lydia Hallie, Anthropic

## Executive summary

As large language models (LLMs) like Opus 5.5 and Fable 5.2 improve, the best practices for using Claude Code are shifting away from manual human intervention (being 'in the loop'). The new paradigm involves leveraging model intelligence, automated permission systems (Auto Mode), and robust environment controls (sandboxing, CI/CD) to manage dozens of long-running sessions autonomously. Developers must now focus on configuring the environment and verification points rather than approving every command.

## Key takeaways

- Model and Permission Upgrades: The shift from older models (e.g., Opus 4.5) to modern versions (Opus 5.5, Fable 5.2) means models are better at understanding intent and codebases. Key changes include making 'Auto Mode' the default permission, reducing the need for manual command approval, and eliminating the need for overly restrictive instructions in the `cloudmd` file. (0:45, 1:20)
- Shifting from Manual Control to System Controls: Previously, best practices focused on steering sessions and approving commands. Now, the responsibility shifts to the model, the harness, or the environment. The goal is to run multiple sessions concurrently and ensure safety and quality without constant human supervision. (1:10, 1:25)
- Enhancing Safety with Deny Rules and Sandboxing: While Auto Mode is effective, absolute guarantees require system-level controls. 'Deny rules' are the best way to ensure Claude never performs a specific action. For preventing side effects from compromised scripts (e.g., reading sensitive files), running commands in a 'sandbox' environment is crucial, as it limits the OS-level reach of the process, not just the tool call. (3:15, 4:00)
- Verification and CI/CD Integration: Since sessions run for hours in the background, verification points must be set up along the way (e.g., running tests or builds). The most reliable methods include setting up dedicated 'hooks' (scripts run at specific points) and relying heavily on Continuous Integration (CI) checks, which run the same checks on all resulting Pull Requests (PRs). (5:40, 6:30)
- Orchestration and Context Management: Instead of managing many individual sessions, the recommended approach is to use a single 'orchestrator' session (like in Claude Code Projects). This orchestrator splits the main task into sub-tasks, automatically starting and verifying new threads, allowing developers to manage context without manual intervention. (7:40, 8:20)

## Technical details

- Model Updates: The speaker recommends upgrading from Opus 4.5 to Opus 5.5 and utilizing Fable 5.2. Opus 5.5 is noted for its improved ability to understand developer intent and codebase context. (0:35, 1:20)
- Permission Modes: The default permission mode should be set to 'Auto Mode.' This mode runs a classifier on non-reading/editing commands, automatically allowing safe actions (like running tests) while blocking unknown or potentially unsafe commands. (1:45, 2:10)
- CloudMD Optimization: The `cloudmd` file should be streamlined to only include information that Claude cannot deduce from the code itself (e.g., legacy source references). The `doctor prompt audit` command can help optimize the environment for a specific model. (2:30, 2:50)
- Security Controls: To guarantee safety, 'deny rules' are necessary, as they are checked by Cloud Code before the Auto Mode classifier. For deep security, running processes in a 'sandbox' environment is recommended to limit the OS-level reach of scripts and child processes. (3:30, 4:10)
- Process Control: When implementing custom verification, hooks (scripts run at specific points) are preferred over pure prompting, as they provide guaranteed control. When writing failure scripts, ensure they exit with a '2' exit code, as this signals Cloud Code to attempt a fix. (5:50, 6:10)

## Practical implications

- Upgrade models to Opus 5.5 or Fable 5.2 to leverage improved intent understanding.
- Set Auto Mode as the default permission and use `doctor prompt audit` to clean up the `cloudmd` file.
- Implement 'deny rules' for critical actions (e.g., reading `.env` files) and use sandboxing for running external scripts to limit side effects.
- Establish verification points using 'hooks' and ensure CI/CD pipelines are robust, as these are the primary safety nets when operating without human oversight.
- Transition from managing multiple sessions to using a single 'orchestrator' session to manage context and task flow.

## Topics

LLM Best Practices, Build Automation, CI/CD, Code Security, AI Development Workflow, Claude Code Projects, Anthropic Documentation

Source: https://www.youtube.com/watch?v=vlfCjWuv4es
