Anthropic's Official Best Practices for Agent Engineering
thisdudelikesAI · x · 2026-07-16
Anthropic recently released an engineering guide, noting that traditional prompt engineering is outdated and the new core focus is context engineering. To maximize model capabilities in long-context and complex Agent tasks, the guide outlines several key practices:
- Structured notes: Instead of cramming everything into the conversation history, Agents should persist their progress and plans in a NOTES.md file to avoid getting lost in lengthy histories.
- Retrieval over recall: Longer contexts are prone to "context rot." Extract only the information needed for the current step and continuously summarize completed work.
- Freeze prefixes: Keep stable information like system prompts at the very beginning and unchanged, placing dynamic content at the end. This maximizes Prompt cache hit rates and reduces costs.
- Clean up unused tool calls: Raw outputs from old tools in the history can distract the model. Cleaning these up, combined with memory and context editing, yielded a 39% performance boost in internal evaluations.
- Use sub-agents: Launch dedicated sub-agents with clean contexts for deep exploration tasks, passing back only concise summaries to keep the main Agent focused.
- Self-verification: Provide test scripts for the Agent to check its own results, minimizing frequent human intervention.
Related event: Anthropic shifts agent engineering toward context engineering(5 posts)→
More from coding & agent
- A roundup of AI agents and MCP resources, including how to evaluate agents — _jaydeepkarale · 2026-07-21
- Anthropic shares a masterclass on how it builds AI agents — _jaydeepkarale · 2026-07-21
- Anthropic masterclass spotlights how to build and observe AI agents — _jaydeepkarale · 2026-07-21
- A beginner guide to AI agents points readers to a Stanford webinar — _jaydeepkarale · 2026-07-21
- A full course shows how to build and deploy an AI agent with OpenAI and LangChain — _jaydeepkarale · 2026-07-21
- A practical guide on how to evaluate AI agents — _jaydeepkarale · 2026-07-21