Claude Code Introduces Dynamic Workflows: Enabling AI to Form Teams and Collaborate

marsbitОпубликовано 2026-06-04Обновлено 2026-06-04

Введение

Claude Code introduces dynamic workflows, enabling AI to coordinate teams of specialized agents for complex tasks. This transforms Claude from a code assistant into a programmable workbench. Workflows address key limitations of single-agent systems: agentic laziness (premature task completion), self-preferential bias (favoring own outputs), and goal drift (losing sight of original objectives). The system allows Claude to dynamically create execution frameworks using JavaScript. It can split tasks, dispatch parallel agents for isolated work (e.g., in separate worktrees), implement adversarial validation, run tournaments, and synthesize results. This multi-agent approach is valuable for tasks requiring deep research, factual verification, code migration, root cause analysis, large-scale triage, and qualitative sorting. Key patterns include: classify-and-route, fan-out-and-synthesize, adversarial verification, generate-and-filter, tournaments, and loop-until-done. While token usage is higher, workflows excel where tasks resemble programming—needing problem decomposition, isolated context, hypothesis testing, and handling many details. They extend Claude Code's utility beyond technical work to areas like business plan review, resume screening, and naming brainstorm. The feature is not a universal solution but points to a future where AI tool competitiveness depends on organizing reliable, reusable, and auditable execution flows for complex goals.

Editor's Note: Claude Code is evolving from a coding assistant into a composable Agent workbench.

The workflows introduced in this article are designed to enable Claude to move beyond "thinking and then doing" within the same context window. Instead, it can dynamically generate an execution framework for tasks: decomposing tasks, dispatching sub-agents, parallel processing, cross-validation, iterative cycles, and even allowing different agents to compete with each other before synthesizing the final results.

This signifies a clear expansion of Claude Code's applicable scenarios. It's not just suitable for code migration, refactoring, test reproduction, and code review, but also for non-technical tasks such as deep research, fact-checking, resume screening, incident post-mortems, rule distillation, business plan reviews, and naming brainstorms. Many complex tasks are inherently similar to programming: they require problem decomposition, context isolation, hypothesis validation, handling of extensive details, and making choices among multiple candidate paths.

Dynamic workflows aim to address several common issues with large language models on long tasks: "Agentic laziness," where the agent declares completion prematurely; "Self-preferential bias," where the agent tends to favor its own conclusions; and "Goal drift," where the agent gradually deviates from the original objective over multiple execution rounds. By assigning tasks to multiple Claude instances with independent contexts, it transforms complex tasks from a "single-agent marathon" into "multi-agent collaboration."

Of course, workflows are not a universal solution. They typically consume more tokens and may not be necessary for every routine coding task. However, they point to an important direction: future competition among AI tools may depend not only on the intelligence of a single model but also on its ability to organize reliable, reusable, and reviewable execution processes around complex objectives.

Below is the original article:

Although Claude Code's default execution framework is built for programming, it is also applicable to many other types of tasks. It turns out that many tasks are structurally similar to programming tasks. However, for certain specific task types to perform optimally, we still need to build customized execution frameworks on top of Claude Code, such as for research, security analysis, agent team collaboration, or code review.

Workflows allow you to dynamically create execution frameworks, enabling Claude to solve the aforementioned problems, and more, more natively within Claude Code itself. You can also share and reuse these workflows with others.

In this article, I'll share my initial experiences and insights using workflows to help you leverage their capabilities more fully.

It should be noted, however, that best practices are still emerging. Dynamic workflows typically consume more tokens, so you need to carefully consider when and how to use them.

Note: This article is also published on the Claude Blog.

Example Prompts

Before diving into technical details, I'd like to provide some example prompts to help you understand the possibilities with workflows:

"This test fails approximately once every 50 runs. Set up a workflow to reproduce it, formulate hypotheses, and conduct adversarial testing across different worktrees. /goal Do not stop until one hypothesis is validated."

"Use a workflow to review my last 50 sessions, extract recurring corrections I've made, and convert these persistent issues into CLAUDE.md rules."

"Use a workflow to examine the past six months of the #incidents channel in Slack and identify recurring root causes that no one filed tickets for."

"Run my business plan through a workflow, having different agents critique it from the perspectives of an investor, a customer, and a competitor."

"Here is a folder with 80 resumes. Use a workflow to rank them according to backend role requirements and double-check the top ten. Use the AskUserQuestion tool to query me to help you establish evaluation criteria."

"I need to name this CLI tool. Use a workflow to brainstorm a batch of options, then select the top three through a tournament mechanism."

"Use a workflow to rename our User model to Account everywhere."

"Read my blog draft and use a workflow to verify every technical claim against the codebase. I don't want to publish anything incorrect."

How Dynamic Workflows Work

A dynamic workflow executes a JavaScript file containing special functions for generating and coordinating sub-agents.

Dynamic workflows also include standard JavaScript functions like JSON, Math, and Array for data manipulation.

Notably, dynamic workflows can decide which model a particular agent uses and whether a sub-agent runs in its own worktree. This allows Claude to autonomously select the required level of intelligence and isolation based on task needs.

If a workflow is interrupted—for example, by a manual user action or terminal exit—it can resume execution from the point of interruption when the session is restored.

Why Dynamic Workflows are Needed

When you have Claude Code's default execution framework handle a task, it needs to perform both planning and execution within the same context window. While this is very effective for many programming tasks, it can sometimes fail on long-running, massively parallel, or highly structured adversarial tasks.

The reason is that the longer Claude works on a complex task within a single context window, the more prone it becomes to several specific failure modes:

Agentic laziness: This occurs when Claude stops prematurely on particularly complex, multi-part tasks, declaring the task complete after only partial progress. For example, processing only 20 out of 50 items in a security audit and announcing completion.

Self-preferential bias: Claude tends to prefer its own results or findings, especially when asked to verify or judge its own output against some evaluation criteria.

Goal drift: Over multiple rounds of execution, Claude's fidelity to the original goal gradually declines, particularly after context compression. Each summarization incurs information loss, and specific details like edge cases or "don't do X" constraints can be lost.

Creating a workflow helps mitigate these issues by orchestrating multiple independent Claude instances, each with its own context window, focused on isolated, well-defined tasks.

Dynamic Workflows vs. Static Workflows

You may have previously created static workflows using the Claude Agent SDK or claude -p to coordinate multiple Claude Code instances.

However, because static workflows need to cover various edge cases, they tend to be more generic. With the advent of Claude Opus 4.8 and dynamic workflows, Claude is now intelligent enough to write a tailored execution framework for your specific use case.

Practical Patterns When Using Dynamic Workflows

You can directly ask Claude to create a dynamic workflow, or use the trigger word "ultracode" to ensure Claude Code creates a workflow.

However, if you build a mental model of how dynamic workflows operate, it's easier to judge when to use them and to guide Claude via prompts.

When constructing workflows, Claude commonly uses and combines the following patterns:

Classify & Execute: Use a classification agent to determine the task type, then route to different agents or behaviors based on that type. A classifier can also be used at the end of the process to judge the output.

Fan-out & Synthesize: Split a task into multiple smaller steps, have each step handled by an agent, and finally synthesize the results. This is particularly suitable for tasks with numerous small steps or where each step needs a clean context window to avoid interference or cross-contamination. The synthesis step acts as a "barrier": it waits for all fanned-out agents to finish, then merges their structured outputs into a single result.

Adversarial Verification: For each generated output, run an independent agent to adversarially verify it against a set of evaluation criteria or guidelines.

Generate & Filter: Generate a large number of ideas around a theme, then filter them based on evaluation criteria or a verification process, removing duplicates and returning only the highest-quality, tested ideas.

Tournament: Instead of splitting the work, have agents compete. Generate N agents, each attempting to complete the same task using different methods. Then, a prompt or model-driven reviewing agent compares the results pairwise until a winner emerges.

Loop Until Done: For tasks with unknown workload, instead of a fixed number of rounds, cycle through generating agents until a stop condition is met, such as no new discoveries or errors in the logs.

Use Cases

You can think more creatively about when and how to have Claude Code create dynamic workflows. I've found workflows can sometimes be even more useful for non-technical work.

Migration & Refactoring

Bun used workflows for its rewrite from Zig to Rust. You can read Jarred's post on X for details.

The key is to split the task into a series of steps to process, like call sites, failing tests, modules, etc. Launch a sub-agent for each fix in a worktree to complete the repair; then have another agent perform an adversarial review before merging results. You might consider explicitly telling agents not to use overly resource-intensive commands, maximizing parallelism without exhausting local machine resources.

Deep Research

We released a deep research skill (/deep-research) in Claude Code, which uses dynamic workflows. Specifically, it fans out to perform web searches, scrape sources, adversarially verify relevant claims, and synthesize a referenced report.

But this kind of research isn't limited to web searches. For example, you could have Claude compile a status report from Slack context or explore the codebase deeply to study how a feature works.

Deep Verification

Conversely, if you have a report and want to fact-check every factual claim and source cited, generate a workflow: first, an agent identifies all factual claims; then, launch a sub-agent for each claim to meticulously verify it. You can also have a verification agent check the sourcing sub-agents to ensure their source quality is high enough.

Ranking

You might have a set of items you want to rank by some qualitative metric, and you believe Claude Code is good at evaluating that metric. For example, ranking support tickets by bug severity.

But if you try to rank 1000+ lines in a single prompt, quality degrades, and it might not fit the context window. It's better to run a tournament, building a pipeline of pairwise comparison agents because comparative judgments are often more reliable than absolute scoring; or perform parallel bucket sorting first, then merge results. Each comparison is done by an independent agent, so a deterministic loop can maintain the tournament structure, with only the current running order needing to stay in context.

Memory & Rule Adherence

If you have a set of specific rules that Claude often misses or fails to execute well, even when seeing them in CLAUDE.md, create a workflow listing these rules and have verification agents check them one by one—one verifier per rule. Creating a sub-agent with a "skeptic" persona to review whether these rules are sensible can also help avoid excessive false positives.

Conversely: mine your recent sessions and code review comments to find corrections you repeatedly make; have parallel agents cluster these issues; then adversarially validate each candidate rule to judge if it genuinely would have prevented a real mistake; finally, distill the surviving rules back into CLAUDE.md.

Root Cause Investigation

The most effective debugging involves generating several independent hypotheses and testing each. But if you use only one context window, Claude may fall prey to self-preferential bias.

Workflows can structurally prevent this: they can launch multiple agents to generate hypotheses based on non-overlapping evidence. For example, have different agents look at logs, files, and data separately. Then, each hypothesis can be scrutinized by a set of verifiers and refuters.

This isn't just for code. Workflows can also be used for sales analysis, e.g., "Why did March sales drop?"; for data engineering, e.g., "Why did this pipeline fail?"; or for any post-mortem.

Large-Scale Triage

Every team has support queues, bug reports, or other backlogs that can't be fully handled by humans. A triage workflow can classify each item, deduplicate against tracked issues, and take action. This could mean attempting a fix or escalating to a human user.

For triage workflows, a useful pattern is quarantine. That is, forbid agents reading untrusted public content from performing high-privilege actions; high-privilege actions should be done by dedicated action-taking agents.

You can pair triage workflows with /loop for continuous execution of such tasks.

Exploration & Taste Judgment

Workflows are useful when you need to explore different solution paths, especially for tasks involving aesthetic judgment like design or naming, and can benefit from a set of evaluation criteria.

You can have Claude explore numerous options and give a reviewing agent criteria for "what a good solution looks like." The task is done when the reviewing agent deems the result meets the criteria. Different options can also be ranked or filtered via a tournament based on these criteria.

Evals (Evaluations)

You can run lightweight evals for specific tasks by launching independent agents in worktrees and then comparison agents to compare and score outputs against evaluation criteria. For example, you can evaluate and improve a skill you created against specific standards.

Model & Intelligence Routing: You can create a classification agent tuned for your tasks to decide which model to use. This is useful when tasks involve many tool calls and doing research beforehand can help identify the most suitable model.

For example, for the task "explain how the auth module works," the best model depends on how many files are in the auth module and the codebase structure. The classification agent can do this research first, then route the task to Sonnet or Opus based on expected complexity.

When Not to Use Dynamic Workflows

Workflows are still new. While they can deliver far better results in many use cases, not every task needs them, and they can significantly increase token consumption.

It's best to use workflows on tasks that expand Claude Code's capabilities in new ways. For routine programming tasks, ask yourself: does this task really need more compute? For example, most traditional programming tasks don't need a panel of 5 reviewers.

Tips for Building Dynamic Workflows

Prompt Design

When writing prompts for dynamic workflows, more detail usually yields better results, especially using the specific techniques mentioned above.

Workflows aren't only for large tasks. You can also prompt the model to use a "quick workflow." For instance, you could create a quick adversarial review process to check a hypothesis.

Combine with /goal and /loop

When using repeatable workflows like triage, research, or verification workflows, you can pair them with /loop to run at fixed intervals, and /goal to set hard completion requirements.

Token Usage Budget

You can set explicit token usage budgets for dynamic workflows to limit token consumption. You can write something like "use 10k tokens" in the prompt to set a 10k token cap.

Saving & Sharing Dynamic Workflows

You can save workflows by pressing 's' in the workflow menu. You can commit them to ~/.claude/workflows or distribute them via skills.

To share them via a skill, place the JavaScript workflow file in the skill folder and reference it in SKILL.md. For greater flexibility, you can also prompt Claude to treat workflows in a skill as templates rather than scripts to be run verbatim.

A Whole New World

Workflows are a useful new way to extend Claude Code. I encourage you to see them as a starting point. There's much more to explore on how best to use them. Please share your findings with us.

Thariq Shihipar and Sid Bidasaria (@sidbid) are members of the Anthropic technical team working on Claude Code.

Связанные с этим вопросы

QWhat is the core value of the dynamic workflows introduced by Claude Code?

AThe core value is enabling Claude to dynamically generate an execution framework for complex tasks: breaking down tasks, dispatching sub-agents, parallel processing, cross-validation, iterative cycles, and even making different agents compete, before synthesizing the results.

QWhat common issues in long-running tasks does the dynamic workflow aim to solve?

AIt aims to solve agentic laziness (stopping prematurely), self-preferential bias (favoring its own conclusions), and goal drift (losing track of the original goal over multiple rounds of execution).

QName one practical pattern mentioned for building dynamic workflows and briefly describe it.

AFan-out and Merge: It splits a task into multiple smaller steps, each handled by a separate agent in its own clean context, and then merges their structured outputs into a final result.

QAccording to the article, what is a significant non-technical use case for dynamic workflows?

ADeep research, such as generating a status report from Slack context or investigating how a feature works by deeply exploring the codebase, is a significant non-technical use case.

QWhat is one key consideration or limitation when deciding to use a dynamic workflow?

ADynamic workflows typically consume more tokens and may not be necessary or efficient for every routine coding task. They are best used to extend Claude Code's capabilities for complex, structured problems.

Похожее

SpaceX, OpenAI, Anthropic: The Three AI Giants Racing for IPO, Which One Is Worth Betting On?

SpaceX, OpenAI, and Anthropic are poised for historic IPOs within weeks, potentially raising a combined $180 billion—a sum exceeding the entire internet bubble's fundraising. The hosts of the Limitless Podcast argue this isn't just individual company financing but an unprecedented capital concentration for AI infrastructure, driven by an insatiable need for compute, data centers, power, and chips. SpaceX's IPO is notable for reportedly changing market index rules to allow faster inclusion, potentially funneling trillions in passive retirement funds into its stock, despite its unproven space-based data center business model. In contrast, Anthropic demonstrates explosive growth, with ARR reportedly hitting $45 billion and approaching profitability, fueled by strong enterprise adoption of products like Claude Code. Google's separate $80 billion raise highlights the immense capital pressure, even for giants. The discussion acknowledges bubble risks but leans optimistic. The hosts contend the massive spending is building essential physical infrastructure for the next technological era. A key bottleneck isn't capital but the real-world limits of chip manufacturing and construction speed. As long as demand for AI compute outstrips supply, this investment cycle represents a foundational build-out rather than a purely financial bubble. All three companies are seen as foundational bets on the future, with Anthropic often cited as the most immediately compelling due to its proven revenue trajectory.

marsbit48 мин. назад

SpaceX, OpenAI, Anthropic: The Three AI Giants Racing for IPO, Which One Is Worth Betting On?

marsbit48 мин. назад

From 'Old Guys' to 'New Favorites': How AI Is Revaluing Old Infrastructure from Dell to Nokia?

From "Vintage Tech" to "New AI Darlings": How AI Revalues Old Infrastructure One year ago, tech giants like Dell, Nokia, Cisco, and Western Data were seen as slow-growth, low-valuation stories, far from the AI spotlight dominated by players like Nvidia. Now, these legacy tech stocks are gaining market attention, sparking debate on whether this is genuine industry revaluation or a temporary narrative. As AI moves from model parameters to real-world data centers, the market is recognizing companies with proven delivery and infrastructure capabilities. This shift marks a change in the AI investment thesis: from pure model and GPU focus to the complex systems engineering required for deployment. Companies like Dell, HPE, and Corning are being revalued not for being "sexy" AI innovators, but for their decades of accumulated expertise in supply chains, enterprise delivery, and infrastructure—assets that have become critical in the AI buildout phase. The revaluation is unfolding across three key infrastructure lines: 1. **Servers & System Integration:** Dell and HPE are emerging as crucial system integrators or "general contractors" for AI data centers, translating GPU orders into complete, deployable server racks integrated with power, cooling, and networking. 2. **Networking & Connectivity:** AI's scale demands robust high-speed connections. Corning (fiber optics), Nokia (AI-RAN, 6G), and Cisco (data center switches) are gaining importance for enabling efficient data transfer within and between AI clusters. 3. **Storage:** Beyond high-speed memory (HBM/DRAM), the AI data explosion is driving demand for high-capacity hard drives (HDDs) from companies like Western Digital and Seagate to handle training data, logs, and cold storage cost-effectively. For this revaluation to be substantive and not just a narrative, three criteria are key: 1) Concrete AI-related order and revenue growth (e.g., Dell's AI server sales), 2) Upward revisions to company financial guidance, and 3) Sustainable improvements in profit quality, not just top-line revenue spikes. In essence, AI's transition to a real construction phase is re-pricing "old assets" against "new demand." The opportunity, however, is selective. Only those legacy firms that are demonstrably integrated into the capital expenditure chains of data center and enterprise AI deployment are likely to experience a true "logic re-rating" rather than just a temporary valuation bounce.

marsbit54 мин. назад

From 'Old Guys' to 'New Favorites': How AI Is Revaluing Old Infrastructure from Dell to Nokia?

marsbit54 мин. назад

The Merger of Codex and ChatGPT Marks the Beginning of a Major Reshuffle in Programming Tools

OpenAI is shifting its strategic focus from ChatGPT to Codex, merging them along with the browser tool Atlas into a unified desktop super-app. This move signals an internal belief that Codex, originally a programming tool, represents the next evolution of AI more than conversational models like ChatGPT. Over the past year, Codex's weekly active users have surged past 5 million. The key distinction is that while ChatGPT answers questions, Codex executes tasks. Enterprises increasingly value this ability to get work done over simply receiving advice. Consequently, Codex is attracting professionals beyond developers, including analysts, bankers, marketers, and product managers. OpenAI's reorganization and increased investment in Codex stem from recognizing that the future of AI competition lies in execution capabilities, not just conversation. The company is launching role-specific plugins (e.g., for data analysis, sales, design) to transform Codex into a broad knowledge work platform that automates and redefines white-collar workflows. Beyond being a tool, Codex reflects OpenAI's ambition to redefine software. New features like "Sites"—which generates interactive websites from documents—and collaborative "Annotations" aim to create a paradigm where the AI understands the goal and handles the tools and steps, functioning more like a digital colleague than traditional software. The ultimate goal is a unified experience where the user cares only about the completed task.

marsbit1 ч. назад

The Merger of Codex and ChatGPT Marks the Beginning of a Major Reshuffle in Programming Tools

marsbit1 ч. назад

Interpreting Investment Opportunities in the Age of Great Navigation, Invesco Great Wall Fund Releases '2026 Report on Chinese Enterprises Going Global'

Invesco Great Wall Fund has released its "2026 China Corporate Globalization Report," titled "The 'Great Navigation Era' of Chinese Enterprises." The report analyzes the new trends and investment opportunities as Chinese companies expand globally, moving from simple product exports to comprehensive overseas operations involving services, branding, and local production. Driven by factors like trade friction, the pursuit of higher profit margins abroad, and policy support, globalization is becoming essential for Chinese companies. The report outlines an evolution: from early product export ("Globalization 1.0") to the current "Globalization 2.0," characterized by overseas capacity, capital goods investment, consumer brand expansion, and service exports. Chinese firms' competitive advantages are highlighted, including a vast engineer talent pool, low-cost and robust infrastructure, and complete industrial clusters. Specific sectors with significant出海 potential are identified: * **Capital Goods** (e.g., engineering machinery, power equipment): Benefiting from global demand, especially in Belt & Road markets and the AI-driven power grid upgrade cycle. * **Consumer Brands**: Transitioning from cost to brand advantage, leveraging供应链 efficiency. * **Technology & Innovation**: Including AI applications, optical modules within global tech supply chains, and new energy vehicles focusing on local production. * **Pharmaceuticals**: Chinese biotech firms are becoming preferred partners for global pharma, with potential for breakthrough drugs in areas like oncology and weight loss. The report concludes that corporate globalization represents a sustained, core theme for China's capital markets, though companies must navigate challenges like geopolitics and localization.

marsbit1 ч. назад

Interpreting Investment Opportunities in the Age of Great Navigation, Invesco Great Wall Fund Releases '2026 Report on Chinese Enterprises Going Global'

marsbit1 ч. назад

Торговля

Спот
Фьючерсы

Популярные статьи

Неделя обучения по популярным токенам (2): 2026 может стать годом приложений реального времени, сектор AI продолжает оставаться в тренде

2025 год — год институциональных инвесторов, в будущем он будет доминировать в приложениях реального времени.

1.8k просмотров всегоОпубликовано 2025.12.16Обновлено 2025.12.16

Неделя обучения по популярным токенам (2): 2026 может стать годом приложений реального времени, сектор AI продолжает оставаться в тренде

Обсуждения

Добро пожаловать в Сообщество HTX. Здесь вы сможете быть в курсе последних новостей о развитии платформы и получить доступ к профессиональной аналитической информации о рынке. Мнения пользователей о цене на AI (AI) представлены ниже.

活动图片