Dynamic workflows can consume substantially more usage than a normal session. Use them for problems that are too broad for a single pass—large audits, migrations or profiler-guided investigations—not for a five-line bug fix.
1. Write the global question and the evidence required for a finding to count
Define one system-level question and what counts as evidence before spawning agents. Examples include “why does checkout latency spike after deploys?” with acceptable evidence limited to traces, tests, code paths and dated logs.
2. Ask the workflow to split into independent investigations and adversarial verification roles
Decompose the question by subsystem and add at least one role whose job is to disprove the leading hypothesis. This prevents several agents from reinforcing the same attractive but weak explanation.
3. Set a token or effort budget and define protected files or systems
Set an effort/token budget and name protected files or systems. Exploration can expand rapidly, so a useful workflow has a point at which it must summarize what it knows instead of continuing indefinitely.
4. Let investigators gather evidence first; keep code edits out of the discovery phase
Keep discovery read-only: collect paths, call graphs, logs, tests and contradictory evidence without editing. Separating diagnosis from implementation makes it possible to judge whether the later patch actually follows from the evidence.
5. Review the consolidated findings, choose a subset, then implement and test in a separate bounded step
From the synthesis, choose only the smallest high-confidence implementation candidates. Move those into a separate coding step with normal tests and review rather than letting the research workflow rewrite the whole codebase.
Create a dynamic workflow to investigate [problem] across this repository. Use separate agents for architecture, runtime evidence, tests and adversarial verification. Discovery is read-only. Set a budget of [budget]. Return only findings supported by file references or runtime evidence, then stop before implementation.
Using workflows for trivial tasks; allowing discovery agents to edit overlapping files; no budget; accepting consensus without adversarial checking; implementing every finding in one enormous follow-up patch.
Finish check
The workflow produced a short list of independently checked findings with evidence, usage stayed within the chosen budget, and implementation remains a separate reviewable decision.