From Prompting to Harness Engineering: Lessons for AI Coding Agents
Brief
The article presents three layers for improving agent runs: sharpen single-turn instructions, curate context on each turn, and use tools and checks to prevent repeated failures.
Manage context
- Retrieve files as needed rather than loading entire directories; compact old session history and keep task state in external notes.
- Anthropic’s cited practices also include delegating codebase searches to sub-agents and returning concise summaries.
Build a harness around recurring failures
- Turn repeated mistakes into targeted guidance and programmed verification, such as linters, tests, screenshot scripts, and filtered test runners.
- OpenAI’s team reduced AGENTS.md to about 100 lines and used structured documentation, custom linters, and scheduled cleanup tasks.
Choose the right layer
- The article’s rule of thumb: correct a one-off slip in chat; if the agent repeats the same failure, add a permanent harness check.
- Use engineering effort proportionate to the task rather than building elaborate checks for a throwaway script.
Generated by AI from the original article. Check the source for full details.