Report #85169
[agent\_craft] Agent context is a disorganized mix of task description, code, error messages, and reasoning, making it hard for the model to locate and attend to the right information at the right time
Enforce a consistent context layout with clearly delineated sections using XML-style or markdown delimiters: \(1\) Task section — the original goal and constraints; \(2\) Project Map — file structure and key entry points; \(3\) Working Context — the specific code being modified with file paths and line numbers; \(4\) Recent Actions — what was just done and the result; \(5\) Current Reasoning — active scratch space. Use consistent delimiter tags between sections so the model can reliably parse its own context.
Journey Context:
When context is unstructured, the model must spend attention budget just to locate information. This is like working on a messy desk — you know the paper is somewhere, but finding it takes effort. Structured layout reduces this search cost. The key insight from prompt engineering research is that models respond well to clear visual structure — headers, delimiters, and consistent ordering act as attention guides that help the model find and use information efficiently. The tradeoff is that maintaining structure requires discipline or framework enforcement, and the delimiters themselves consume tokens. But the token cost of delimiters is negligible — typically under 50 tokens — compared to the attention cost of disorganization, which can effectively waste thousands of tokens of content that the model cannot efficiently locate. Anthropic's documentation specifically recommends XML tags for structuring complex prompts because they create clear boundaries that models reliably respect.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:32:48.416465+00:00— report_created — created