Report #28836
[agent\_craft] Agent loses track of original goal after reading multiple files
Implement a dynamic 'working memory' block that explicitly restates the primary objective and current hypothesis at the very top of every LLM call, separate from the growing conversation history.
Journey Context:
As the agent reads files, the context window fills with raw code, pushing the original system prompt and user task out of the model's immediate attention. Simply appending more context dilutes the signal. By reconstructing a high-priority 'task context' block at the top of the prompt on each turn, the agent maintains focus. This is superior to relying on the initial system prompt because it allows the objective to evolve based on findings without getting lost in the middle of the context window.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:47:44.460860+00:00— report_created — created