Simon Willison outlines practical patterns for maximizing the effectiveness of AI coding agents like Claude Code and OpenAI Codex, emphasizing testing, code understanding, and systematic workflows.
The rise of AI coding assistants has fundamentally changed how software gets built. Tools like Claude Code and OpenAI Codex can generate, modify, and explain code at unprecedented speed. But simply having these tools doesn't guarantee better software—you need patterns that work with their strengths while compensating for their weaknesses.
Simon Willison, known for his practical approach to developer tools and technologies, has been documenting what he calls "Agentic Engineering Patterns"—systematic approaches for getting the most out of AI coding agents. His work builds on years of experience with developer tools and a deep understanding of how humans and machines can collaborate effectively.
The Core Philosophy: Writing Code is Cheap Now
The fundamental shift that AI coding agents bring is economic: writing code has become dramatically cheaper in terms of time and effort. This changes the calculus of software development. When code generation is fast and inexpensive, you can afford to be more experimental, more iterative, and more focused on outcomes rather than the mechanics of typing.
This principle manifests in several ways. You can prototype more aggressively, knowing that cleanup is just another prompt away. You can explore multiple approaches to a problem without the sunk cost of manual implementation. You can afford to throw away code that doesn't meet your needs.
But this cheapness comes with a responsibility: you need to be even more disciplined about what code you keep and how you maintain it. The ease of generation makes hoarding code tempting, but the patterns Willison describes help you be selective about what you preserve.
Hoarding What You Know How to Do
When an AI assistant helps you solve a problem, you're not just getting working code—you're gaining knowledge about how to approach similar problems in the future. Willison emphasizes the importance of capturing these learned patterns.
This might mean saving effective prompts, documenting successful approaches, or building a personal library of code snippets and techniques that work well with your AI assistant. The goal is to compound your learning over time, turning one-off successes into reusable patterns.
Think of it as building a personal playbook for working with AI coding agents. What prompts consistently produce good results? What approaches to problem-solving work well when mediated through an AI? What types of explanations help the AI understand your intent?
Testing and QA: The Safety Net
With code generation becoming faster and more accessible, testing becomes even more critical—not less. Willison advocates for Test-Driven Development (TDD) practices, specifically the red/green cycle, as a way to maintain quality while moving quickly.
The pattern is straightforward: write a failing test first, then use your AI assistant to write the code that makes it pass. This ensures that the generated code actually solves the problem you care about, not just code that looks plausible.
Running tests first before making changes is another key pattern. This establishes a baseline of what's working, so you can be confident that any failures after code generation are due to the changes, not pre-existing issues.
Understanding Code: Linear Walkthroughs and Interactive Explanations
One of the most powerful uses of AI coding agents is understanding existing codebases. Willison describes two complementary patterns for this: linear walkthroughs and interactive explanations.
Linear walkthroughs involve having the AI explain code in a systematic, top-to-bottom fashion. This is particularly useful for understanding the overall architecture and flow of a codebase. The AI can provide context for each section, explain why certain decisions were made, and highlight important patterns.
Interactive explanations are more targeted. You can ask specific questions about particular functions, classes, or patterns. This is useful when you need to understand a specific part of the codebase in depth, perhaps to make changes or debug issues.
Annotated Prompts: Teaching the AI About Your Context
Effective use of AI coding agents requires teaching them about your specific context. Willison emphasizes the importance of annotated prompts—prompts that include context about your codebase, your preferences, and your constraints.
This might include information about your coding standards, the architecture patterns you prefer, the libraries and frameworks you use, and the specific requirements of your project. The more context you provide, the better the AI can tailor its output to your needs.
Practical Application: GIF Optimization Tool
To demonstrate these patterns in action, Willison provides an example project: a GIF optimization tool using WebAssembly and Gifsicle. This real-world example shows how the patterns come together in practice.
The project demonstrates how to use AI agents for everything from initial setup and configuration to implementing complex algorithms and optimizing performance. It shows how testing, code understanding, and iterative development work together when you have powerful code generation tools at your disposal.
The Appendix: Prompts I Use
One of the most valuable parts of Willison's work is his collection of effective prompts. These aren't just random queries—they're carefully crafted prompts that consistently produce good results for specific tasks.
This appendix serves as both a practical resource and a teaching tool. By studying these prompts, you can learn how to structure your own requests to get better results from AI coding agents.
The Future of Agentic Engineering
Willison's patterns represent an emerging discipline: the art and science of working effectively with AI coding agents. As these tools continue to evolve and improve, the patterns will likely evolve as well.
What's clear is that the future of software development isn't about replacing human developers with AI, but about finding the right patterns for collaboration. Willison's work provides a foundation for this collaboration, showing how humans and AI can work together to build better software, faster.
The key insight is that AI coding agents are tools that amplify human capability rather than replace it. The patterns Willison describes are about leveraging these tools effectively while maintaining the quality, maintainability, and intentionality that good software requires.
For developers looking to incorporate AI coding agents into their workflow, these patterns provide a practical starting point. They're not theoretical—they're battle-tested approaches that work in real-world development scenarios. As AI coding tools become more prevalent, understanding and applying these patterns will become an essential skill for modern software development.
Comments
Please log in or register to join the discussion