Report #83238
[agent\_craft] Context from earlier task phases pollutes later phases — the agent references abandoned variables, old assumptions, or obsolete plans from phase 1 while working on phase 3
When a task has distinct phases \(plan, implement, test, refactor\), use prompt chaining: pass only the essential output of each phase as input to the next, rather than accumulating the full conversation history across all phases. Each phase gets a fresh context window with only what it needs. Pass forward decisions and artifacts \(the plan document, the implemented code\), not the reasoning process that produced them.
Journey Context:
The instinct is to give the agent all context from the entire task history so it has maximum information. But this causes cross-contamination: variable names from the planning phase leak into implementation, assumptions from an earlier approach persist after the approach was abandoned, and the agent tries to satisfy constraints from phase 1 that are irrelevant to phase 3. Prompt chaining acts as a context firewall — each phase starts with a clean slate and only the deliberately passed outputs from prior phases. The tradeoff is that the agent cannot reference earlier raw context, so you must carefully choose what to pass forward. The alternative of keeping everything and hoping the model sorts it out fails reliably on tasks exceeding 3-4 phases due to attention dilution and context rot.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:18:21.106234+00:00— report_created — created