---
description: What are Claude workflows? Learn how Claude Code dynamic workflows run, the patterns that scale, and how teams control model routing, MCP tools, and cost.
title: "Claude Code Workflows: Patterns That Scale for Teams"
image: https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/11/claude-code-workflows-patterns-that-scale-for-teams-bifrost-1920x1080.png
---

Try Bifrost Enterprise free for 14 days. [Request access](https://www.getmaxim.ai/#enterprise-trial)

**TL;DR**

- Claude workflows, or dynamic workflows in Claude Code, are JavaScript scripts Claude writes to orchestrate many subagents in the background, from a handful to hundreds per run.
- The patterns that scale are fan-out audits, fix-until-pass loops, isolated parallel migrations, review-and-merge, and adversarial verification of findings.
- Workflows multiply token use, so a team running them needs per-developer budgets, token rate limits, and cheaper models for routine stages.
- Routing Claude Code through Bifrost applies virtual keys, budgets, model routing, MCP tool filtering, and logs to every subagent call a workflow makes.
- Admins can set a default workflow size, require approval per run, or turn workflows off with managed settings.

Claude workflows, called dynamic workflows in Claude Code, are scripts Claude writes to orchestrate many subagents on one task, running in the background while the developer's session stays responsive. Anthropic launched Claude Code workflows on May 28, 2026, and they are now generally available on Pro, Max, Team, and Enterprise plans. [Bifrost](https://www.getmaxim.ai), the [open-source AI gateway built for enterprise LLM and MCP traffic](https://github.com/maximhq/bifrost) by Maxim AI, gives teams the routing, tool governance, and cost limits that workflows at scale require. This guide explains how workflows run, which patterns hold up, and how to govern them across a team.

## What Are Claude Workflows?

A Claude workflow is a JavaScript script that coordinates subagents. Claude writes the script for the task you describe, the runtime executes it, and the script holds the loop, the branching, and the intermediate results. Claude's context window receives only the final answer, not every agent's transcript.

That design is what separates workflows from the other ways Claude Code runs multi-step work:

| Mechanism | Who decides the next step | Where intermediate results live | Typical scale |
| --- | --- | --- | --- |
| Subagents | Claude, turn by turn | Claude's context window | A few delegated tasks per turn |
| Skills | Claude, following instructions | Claude's context window | Same as subagents |
| Agent teams | A lead agent supervising peers | A shared task list | A handful of long-running peers |
| Dynamic workflows | The script | Script variables | Dozens to hundreds of agents per run |

You can start a workflow three ways. Include the keyword `ultracode` in a prompt, or simply ask Claude to use a workflow. Turn on `/effort ultracode` so Claude plans a workflow for each substantive task in the session. Or run a saved or bundled workflow command, such as `/deep-research`, which fans out web searches and cross-checks sources before writing a cited report. The [Claude Code workflows documentation](https://code.claude.com/docs/en/workflows) covers every option. For the related primitive, see our guide to [Claude Code subagents](https://www.getmaxim.ai/articles/claude-code-subagents/).

## How Claude Code Workflows Run

A Claude Code workflow runs as a script in an isolated runtime, separate from the conversation. The script calls `agent()` to spawn one subagent, `pipeline()` to run one agent per item in a list, and `parallel()` to run a set of agents at once, grouping them into phases that appear in the `/workflows` progress view.

![A developer prompt becomes a JavaScript workflow script; the runtime runs phases of parallel subagents, keeps intermediate results in script variables, and returns one final report to the session](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/claude-code-workflows/claude-code-workflows-run.png)

A developer prompt becomes a JavaScript workflow script; the runtime runs phases of parallel subagents, keeps intermediate results in script variables, and returns one final report to the session

*Figure 1: The script holds the loop and the intermediate results, so the main conversation only receives the final answer.*

The runtime limits that matter for planning, per the documentation:

- **Concurrency.** Up to 16 agents run at once by default, fewer on machines with fewer CPUs.
- **Run size.** A single run is capped at 1,000 agents, and a single `parallel()` or `pipeline()` call at 4,096 items.
- **Resumability.** A paused or stopped run can be relaunched in the same session; completed agents return their saved results.
- **No mid-run input.** Agents read files, write code, and run commands; the script itself only coordinates them.

Saved workflows live in `.claude/workflows/` for a project, shared through the repository, or `~/.claude/workflows/` for personal use, and run as `/<name>` commands. Workflows can also be distributed in plugins. The [Claude Code resource hub](https://www.getmaxim.ai/resources/claude-code) collects related setup guides.

## Claude Code Workflow Patterns That Scale

Claude Code workflow patterns that scale share one trait: each agent gets a narrow, checkable task, and the script decides how results combine. Five patterns cover most team use: fan-out audits, fix-until-pass loops, isolated migrations, review-and-merge, and adversarial verification.

| Pattern | Shape | Good for | Cost profile |
| --- | --- | --- | --- |
| Fan-out audit | One agent per file or endpoint, then collect | Security sweeps, missing auth checks, dead code | Scales with file count |
| Fix until pass | Run a checker, fix failures, repeat until clean or stalled | Type errors, lint, failing tests | Bounded by rounds; set a stop rule |
| Isolated migration | Transform each file in its own copy, verify each result | Framework upgrades, language migrations | High; run a slice first |
| Review and merge | Reviewer per changed file, one agent ranks and deduplicates | Pull request review | Scales with diff size |
| Adversarial verification | Independent agents try to refute each finding before it is reported | Security findings, research claims | Roughly doubles verification cost |

Two practices make these patterns reliable:

- **Pass structured outputs between stages.** An `agent()` call can take a JSON schema, so the next stage receives typed data instead of prose to parse.
- **Stop on lack of progress.** Loops should end when two rounds in a row change nothing, not only when they succeed.

Anthropic's announcement cites porting the Bun runtime from Zig to Rust as an example of what workflows can coordinate at scale. Most teams start smaller: a single directory audit, then the whole repository. For established habits around sessions, prompts, and context, see [Claude Code best practices for enterprise teams](https://www.getmaxim.ai/articles/claude-code-best-practices-for-enterprise-engineering-teams/).

## Why Workflows Change Cost and Governance for Teams

Workflows change the economics of Claude Code because one prompt can start dozens of agents, each making its own model and tool calls. Anthropic's [announcement of dynamic workflows](https://claude.com/resources/articles/introducing-dynamic-workflows-in-claude-code) states plainly that workflows can consume substantially more tokens than a typical session.

Claude Code includes its own guardrails:

- **Size guideline.** Claude aims for fewer than 5, 10, or 50 agents depending on the `small`, `medium`, or `large` setting; `medium` is the default, `small` on Pro.
- **Large workflow warning.** A run that schedules more than 25 agents or projects more than 1.5 million tokens shows a warning.
- **Approval.** Depending on the permission mode, Claude Code asks before a workflow starts and shows the planned phases.

These controls shape one developer's run. They do not give a platform team a spending ceiling per team, a choice of which provider serves Claude models, a policy on which MCP tools subagents may call, or a single log across everyone's runs. Those controls belong at the network layer, between Claude Code and the model and tool endpoints. The analysis of [the hidden cost of Claude Code at enterprise scale](https://www.getmaxim.ai/articles/the-hidden-cost-of-claude-code-at-enterprise-scale/) shows how quickly spend compounds without them.

## Routing Claude Code Workflows Through Bifrost

Routing Claude Code workflows through Bifrost means pointing Claude Code's `ANTHROPIC_BASE_URL` at the Bifrost Anthropic-compatible endpoint. Every model request from the session, including every subagent a workflow spawns, then carries the developer's Bifrost credential, so gateway policy applies to the whole fan-out.

![Workflow subagents from several developers' Claude Code sessions call Bifrost, which applies virtual key budgets, routes models to Anthropic, Bedrock, or Vertex, and governs MCP tools](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/claude-code-workflows/claude-code-workflows-gateway.png)

Workflow subagents from several developers' Claude Code sessions call Bifrost, which applies virtual key budgets, routes models to Anthropic, Bedrock, or Vertex, and governs MCP tools

*Figure 2: Every subagent call in a workflow carries the developer's credential, so team budgets and tool rules apply to the whole fan-out.*

[Bifrost](https://www.getmaxim.ai) supports several ways to connect Claude Code, documented in the [Claude Code integration guide](https://docs.getbifrost.ai/cli-agents/claude-code):

- **Static virtual key.** Set `ANTHROPIC_BASE_URL` to the Bifrost `/anthropic` route and `ANTHROPIC_AUTH_TOKEN` to a virtual key. Suits OSS, CI, and personal use.
- **Claude subscription with governance.** Keep billing on a Claude subscription by signing in with `/login` and sending the virtual key in `ANTHROPIC_CUSTOM_HEADERS` as `x-bf-vk`; Bifrost applies governance and logging while forwarding the subscription token.
- **Dynamic credentials.** Use `apiKeyHelper` with Bifrost CLI SSO so each developer's requests carry their own identity in Bifrost Enterprise.

```json
{
  "env": {
    "ANTHROPIC_BASE_URL": "<https://bifrost.example.com/anthropic>",
    "ANTHROPIC_AUTH_TOKEN": "sk-bf-your-virtual-key"
  }
}
```

With requests flowing through the gateway, the same Claude models can be served from the Anthropic API, Amazon Bedrock, or Google Vertex AI, with [retries and fallbacks](https://docs.getbifrost.ai/features/retries-and-fallbacks) between them when one returns rate-limit errors. The [Claude Code gateway guides](https://www.getmaxim.ai/bifrost/guides/claude-code) and the [Claude Code integration announcement](https://www.getmaxim.ai/bifrost/blog/integrating-claude-code-with-bifrost-gateway) cover setup variants.

## Cost Limits for Claude Code Workflow Runs

Cost limits for Claude Code workflow runs work in two layers: Claude Code controls how many agents a run starts, and the gateway controls how much those agents can spend. Bifrost enforces the second layer per request, so a runaway run stops at the developer's or team's limit rather than the company's.

![Cost controls for a Claude Code workflow: size guideline and stage models in the script, then virtual key token limits, budgets, and project attribution at the gateway](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/claude-code-workflows/claude-code-workflows-cost-controls.png)

Cost controls for a Claude Code workflow: size guideline and stage models in the script, then virtual key token limits, budgets, and project attribution at the gateway

*Figure 3: Claude Code shapes how many agents a run starts; the gateway caps what those agents can spend.*

Gateway controls to set before teams adopt workflows:

- **Token rate limits per key.** Bifrost [rate limits](https://docs.getbifrost.ai/features/governance/budget-and-limits) count both requests and tokens, for example 2 million tokens per hour per developer, so a single fan-out cannot exhaust a shared allowance.
- **Budgets by hierarchy.** Budgets apply to the virtual key, its team, its customer, and each provider config, with daily, weekly, monthly, or calendar-aligned resets.
- **Project attribution.** In Bifrost Enterprise, sending `x-bf-project-id` through `ANTHROPIC_CUSTOM_HEADERS` charges a session to a [project](https://docs.getbifrost.ai/enterprise/projects) with its own budget, useful for one-off migrations.
- **Cheaper models for routine stages.** Ask the workflow to use a smaller model for discovery and sweeps, and use [routing rules](https://docs.getbifrost.ai/providers/routing-rules) to send those models to the cheapest approved provider.

For a broader look at spend, see [how to reduce Claude Code token costs](https://www.getmaxim.ai/articles/how-to-reduce-claude-code-token-costs/) and [how teams manage Claude Code usage limits](https://www.getmaxim.ai/articles/claude-code-usage-limits-how-teams-manage-them/).

## MCP Tools in Claude Code Workflows

Workflow subagents can call the same MCP tools as the main session, which means a fan-out of fifty agents can make fifty times the tool calls. Governing those tools means limiting which ones subagents can see, holding credentials centrally, and keeping tool definitions from consuming each agent's context.

Connecting Claude Code to MCP servers through Bifrost addresses each of these:

- **One endpoint.** Claude Code connects to Bifrost's `/mcp` endpoint instead of many servers; see [connecting Claude Code to multiple MCP servers through one gateway](https://www.getmaxim.ai/articles/connect-claude-code-to-multiple-mcp-servers-through-one-gateway/).
- **Tool filtering per key.** [Tool filtering](https://docs.getbifrost.ai/mcp/filtering) restricts a developer's key to read-only tools, so audit workflows cannot write to production systems.
- **Central credentials.** Upstream tokens stay in the gateway, with per-user OAuth where each developer needs their own access.
- **Lower tool token cost.** [Code Mode](https://docs.getbifrost.ai/mcp/code-mode) exposes servers as stub files the model reads on demand, which cut input tokens by up to 92.8% across large tool sets in Bifrost's tests.

The [MCP gateway product page](https://www.getmaxim.ai/mcp-gateway) summarizes these controls.

## Observability for Workflow Runs

Observability for workflow runs means seeing every subagent's model and tool calls, attributed to the developer and the run, with tokens and cost. The `/workflows` view shows one developer's live run; a gateway log shows every run across the team.

Bifrost's [built-in logs](https://docs.getbifrost.ai/features/observability/default) record each request with its virtual key, model, provider, tokens, cost, and latency, filterable by key, team, or project. Bifrost can also export to OpenTelemetry, Prometheus, and Datadog, and can forward Claude Code's own telemetry when the Cloud gateway sign-in is used. For coding-agent monitoring patterns, see [Claude Code monitoring](https://www.getmaxim.ai/articles/claude-code-monitoring-how-to-track-coding-agents/).

## Admin Controls for Claude Code Workflows

Admin controls for Claude Code workflows combine Claude Code's managed settings with gateway policy. Managed settings decide whether workflows run and how large they plan to be; the gateway decides what their requests may reach and spend.

Settings worth standardizing:

- **`disableWorkflows`** in managed settings turns workflows off for an organization; the Claude Code admin settings page offers the same toggle.
- **`workflowSizeGuideline`** sets the default agent target for every developer.
- **Permission rules** such as `Workflow(<name>)` approve specific saved workflows in non-interactive runs.
- **Shared workflows** in `.claude/workflows/` give every developer the same reviewed orchestration instead of ad hoc scripts.

Pair these with the governance patterns in [Claude Code hooks for gateway policy](https://www.getmaxim.ai/articles/claude-code-hooks-for-governance-and-gateway-policy/), and with the [AI governance page](https://www.getmaxim.ai/ai-governance) for identity-based access in Bifrost Enterprise.

## Frequently Asked Questions

### What are Claude workflows?

Claude workflows are dynamic workflows in Claude Code: JavaScript scripts that Claude writes to orchestrate many subagents on one task. The script runs in the background, holds intermediate results in variables, and returns one final result to the session. They suit codebase audits, large migrations, and research that needs claims cross-checked.

### How do I start a workflow in Claude Code?

Include the keyword `ultracode` in a prompt, ask Claude directly to use a workflow, turn on `/effort ultracode` for the session, or run a saved or bundled workflow such as `/deep-research`. Claude Code shows the planned phases and asks for approval depending on your permission mode. Run `/workflows` to watch progress.

### How many subagents can a Claude Code workflow run?

By default up to 16 agents run concurrently, fewer on machines with fewer CPUs, and a single run is capped at 1,000 agents. The size guideline setting tells Claude to aim for fewer than 5, 10, or 50 agents. Claude Code warns when a run schedules more than 25 agents or projects more than 1.5 million tokens.

### Do Claude Code workflows cost more?

Yes. Each subagent makes its own model calls, so a workflow can use substantially more tokens than the same task done in conversation. Start with a small slice of the task, choose a smaller size guideline, use smaller models for routine stages, and set token rate limits and budgets at a gateway such as [Bifrost](https://www.getmaxim.ai/llm-gateway).

### Can Claude Code workflows use MCP tools?

Yes. Workflow subagents can call the MCP tools available to the session, subject to the same permission checks. For teams, routing those tool calls through an MCP gateway limits which tools each developer's agents can see, keeps credentials out of local config files, and logs every call.

### Can I turn off Claude Code workflows for my organization?

Yes. Set `disableWorkflows` to true in managed settings, or use the toggle on the Claude Code admin settings page. Individual developers can also turn workflows off in `/config` or with an environment variable. Disabling workflows also removes the ultracode option, while runs already in progress continue.

## Start Building with Bifrost

Claude Code workflows turn one prompt into dozens or hundreds of coordinated agents, which makes model routing, MCP tool governance, and cost limits a team concern rather than an individual one. Bifrost applies all three to every subagent call through one endpoint in your own infrastructure. Review the [CLI agents resource hub](https://www.getmaxim.ai/resources/cli-agents), see [enterprise deployment options](https://www.getmaxim.ai/enterprise), or [book a demo](https://www.getmaxim.ai/book-a-demo) to run Claude Code workflows under team-wide governance.

## Read next

[![What Is an AI Control Plane? Capabilities and Architecture](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/what-is-an-ai-control-plane-capabilities-and-architecture-bifrost-1920x1080-1.png) An AI control plane is the central layer where an organization defines and enforces policy for all AI traffic: model calls, tool calls, and agents. This guide explains its capabilities, how an agent control plane extends it, and how to deploy one across apps, agents, and employee devices.](https://www.getmaxim.ai/articles/ai-control-plane/)

[![SageMaker vs Bedrock: Key Differences and When to Use Each](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/sagemaker-vs-bedrock-key-differences-and-when-to-use-each-bifrost-1920x1080.png) SageMaker vs Bedrock is a choice between building on your own models and infrastructure or calling managed foundation models through an API. This guide compares Amazon SageMaker AI and Amazon Bedrock on control, pricing, customization, and agents, and shows how to run both behind one gateway.](https://www.getmaxim.ai/articles/sagemaker-vs-bedrock/)

[![Is Claude Cowork Safe? Security Risks and Controls](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/is-claude-cowork-safe-security-risks-and-controls-bifrost-1920x1080.png) Is Claude Cowork safe for enterprise use? Cowork's agentic capabilities, now part of the main Claude app, can read files, run code, and act through connectors. This guide covers the documented risks, the controls Anthropic provides, and how a gateway adds policy and logging.](https://www.getmaxim.ai/articles/is-claude-cowork-safe/)

## More in AI Gateway

[![Is Claude Cowork Safe? Security Risks and Controls](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/is-claude-cowork-safe-security-risks-and-controls-bifrost-1920x1080.png) Is Claude Cowork safe for enterprise use? Cowork's agentic capabilities, now part of the main Claude app, can read files, run code, and act through connectors. This guide covers the documented risks, the controls Anthropic provides, and how a gateway adds policy and logging.](https://www.getmaxim.ai/articles/is-claude-cowork-safe/)

[![SageMaker vs Bedrock: Key Differences and When to Use Each](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/sagemaker-vs-bedrock-key-differences-and-when-to-use-each-bifrost-1920x1080.png) SageMaker vs Bedrock is a choice between building on your own models and infrastructure or calling managed foundation models through an API. This guide compares Amazon SageMaker AI and Amazon Bedrock on control, pricing, customization, and agents, and shows how to run both behind one gateway.](https://www.getmaxim.ai/articles/sagemaker-vs-bedrock/)

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "publisher": {
        "@type": "Organization",
        "name": "Maxim Articles",
        "url": "https://www.getmaxim.ai/articles/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w256h256/2025/08/thumbnail.png",
            "width": 60,
            "height": 60
        }
    },
    "author": {
        "@type": "Person",
        "name": "Kuldeep Paul",
        "image": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2025/08/1727978381919.jpeg",
            "width": 800,
            "height": 800
        },
        "url": "https://www.getmaxim.ai/articles/author/kuldeep/",
        "sameAs": []
    },
    "headline": "Claude Code Workflows: Patterns That Scale for Teams",
    "url": "https://www.getmaxim.ai/articles/claude-code-workflows/",
    "datePublished": "2026-11-24T12:55:00.000Z",
    "dateModified": "2026-11-26T12:56:12.000Z",
    "image": {
        "@type": "ImageObject",
        "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/11/claude-code-workflows-patterns-that-scale-for-teams-bifrost-1920x1080.png",
        "width": 1200,
        "height": 675
    },
    "keywords": "AI Gateway",
    "description": "What are Claude workflows? In Claude Code, a dynamic workflow is a script Claude writes to run dozens or hundreds of subagents on one task. This guide explains how workflows run, the patterns that scale, and how teams route models, govern MCP tools, and cap spend across every run.",
    "mainEntityOfPage": "https://www.getmaxim.ai/articles/claude-code-workflows/"
}
```
