Tutorial: Getting Reliable Results
Reliable results from an AI agent are more about working method than clever prompts. This chapter goes over the methodology that makes agent-driven development trustworthy.
Treat the Agent Like a Capable Employee
The agent is fast, patient, and capable, but still needs clear instructions and supervision. Your role changes from writing code and to framing tasks, reviewing outcomes, and steering iteration.
That starts with clear, detailed, and specific instructions. A vague request often produces a vague result; a precise request produces work you can verify. When the agent goes off course, the question to ask first is whether your task framing was specific enough.
Cross-Check from Multiple Angles
A single review pass can miss problems in larger changes - whether that pass is human or AI. Where it's worth the time, run work through several lenses:
- Behavioral – does the code do what the spec said?
- End cases – does it fail to handle edge cases that could occur in production?
- Security – are there flaws likely to be exploited?
- Performance – will it be fast enough under realistic load?
You don't have to do all of these by hand. You can ask the agent to write unit tests to verify behaviors and end cases, or to run each kind of review for you.
Try this against the bookmarks app now, in the same Claude Code session you've been using:
Re-read app.py, db.py, and the templates. Propose the three most likely security issues – don't fix anything, just list them.
A Flask app with form handling and raw SQL queries typically has real findings here – SQL-injection vectors via string-formatted queries, missing CSRF protection on the form, template-escaping gaps for user-supplied text. The agent producing those findings about code it just wrote is the point: it's a different lens, applied cheaply.
This kind of agent-on-agent cross-checking is one of the more useful patterns the AI agent paradigm enables. No human reviewer would tolerate being asked to write bug suggestions about their own work, but the agent doesn't mind at all.
Once you have the report, you can decide which issues are worth fixing and queue them as new tasks in the Tasks tool.
Managing Context and Token Cost
The cost of AI is measured in tokens. The agent uses context tokens for everything it knows about your project: The code it has read, the conversation so far, the CLAUDE.md files reloaded each session. More context means more tokens consumed per turn, and you may run into usage limits if you use too many, particularly once you start running concurrent Claude Code instances.
Wing's design helps keep this in check by providing the AI agent with tools that help to reduce its token use while finding and inspecting code, running tests, and solving complex problems where a debugger outperforms logging or other approaches.
Wing's toolset also makes some tasks, like finding code, much faster.
Preliminary benchmarks show roughly half the overall token consumption of using Claude Code standalone, with tasks running about twice as fast on average.
AI agents are very new and Wing's support for them is very much a work in progress. We expect to continuously refine and hone AI agent development in context of the IDE, hopefully with further reductions in token use and time taken for tasks to run. The system is already very usable, but there is much to be done, when it comes to providing AI agents with better ways to do their work.
What's Next
You've now seen the full AI agent integration. The rest of the Tutorial covers Wing's classic features, those which were originally designed for and still useful to human users - project management, the editor, code navigation, search, debugging, refactoring, and version control.
