●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 /subtask●LIMITS — 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 own●MCPBG — 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_MS●PLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callback●SONNET5 — 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 $15●IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as October●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 /subtask●LIMITS — 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 own●MCPBG — 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_MS●PLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callback●SONNET5 — 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 $15●IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as October
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.
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.
A workflow usually breaks when an upstream agent returns an unexpected shape. schema prevents that. Pass a JSON Schema to each agent call and the agent is required to return structured data downstream stages can handle safely.
const EXTRACT_SCHEMA = { type: "object", required: ["claims"], properties: { claims: { type: "array", maxItems: 5, items: { type: "object", required: ["claim", "quote", "importance"], properties: { claim: { type: "string" }, quote: { type: "string" }, importance: { enum: ["central", "supporting", "tangential"] }, }, }, }, },};const extracted = await agent( "Extract up to 5 checkable claims from this article. " + "Attach a direct quote from the body as quote for each.\n\nArticle path: " + ARTICLE, { label: "extract", phase: "Extract", schema: EXTRACT_SCHEMA },);
The point is enum and required. If importance were free text, downstream sorting would fall apart; constrained to central / supporting / tangential, it becomes a sort key directly. I wrote this loosely at first and twice watched downstream sorting fail because the keys didn't line up. Design the schema backward from what downstream needs.
Understanding pipeline vs parallel in code
parallel is simple: it runs an array of functions at once and returns results as an array. The concurrency cap is 16, so passing more is throttled internally.
pipeline, on the other hand, flows each upstream output into the next stage. /deep-research writes "search per angle, then fetch sources while de-duplicating URLs" as a pipeline, so it can flow each angle into fetching as soon as that angle returns, without waiting for all searches. For processing that requires full aggregation (like finalizing the claim pool before verification), put a barrier (an awaited parallel) after the pipeline. Keeping that distinction in mind stabilizes the design.
Porting the adversarial-verification pattern
The code above is exactly that, and the 3-vote adversarial scheme fits article fact-checking cleanly. Across four sites I publish four pieces a day total, and I always needed a step to confirm a generated article's claims don't drift from the official docs. Replacing pure mechanical checks (like my article_gate.py) with a structure that has multiple agents attempt refutation and drops any claim with 2+ refutations catches factual errors that rule-based checks can't.
Abstentions need care. When an agent returns null on error or user-skip, counting that as "no refutation, survives" lets all-abstain claims slip through. Putting a minimum valid-vote quorum into the survival condition, like valid.length >= REFUTES_TO_KILL, is the key to avoiding that trap.
Token cost and routing models per stage
A workflow drives dozens to hundreds of agents, so it clearly uses more tokens than working the same task in conversation. That's a real cost, and the reason an alternative route, zeroing out API spend with a local VLM (something like Ollama + Qwen3-VL), draws attention comes down to this same cost problem.
Still, I don't think you need to abandon cloud-model workflows. The key is routing models per stage. Each agent uses the session model by default, but for stages that don't need a strong model (extraction, labeling), you can ask Claude in the task description to "use a smaller model for this stage." Reserve the stronger model for stages where judgment matters, like verification and synthesis, and total cost drops sharply.
In practice I check things in this order.
Check /model before a big run (so you don't run on the small model you switched to for routine work)
Put "use a smaller model" into the task description for mechanical stages like extraction and classification
Mind the 16-concurrent / 1,000-total caps, and narrow item counts with maxItems or slice
When updating my wallpaper apps (over 50 million downloads across iOS and Android), I split manual investigation the same way: a small model for classifying crash reports, a stronger one for correlating root causes. The same allocation thinking carries straight over to workflows.
Pitfalls in real use
Things I hit while writing and running scripts.
No user input mid-run. If your design needs human sign-off partway, split it into separate workflows per stage.
The script itself can't touch the filesystem or shell. Reading and writing is the agents' job; the script only coordinates. Confuse this and you'll reach for fs and break the design.
Resume works only within the same session. Quit Claude Code and the next run starts from zero, so plan long runs to stay inside one session.
Don't count abstentions / null as survival. Especially for verification, always put a valid-vote quorum into the survival condition.
Save it and reuse it
The value of a custom workflow isn't a one-off run; it's saving it as a repeatable command. Once you get a run you're happy with, select it in /workflows, press s, and save to .claude/workflows/ (team-shared) or ~/.claude/workflows/ (yours only). From then on you call it as a command like /article-fact-check.
As a first step, copying the /deep-research raw script and swapping the search target from the web to your own repo (article MDX) is the easiest entry point. The schema and verification structure carry over almost unchanged. To keep the instructions you hand those scripts lightweight, the design principles in designing skills that stabilize output with template fixing and decision guides apply directly to the prompts inside a workflow too.
I have a feeling this verification-backed structure quietly helps keep quality up across multiple sites run by one person. I'd be glad to keep experimenting alongside you.
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.