When an agent can write code, it gains more than a new output format: it can turn vague intent into a deterministic process.
The endpoint of code generation is not “looks correct,” but a real execution that is repeatable, verifiable and reversible.
01 / CODING LOOPSearch first, edit next, verify last
Reliable work begins by understanding the environment: locate related files, read conventions, form a minimal change plan, then edit and test. Generating before searching most often produces an answer disconnected from the existing system. The loop has four parts: search for entry points, dependencies, conventions and the real failure; edit a minimal reviewable boundary; execute a build, test or small experiment for feedback; verify the final state the user actually cares about rather than an exit code alone.
02 / HARNESSBeyond the model, the harness decides whether work can last
Session state, file access, command timeouts, truncated output, patch application and recovery are harness work. Sessionless design also means task state does not depend on a permanently running process and can be recovered from records. Limit working directories, command range, credentials and network access; leave human confirmation before high-risk actions.
03 / PRACTICECode is a thinking tool and a system adapter
A model can use a short program to verify a calculation, clean material, express business rules or generate an interactive interface. Code turns ambiguous natural-language relations into running constraints and adapts quickly to a system with no dedicated tool. Write complex calculations as programs and test boundaries. Make business rules testable functions rather than prompt text. Use code to connect data formats, APIs and legacy systems. Generated UI still needs accessibility, security and real-data checks.
04 / RECOVERYRecovery matters more than writing it right the first time
A production agent must recognize compilation errors, failed tests, permission problems and environment differences, then choose retry, another approach or a stop. Repeated failure must trigger fallback or help, not endless rewriting. First exercise: ask a coding agent to change one small feature, require it to locate files first, submit a minimal patch, run tests, then verify the real page or output state. The endpoint is not “looks correct” but a repeatable, verifiable and reversible execution.
Sources
- bojieli/ai-agent-book.
- Chapter 5 — Coding Agents.
- This is an applied reorganization, not a replacement for the source book; use the source text and code for exact claims.

READER COMMENTS
Leave the thought this article gave you.
No comments yet. You can leave the first one.