A Harness for Every Task: Putting a Team of Claudes on One Job

· Source: Towards Data Science · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Robotics & Autonomous Systems, Software Development & Engineering · Depth: Advanced, extended

Summary

Anthropic's Dynamic Workflows in Claude Code address the limitations of single-agent context windows and common AI failure modes like agentic laziness, self-preferential bias, and goal drift on long-horizon tasks. This approach, enabled by Opus 4.8, involves Claude dynamically generating a JavaScript "harness" to orchestrate multiple sub-agents. The harness splits complex jobs into independent pieces, assigns them to fresh-context Claude instances, and then synthesizes the final results. This method supports six composition patterns, including "fan-out-and-synthesize" and "adversarial verification," allowing for robust task completion, such as porting 750,000 lines of Zig to Rust in 11 days with 99.8% test suite passing. While effective, Dynamic Workflows are token-intensive, necessitating strategic model selection, using Opus for orchestration and cheaper models like Sonnet or Haiku for worker agents, to balance cost and performance.

Key takeaway

For AI Engineers tackling complex, long-horizon tasks or encountering single-agent AI limitations like goal drift, Dynamic Workflows provide a robust solution. You should adopt this approach for critical projects requiring high accuracy or extensive context, leveraging Opus 4.8 to orchestrate specialized sub-agents. Be mindful of token consumption; strategically use cheaper models like Sonnet or Haiku for worker agents while reserving Opus for orchestration and final synthesis to optimize cost-efficiency without sacrificing quality.

Key insights

Dynamic Workflows overcome single-agent limitations by orchestrating fresh-context sub-agents via a code-based plan.

Principles

Method

Trigger a workflow via prompt or `ultracode` with Opus 4.8. Claude generates a JavaScript harness to split tasks, assign agents, and synthesize results. Sub-agents execute parts, with outputs stored in variables.

In practice

Topics

Best for: AI Engineer, Machine Learning Engineer, MLOps Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Towards Data Science.