CLAUDE LABJP
FORK — Claude Code 2.1.212 changes what /fork does: it copies your conversation into a new background session with its own row in claude agents, so you can keep working. The old in-session subagent is now /subtaskLIMITS — WebSearch calls are now capped at 200 per session by default, and subagent spawns get the same 200 ceiling, so a runaway search or delegation loop stops on its ownMCPBG — MCP tool calls running past two minutes now move to the background automatically, keeping the session usable. Tune the threshold with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSPLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callbackSONNET5 — Claude Sonnet 5 is running on introductory pricing of $2 per million input tokens and $10 per million output. After August 31 it moves to $3 and $15IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as OctoberFORK — Claude Code 2.1.212 changes what /fork does: it copies your conversation into a new background session with its own row in claude agents, so you can keep working. The old in-session subagent is now /subtaskLIMITS — WebSearch calls are now capped at 200 per session by default, and subagent spawns get the same 200 ceiling, so a runaway search or delegation loop stops on its ownMCPBG — MCP tool calls running past two minutes now move to the background automatically, keeping the session usable. Tune the threshold with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSPLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callbackSONNET5 — Claude Sonnet 5 is running on introductory pricing of $2 per million input tokens and $10 per million output. After August 31 it moves to $3 and $15IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as October
Articles/Claude Code
Claude Code/2026-05-30Advanced

Authoring Dynamic Workflows: Building Reusable Research Pipelines with phase / agent / pipeline

A hands-on guide to writing your own Claude Code Dynamic Workflows: the phase / agent / pipeline / parallel primitives, locking outputs with JSON Schema, porting the adversarial-verification pattern, and designing for token cost.

Claude Code196Dynamic Workflow2subagents6orchestration7

Premium Article

Run the built-in /deep-research once and the next question is obvious: can I write the same structure for my own task? In my case, I had been hand-routing two things to subagents every time, background research for four technical blogs and the quality check on the articles I generate. Freezing that into a script is what pushed me into authoring my own.

This guide takes the script you can read via View raw script on /deep-research, breaks down the orchestration primitives one by one, and lands on porting them into a real fact-checking pipeline. I covered how to run and save workflows in what I learned about orchestrating subagents, so here I focus on the writing side.

Why moving the plan into code raises reliability

When you spawn subagents turn by turn, Claude decides the next move on the spot. That's flexible, but it offers no guarantee that running the same task twice takes the same steps. A workflow holds the loop, branching, and intermediate results in the script, so the orchestration itself becomes reproducible.

More importantly, you can have independent agents adversarially review each other's results, or weigh plans drafted from several angles. A more trustworthy result comes not from the number of agents but from having this "cross-check" structure. That verification structure is exactly what I wanted when I decided to turn fact-checking into a workflow.

The five primitives a workflow is built from

The key to reading a script is these five.

  • meta: an export declaring the workflow's name, description, and phase list
  • phase("name"): a marker that segments the progress view, one per /workflows row
  • agent(prompt, options): launches one subagent; pass label, schema, and phase in options
  • pipeline(items, stage1, stage2, ...): staged processing that feeds each stage's output into the next
  • parallel([fn, fn, ...]): runs an array of functions concurrently

The minimal shape looks like this. Script arguments arrive in args, and log() records progress.

export const meta = {
  name: "article-fact-check",
  description: "Extract claims from an article and keep the ones that survive",
  phases: [
    { title: "Extract", detail: "Pull checkable claims from the body" },
    { title: "Verify", detail: "Verify each claim with a 3-vote scheme" },
    { title: "Report", detail: "Synthesize the surviving claims" },
  ],
};
 
phase("Extract");
const ARTICLE = (typeof args === "string" && args.trim()) || "";
if (!ARTICLE) {
  return { error: "Pass the article path via args" };
}

Whatever you list in meta.phases shows up in the pre-launch approval dialog as "how this will run." It's an explanation to the reader (you, approving it), so it's worth writing carefully.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Anyone who was calling subagents by hand can now write a reproducible script with phase / agent / pipeline
You'll be able to lock each phase's output with JSON Schema so downstream stages don't break
You can port the 3-vote adversarial verification pattern into your own fact-checking or research tasks
You'll gain a model-routing rule of thumb that keeps token cost in check even at hundreds of agents
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Claude Code2026-05-30
Running Claude Code's Dynamic Workflows: What I Learned About Orchestrating Subagents
A hands-on walk through Claude Code's Dynamic Workflows (v2.1.154): running /deep-research, enabling the feature, watching progress with /workflows, and saving a workflow for reuse, from an indie developer's angle.
Claude Code2026-07-01
Don't Accept an Agent's Numbers and Citations As-Is — A Verification Gate Built on a Dedicated Auditor Subagent
A design that verifies every number and citation in an agent-generated summary using a separate subagent before accepting it — with working TypeScript for deterministic recomputation and fail-closed source matching.
Claude Code2026-06-13
Context Budgets for Nested Subagents: Designing Contracts So 5-Level Delegation Doesn't Lose Quality
Once subagents could nest, deeper delegation made summaries thinner and reruns more frequent. Here is how I rebuilt quality by adding four contracts between layers: token budgets, a handoff schema, failure isolation, and an independent grader.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →