The /workflows command in Claude Code lets you compose and run dynamic multi-agent workflows with full transparency. Here's how it works and when to use it.
Understanding Claude Code’s Approach to Multi-Agent Work #
If you’ve been using Claude Code for more than a few sessions, you’ve probably noticed it handles plenty of tasks on its own — reading files, writing code, running terminal commands. But some problems are bigger than what a single agent pass can solve cleanly. That’s where the /workflows
command comes in.
The /workflows
command in Claude Code lets you define, manage, and run structured multi-agent workflows — sequences of steps that Claude and its subagents execute in a coordinated way. It’s one of the more powerful (and underused) features for anyone doing serious automation with Claude Code.
This article explains what /workflows
actually does, how the underlying multi-agent orchestration works, when to use it, and how it compares to simpler approaches.
What the /workflows Command Actually Does #
At its core, /workflows
is a way to run predefined workflow definitions stored in your project. Instead of typing out a complex, multi-step instruction every session, you encode the logic once and invoke it on demand.
When you type /workflows
in Claude Code, you get a list of available workflows scoped to your current project. Each workflow is a structured definition — typically a markdown file — stored in your project’s .claude/
directory. Running one tells Claude to execute that workflow’s steps, potentially spawning subagents to handle parallel or specialized work along the way.
The key insight: workflows aren’t just macros or scripts. Claude reads and interprets the workflow definition, reasons about it, and figures out how to execute it — including deciding when to delegate work to subagents.
Where Workflow Files Live
Workflows are stored as markdown files under .claude/workflows/
in your project root. Each file typically contains:
- A description of the workflow’s purpose
- A sequence of steps or instructions
- Any context Claude should carry between steps
- Optional parameters that can be passed at runtime
Because they’re plain markdown, they’re readable, version-controllable, and easy to edit without any special tooling.
How to Invoke a Workflow
Once you have workflows defined, running them is simple:
/workflows
This lists all available workflows. To run a specific one:
/workflows run <workflow-name>
Or pass parameters inline if the workflow supports them:
/workflows run code-review --target src/api/
How Multi-Agent Orchestration Works Under the Hood #
The /workflows
command isn’t magic — it’s a clean interface on top of Claude Code’s multi-agent architecture. Understanding that architecture makes the whole thing click.
The Orchestrator-Worker Model
Claude Code’s multi-agent framework follows an orchestrator-worker pattern. When you run a workflow, the primary Claude instance acts as the orchestrator. It reads the workflow definition, breaks it into discrete tasks, and decides which tasks to handle directly and which to delegate.
Delegation happens through the Task
tool — a built-in capability that lets Claude spawn subagent instances. Each subagent is an independent Claude Code session with its own context window. The orchestrator can spin up multiple subagents in parallel, each handling a different slice of the work.
This matters because it gets around one of the biggest constraints in LLM-based automation: context window limits. A single agent trying to refactor a large codebase while also running tests and writing documentation will eventually run into context ceiling problems. Distributing work across subagents sidesteps this.
What Subagents Can Do
Each subagent gets access to the same tools the orchestrator has — file read/write, terminal execution, web fetch, and more. But subagents operate in scoped contexts: they know what the orchestrator told them, not the full conversation history.
This is actually a feature, not a limitation. Focused context means subagents don’t get distracted by unrelated information. A subagent tasked with “run all unit tests and report failures” only needs to know that — not the entire workflow history.
Sequential vs. Parallel Execution
One of the more useful aspects of Claude Code’s orchestration is that it can reason about task dependencies. If two tasks are independent, it can run subagents for them in parallel. If one task depends on the output of another, it sequences them correctly.
You don’t have to explicitly specify this in most cases. Claude infers the dependency structure from the workflow definition and execution context. That said, you can make dependencies explicit in your workflow markdown if you want predictable behavior.
How Information Flows Between Agents
The orchestrator and subagents communicate through structured outputs. A subagent completes its task and returns a result to the orchestrator, which then uses that result to inform the next step. This handoff mechanism is what makes complex, multi-stage workflows possible without losing coherence between steps.
When to Use /workflows vs. Simple Prompts #
Built like a system. Not vibe-coded.
Remy manages the project — every layer architected, not stitched together at the last second.
Not every task needs a workflow. Knowing when to reach for /workflows
versus just typing an instruction saves time and avoids over-engineering.
Use /workflows when:
The task has multiple distinct phases— e.g., analyze, then refactor, then test, then document** You run the same complex process repeatedly**— code review pipelines, deployment checklists, data migration scripts** Tasks can run in parallel**— independent sub-tasks that would otherwise serialize unnecessarily** Context management matters**— tasks too large for a single agent’s context window** You want reproducibility**— the same workflow should produce consistent results across runs
Stick with direct prompts when:
- The task is a single, contained operation
- You’re exploring or experimenting — workflows are overkill for one-off requests
- The task is conversational — back-and-forth clarification doesn’t fit a workflow structure
A good rule of thumb: if you’ve typed the same complex multi-step instruction more than twice in a week, it’s worth encoding as a workflow.
Building a Workflow: A Practical Example #
Here’s what a real workflow definition looks like for a code review process.
Example: Automated Code Review Workflow
Create .claude/workflows/code-review.md
:
## Description
Performs a comprehensive code review of changed files, covering correctness,
style, security, and test coverage. Runs analysis in parallel and produces
a unified report.
## Parameters
- target: Path to review (default: current diff)
## Steps
### Step 1: Identify Changed Files
Get the list of files changed since the last commit using git diff.
### Step 2: Parallel Analysis (run concurrently)
- **Correctness Agent**: Review logic, edge cases, and potential bugs
- **Security Agent**: Check for common vulnerabilities, exposed secrets,
injection risks
- **Style Agent**: Check against project conventions in CONTRIBUTING.md
### Step 3: Test Coverage Check
Identify functions and branches not covered by existing tests.
Flag critical paths with no coverage.
### Step 4: Synthesize Report
Combine findings from all agents into a structured report with:
- Critical issues (blocking)
- Warnings (non-blocking but important)
- Suggestions (optional improvements)
Output as REVIEW.md in the project root.
Running this with /workflows run code-review
triggers Claude to orchestrate the entire process — spawning parallel subagents for steps that can run concurrently, waiting for results, and producing the final report.
What Transparency Looks Like
One of the better design decisions in Claude Code’s workflow execution is that you can see what’s happening. The orchestrator narrates its reasoning, and you can observe which subagents are running and what they’re working on. This isn’t a black box — you get a clear trace of decisions and delegations.
Full Transparency: Seeing Inside the Workflow #
Opacity is one of the main reasons people distrust automated pipelines. Claude Code’s /workflows
execution is designed to be auditable.
As a workflow runs, Claude Code surfaces:
Orchestration decisions— why it’s delegating certain tasks to subagents** Subagent spawning**— when a new subagent is created and what it’s been asked to do** Tool calls**— every file read, terminal command, or web fetch, attributed to the agent that made it** Handoffs**— when subagent results are passed back to the orchestrator** Synthesis steps**— how the orchestrator combines results into a final output
This trace appears in the Claude Code interface in real time. If something goes wrong or produces unexpected results, you have enough information to diagnose the problem — which step failed, which agent was responsible, and what inputs it was working with.
Common Patterns for Multi-Agent Workflows #
Across different use cases, a handful of patterns show up repeatedly when people build workflows in Claude Code.
The Map-Reduce Pattern
Break a large problem into independent chunks, process each chunk with a separate subagent, then aggregate the results. Works well for:
- Large codebase analysis (process each module in parallel)
- Document processing (analyze each document, then synthesize)
- Test generation (generate tests per function, then deduplicate and organize)
The Pipeline Pattern
Sequential stages where each step’s output feeds the next. Works well for:
- CI-style workflows (lint → test → build → deploy check)
- Data transformation (extract → clean → validate → load)
- Content production (research → draft → review → format)
The Specialist Pattern
Different agents with different system prompts or focuses handle different aspects of the same problem simultaneously. Works well for:
- Multi-perspective review (security + performance + maintainability)
- Cross-functional tasks (code changes + documentation + changelog)
- Quality gates (each agent checks a different dimension)
Where MindStudio Fits In #
Claude Code’s /workflows
command is powerful for developers working in terminal environments — but it assumes you’re already comfortable with Claude Code, markdown workflow definitions, and the command-line interface.
If you want the same kind of multi-agent orchestration available to non-technical teammates, or if you need to connect those workflows to external systems — CRMs, project management tools, email, databases — that’s where MindStudio comes in.
MindStudio is a no-code platform for building and deploying AI agents and automated workflows. You can compose multi-step agent pipelines visually, without writing workflow markdown or managing subagent configuration. The same orchestrator-worker logic that makes Claude Code’s /workflows
effective is available through a drag-and-drop interface, with 1,000+ pre-built integrations to business tools like HubSpot, Slack, Notion, and Airtable already connected.
For developers specifically, MindStudio’s Agent Skills Plugin (@mindstudio-ai/agent
) lets any AI agent — including Claude Code — call MindStudio’s 120+ typed capabilities as simple method calls. That means your Claude Code workflows can trigger actions like agent.sendEmail()
, agent.runWorkflow()
, or agent.searchGoogle()
without you building the infrastructure for each one.
And if you want to expose a complex multi-agent workflow as an API endpoint that other systems can call, MindStudio handles that out of the box. You can try it free at mindstudio.ai.
Tips for Writing Effective Workflow Definitions #
A workflow is only as good as its definition. A few practices that make a difference:
Be specific about outputs. Vague step descriptions produce vague results. Instead of “review the code,” write “identify functions with cyclomatic complexity above 10 and list specific refactoring suggestions for each.”
Make dependencies explicit when order matters. If step 3 requires results from step 2, say so. Don’t rely on Claude inferring the dependency if the step descriptions don’t make it obvious.
Define your parameters upfront. Workflows that accept parameters are reusable across different contexts. A code review workflow that accepts a target
parameter works for any directory, not just the one you had in mind when you wrote it.
Seven tools to build an app. Or just Remy. #
Editor, preview, AI agents, deploy — all in one tab. Nothing to install.
Include context that subagents need. Subagents only know what the orchestrator tells them. If a subagent needs to know your project’s conventions, include a pointer to CONTRIBUTING.md or paste the relevant rules into the step definition.
Keep steps focused. A step that tries to do too many things becomes hard to debug when something goes wrong. One clear responsibility per step makes failures easier to isolate.
Limitations Worth Knowing About #
Claude Code’s /workflows
feature is genuinely useful, but it has edges worth understanding before you build on top of it.
Context isolation between subagents. Subagents don’t share memory. If agent A discovers something important that agent B needs to know, the orchestrator has to explicitly pass that information. If your workflow definition doesn’t account for this, you can end up with subagents working on outdated assumptions.
No persistent state across workflow runs. Each workflow invocation starts fresh. If you need to accumulate state across multiple runs — say, tracking issues found over a week of daily code reviews — you need to handle persistence yourself (write to a file, update a database, etc.).
Parallel execution isn’t guaranteed. Claude Code reasons about whether to parallelize, but it may choose to serialize tasks based on how the workflow definition is written. If parallel execution is critical for performance, make the independence of tasks explicit.
Rate limits apply to subagents. Each subagent counts against your API usage. A workflow that spawns many subagents can consume tokens quickly. For expensive or long-running workflows, keep an eye on costs.
FAQ #
What is the /workflows command in Claude Code?
The /workflows
command in Claude Code lets you define, list, and run structured multi-agent workflows stored in your project’s .claude/workflows/
directory. Each workflow is a markdown file that describes a series of steps. When invoked, Claude reads the definition, orchestrates execution, and spawns subagents as needed to complete the work.
How is /workflows different from just writing a long prompt?
A long prompt runs in a single agent’s context window. The /workflows
command enables multi-agent orchestration — Claude can delegate subtasks to independent subagents running in parallel, each with focused context. This makes workflows better suited for complex, multi-phase tasks that would otherwise exceed a single agent’s context limits or take much longer to run sequentially.
Can /workflows run tasks in parallel?
Yes. Claude Code’s orchestrator can spawn multiple subagents simultaneously for tasks that don’t depend on each other. Parallel execution happens when Claude determines that two or more steps are independent — either because the workflow definition makes this clear, or because Claude infers it from the step descriptions.
Do I need to know how to code to use /workflows?
Not really. Workflow definitions are markdown files, not code. If you can write clear, structured instructions in plain English, you can write a workflow definition. The main skills involved are breaking a problem into steps and being precise about what each step should do and produce.
How does Claude Code handle failures in a workflow?
One coffee. One working app. #
You bring the idea. Remy manages the project.
When a subagent or step fails, the orchestrator is notified. Depending on the nature of the failure, Claude may retry, skip the step, or halt the workflow and surface the error. You see a clear trace of what went wrong and where. There’s no automatic retry logic by default — Claude reasons about failure handling based on the workflow definition and context.
Are workflow files version-controlled?
Yes — because they’re plain markdown files stored in your project directory, they’re tracked by git automatically. This means you can version, review, and collaborate on workflows the same way you do any other project file. Workflows stored in .claude/workflows/
appear in your repo history, can be code-reviewed in pull requests, and roll back cleanly with standard git operations.
Key Takeaways #
- The
/workflows
command in Claude Code runs structured multi-agent workflows defined in markdown files stored in your project - Claude acts as an orchestrator, spawning and coordinating subagents for parallel or sequential tasks
- Workflow definitions are plain markdown — readable, version-controllable, and shareable
- Common patterns include map-reduce (parallel chunks), pipeline (sequential stages), and specialist (concurrent perspectives)
- Full execution transparency lets you trace orchestration decisions, tool calls, and subagent handoffs
- For teams who need this kind of orchestration without the terminal setup — or connected to external business tools — MindStudio provides a no-code path to the same capability
If you’re building workflows that need to connect to the broader tooling your team actually uses, MindStudio is worth a look — it’s free to start.