Anthropic Engineer Shares Advanced Claude Code Workflow: Moving Beyond “Question-Answer” Programming
Recently, Anthropic engineer Boris Cherny shared an advanced workflow designed to enhance the efficiency of AI-assisted programming. The core of this methodology is to move away from the traditional, single-threaded “one human, one AI” question-and-answer model. Instead, it positions the developer as an “architect” and “coordinator” for multiple AI assistants, tackling complex software engineering tasks through a structured process.
Parallel Task Processing: A Multi-Session Strategy Based on Git Worktree
In the traditional AI programming model, developers often get stuck in single-threaded bottlenecks while waiting for code to be tested or for the AI to respond. To solve this, Cherny’s team adopted the git worktree technique. Git Worktree allows checking out multiple working directories from a single repository, with each directory corresponding to an independent branch and working area. Based on this, a developer can open 3 to 5 independent Claude Code sessions simultaneously, each linked to a different worktree. This parallel strategy allows time-consuming tasks like testing, bug fixing, new feature development, and code refactoring to proceed concurrently, significantly reducing wait times and thus greatly increasing development throughput.
Implementing a “Plan-Execute-Review” Cycle: Introducing the AI Reviewer Role
For tasks with complex requirements and ambiguous boundaries, directly instructing an AI to generate code can easily lead to deviations from the goal. To address this, the workflow introduces a “Plan Mode” and an “AI Reviewer” mechanism. First, the developer collaborates with the AI in Plan Mode to create a detailed implementation plan. Then, one Claude instance generates code based on this plan, while another Claude instance with a clean context acts as a “code reviewer.” This reviewer focuses on checking edge cases, error handling, code style, and long-term maintainability. The review feedback is then sent back to the first instance for revisions. This adversarial model, through internal checks and balances, ensures the quality and robustness of the final code output, allowing developers to achieve near-expert-level architectural design.
Building Project-Level Memory: Persisting Context with a CLAUDE.md File
To solve the problem of large language models lacking memory across different sessions, this workflow emphasizes using a CLAUDE.md file to build persistent project context. This file is treated as the project’s “AI instruction manual,” recording coding conventions, directory structure agreements, key commands, known technical debt, and previously corrected errors. When starting a new session, the AI first reads this file, thereby avoiding repetitive background introductions and instructions and ensuring consistency in the development process. This approach productizes development experience, allowing the AI assistant’s performance to continuously improve as the project progresses.
Integrating the Development Toolchain: Enabling Seamless Context Flow
To end the inefficient practice of manually transferring information between different development tools (like Slack, CI systems, and IDEs), this workflow advocates for establishing an automated context flow mechanism between tools. Through API or protocol integration, the AI can directly access and understand context from Slack discussions or CI system logs. This means the AI can independently analyze the root cause of a problem and propose solutions after fully understanding the background. Developers no longer need to act as information relays and can focus their attention on higher-level decision-making and creative work.