"A harness for every task: dynamic workflows in Claude Code" — Thariq Shihipar & Sid Bidasaria
Primary source (Anthropic MTS, Claude Code team) for the Dynamic Workflows feature. This is the canonical playbook behind the secondhand 5/29 AlphaSignal coverage in [[2026-05-29-alphasignal-opus-4-8-dynamic-workflows-effort-control]]. Founder shared it 2026-06-03.
Why this is in the vault
This is the primary-source usage manual for the Workflow tool that is already live in Ray's own session — a capability RDCO holds but hasn't yet fully operationalized, so the playbook is directly actionable for unhobbling the COO agent rather than abstract. It also names the three failure modes (agentic laziness, self-preferential bias, goal drift) that diagnose RDCO's own 2026-05-31 fabrication morning, making Anthropic's orchestrate-separate-Claudes prescription the structural counterpart to the tactical fresh-session + verify-before-assert fixes RDCO already runs ([[feedback_calibrate_overconfidence]]). Filed as the canonical reference behind the secondhand 5/29 AlphaSignal coverage.
The one-line
Claude Code can now write its own JavaScript harness on the fly — spawning and coordinating subagents (each with its own clean context window, model tier, and optional git worktree) — custom-built per task. The default CC harness is built for coding; dynamic workflows let Claude build a bespoke harness for research, review, migration, triage, sorting, evals, etc., natively, and resume if interrupted. Trigger word: "ultracode" (or just "use a workflow").
Why this matters operationally (it's about the Workflow tool I already hold)
The Workflow tool is live in Ray's own session. This article is the usage manual for it. Not abstract — directly actionable for unhobbling the COO agent.
The three named failure modes ARE the 5/31 diagnosis
Thariq names exactly why a single long-running context window degrades — and it is the same root cause documented in the fresh-session handoff and [[feedback_calibrate_overconfidence]]:
- Agentic laziness — stops after partial progress, declares done (e.g. 20 of 50 review items).
- Self-preferential bias — prefers/over-trusts its own outputs when asked to verify or judge them.
- Goal drift — gradual loss of fidelity to the original objective across turns, especially after compaction (lossy summarization drops "don't do X" constraints).
The 2026-05-31 twelve-fabrication morning was goal-drift + self-preferential bias in a weeks-old compacted context. Workflows are the structural fix Anthropic proposes for the same problem RDCO solved tactically (fresh session + verify-before-assert): orchestrate separate Claudes with isolated context windows and focused goals instead of one rotting window.
The pattern library (composable building blocks)
- Classify-and-act — classifier agent routes to different downstream agents by task type.
- Fan-out-and-synthesize — split → run an agent per step → barrier → merge structured outputs. (RDCO already does this by hand via
/process-newsletterbatch + pipeline seats.) - Adversarial verification — for each producing agent, spawn a separate agent to refute its output against a rubric. (= RDCO's
/verify-*fresh-eyes gates, now native.) - Generate-and-filter — generate ideas → filter/dedupe/verify → return only the best.
- Tournament — N agents attempt the same task differently; pairwise judge agents pick a winner. (Comparative judgment > absolute scoring.)
- Loop-until-done — keep spawning until a stop condition (no new findings / no errors), not a fixed pass count.
Workflows can pick model per agent (Sonnet vs Opus routing) and worktree isolation per agent.
Use cases worth an RDCO eval
- Migrations/refactors — one worktree subagent per callsite/test/module, adversarial review, merge. (Bun's Zig→Rust rewrite used this.)
- Deep research — the shipped
/deep-researchskill is a dynamic workflow (fan-out searches → fetch → adversarially verify claims → synthesize cited report). RDCO already has/deep-research. - Deep verification — one agent identifies every factual claim, a subagent sources/checks each, a second verifier grades source quality. (Map onto vault
/cross-check+ strategic-output verification.) - Sorting at scale — don't sort 1000 rows in one prompt; run a pairwise-comparison tournament, each comparison its own agent.
- Memory/rule adherence — one verifier agent per CLAUDE.md rule; add a skeptic persona to suppress false positives. Reverse: mine recent sessions + review comments for recurring corrections, cluster, adversarially verify ("would this rule have prevented a real mistake?"), distill survivors into CLAUDE.md. (=
/improve+/self-review, validated.) - Triage at scale — classify → dedupe vs tracked → act or escalate. Quarantine pattern: agents reading untrusted public content are barred from high-privilege actions (those go to separate acting agents). This is the native encoding of [[feedback_listen_and_injection_caution]]. Pair with
/loopfor continuous triage — exactly RDCO's/check-board//process-inboxcron shape. - Exploration/taste, evals, model routing — rubric-driven review agents; lightweight eval harnesses in worktrees.
When NOT to use (the cost caveat)
Workflows use significantly more tokens. Not for every task. "Most traditional coding tasks do not need a panel of 5 reviewers." Set explicit budgets by prompting "use 10k tokens". Pair with /goal (hard completion requirement) and /loop (interval re-runs). Save with "s" in the workflow menu → ~/.claude/workflows/ or distribute via a skill (reference the JS files in SKILL.md, treat as templates not verbatim scripts).
Mapping against Ray Data Co
The pattern library above maps almost one-to-one onto RDCO's existing hand-rolled harness: fan-out-and-synthesize = the /process-newsletter batch + the pipeline-* seats; adversarial verification = the /verify-* fresh-eyes gates; loop-until-done = /loop cron triage; deep-research = the already-shipped /deep-research skill; and the quarantine pattern is the native encoding of [[feedback_listen_and_injection_caution]]. The load-bearing open question is whether the dynamic Workflow tool should subsume RDCO's static pipeline-spec/-test/-code/-critic seats for larger builds — keeping the "no slop cannon" production-mode gate bolted on. That and the other concrete landings are tracked as action items below.
RDCO action items (candidates, not yet decided)
- Static → dynamic migration question: RDCO's
pipeline-spec-author/-test-author/-code-author/-criticseats are the static workflow Thariq contrasts against. Eval whether the dynamic Workflow tool subsumes the hand-rolled seats for larger builds (backtest harness, graph re-ingest) — but keep the "no slop cannon" / production-mode fresh-eyes gate bolted on; don't adopt blindly. (Open question carried from the 5/29 note.) - Quarantine pattern is a cleaner, structural implementation of the prompt-injection-caution rule for any future triage workflow that reads founder-pasted/external content.
/improve+/self-reviewvalidation — Anthropic independently describes RDCO's exact session-mining → CLAUDE.md-rule loop. Reinforces, doesn't change.- Verdict for founder: read + file (done). Primary-source playbook for a tool RDCO already runs on.
Related
- [[2026-05-29-alphasignal-opus-4-8-dynamic-workflows-effort-control]] (secondhand coverage of same launch)
- [[2026-04-15-thariq-claude-code-session-management-1m-context]] (Thariq, prior — context-rot / 1M context; basis for CLAUDE.md rule 4)
- [[2026-05-08-thariq-unreasonable-effectiveness-html]] (Thariq, prior)
- [[2026-05-18-agentway-harness-engineering-claude-code-design-guide]] (harness-engineering design guide, prompt-precedence basis)
- [[2026-04-11-garry-tan-thin-harness-fat-skills]] (thin-harness/fat-skills — the
/improvelineage) - [[feedback_calibrate_overconfidence]] (the 5/31 fabrication incidents the three failure modes diagnose)