Wing Tips: Best Practices for Working with the Claude Code Agent in Wing Pro 12

Jul 10, 2026


This is the closing Wing Tip in the series on Wing Pro 12's Claude Code agent integration. It collects the habits that produce reliable results.

Basic Principles

The fact that AI agents work at all is astonishing, given that the LLMs that underly them are (famously) so good at hallucinating and making other mistakes. The reason they work is that they build in self-checking feedback loops for every level of the software development process.

Your methodology in using them should embrace and build on this basic philosophy of cross-checking everything. There are two parts to this:

  • Work in an environment where mistakes are contained and correctable.
  • Recheck and review all work before accepting or shipping it.

AI Safety

AI safety in Claude Code is very very good out of the box. But like people, it can make mistakes and when it does, it makes them very very quickly.

In order for its work to be contained and correctable, you need to set up a reasonably protected environment in a VM, on a dedicated host, or at least in a dedicated account. Don't run Claude Code in an environment where it has access to the keys to your server infrastructure or sensitive data like customer records.

  • Make sure your environment is backed up automatically, ideally continuously through something like Dropbox or iCloud.
  • Use revision control with a remote repository that Claude cannot access. Ideally, set up a VCS-only SSH key and do all push or other operations that affect the remote repository manually.

Exactly how you approach this depends on your needs and risk tolerance, and the sensitivity of your work. In fact asking Claude Code for solutions is a great way to find relatively easy ways to set up an environment you are comfortable with.

Treat the Agent Like a Capable Employee

The agent is fast, patient, and capable, but still needs clear instructions and supervision. For the most part, you will no longer be writing code; instead, it's your job to frame tasks, review outcomes, and steer iteration.

Your goal should be to set up a working environment that keeps it honest. That starts with clear, detailed, and specific instructions. It includes unit testing. It may include independent AI agent validation of work for correctness, performance, security, and other metrics.

Cross-Check from Different Angles

A single review pass can miss things on larger changes. That's true whether it's a human working independently, or an AI agent writing the code. Instead, where appropriate, try to run work through a few different lenses:

  • Behavioral -- does this code really do everything in the spec?
  • End Cases -- does this code fail to handle end cases that could occur?
  • Security -- are the security flaws likely to be exploited here?
  • Performance -- is this code going to be fast enough in production?

Since you can make the AI agent do the assessments, it becomes possible to review code in far more ways and far more deeply than was possible before the advent of AI agents. You can ask the agent to do things that no human employee would put up with:

"Re-read the change you just made and propose the three most likely sources of bugs. Don't fix anything; just list them."

Wing packages several of these lenses as one-click Code Actions in the editor's right-click menu -- Review for Security Risks, Review for Code Quality, and Optimize Code -- each of which frames the request for you.

Review at the Behavior Level

Wing presents agent edits as diffs, which makes it tempting to review line by line. For small changes that's fine. For larger ones:

  • Read the task summary and the test results first.
  • Skim the diff for surprises -- new dependencies, new files, scope creep, suspicious patterns.
  • Spot-check a few hunks to confirm the agent's style.
  • Trust the rest, contingent on tests and other cross-checks passing.

If you don't trust the test suite enough to do this, strengthen the suite first. The good news is, you just ask Claude Code to do that.

Hopefully you're getting the idea: You're the insufferable manager, and Claude Code provides you with a swarm of willing and extremely capable workers. Your life will never be the same -- in a good way!

When the Agent Gets Stuck

Most of the time you don't need to watch the details of what the agent is doing. But occasionally, especially on a hard bug, Claude Code will start spinning its wheels -- trying one speculative fix after another, fixating on an approach that isn't working, or even brushing off your reports that something is still broken.

When you notice this, step in once or twice with more specific guidance, or point it at the debugger. When you hit an exception yourself, the FIX action in the Exceptions tool hands it to the agent with the full debug context. If that doesn't turn things around, don't keep iterating. It is usually better to start fresh than to try to course-correct an agent that has gone off the rails.

Before you do, look for any unwanted or half-finished code the agent left behind, and either ask it to remove that or revert to your last known-good commit. Then /clear to start a new session, or start a new task from the Tasks tool. A fresh session has no memory of the origin or correctness of uncommitted code, so if you leave a broken attempt in place it may assume that code is intentional and fixate on the same wrong solution. Retrying the fix in Plan Mode can help too, since it makes the agent reason through a new approach before changing anything.

Understanding Context and Token Costs

Claude Code uses both its already-learned knowledge about the software development process, from its original training set, and also facts it has learned about your development environment and project. When you first set up Claude Code in a directory, Wing runs /init to ask Claude to inspect and learn from the files on disk. This gets distilled into the top-level CLAUDE.md, terse documentation that is designed for the AI agent to read automatically when it works on your code subsequently. It will even maintain the document on its own, as code changes.

Wing also writes instructions for Claude, into .claude/CLAUDE.md, so it knows how to use Wing's functionality and an appropriate testing and review methodology.

All of this is combined with input seen in the current Claude Code session into a working context that is essentially a short-term memory. Every time you start a new session, Claude forgets everything, and then reloads some of the memories from the CLAUDE.md files.

This is a simplification of everything Claude Code does, but enough to be able to manage what really matters here -- token use. The more Claude Code has in its memory, and the more it has to read through while doing tasks, the more tokens it uses up out of your allowance. Keeping that under control is an important part of using AI agents.

Fortunately, Wing helps a lot with that. We've designed the Tasks tool and the MCP servers that Claude can use to keep token consumption lower. In our initial benchmarks this often meaningfully reduced the API cost and time to finish a task, though how much depends on the work -- the tools help most when the bottleneck is locating code or runtime state. See the benchmark write-up for the details.

The decision you will have to make is when to either manually type /clear in your Claude Code instance, or when to use the Q menu in the Tasks tool to change the session reuse and run modes (as discussed in previous Wing Tip) to use context when relevant and discard it when not.

Further Reading

Wing's Claude Code integration is deep and powerful, but should be usable also if you don't fully understand it. When in doubt, ask Claude Code!

See also Wing's Claude Code Agent Integration and AI Agent-Assisted Development in Wing's documentation.



That's it for the AI agent series! We'll be back soon with more Wing Tips for using Wing in everyday Python development.

As always, please don't hesitate to email support@wingware.com if you run into problems or have any questions.