When I use AI to write code, I follow one rule: DO NOT DEBUG.
The agent writes hundreds of lines. The application fails. Now a developer has to trace through code they didn’t write and reconstruct decisions they didn’t make. The agent offers a fix, but the developer still has to work out whether it addresses what went wrong.
That work starts with two questions the team could have asked earlier. What should the software do? What must stay true in the existing system when it does? The answers close the gap between what the developer knows and what they need to know to make the change. The agent can help find those answers before it writes the code.
When those questions stay open, the agent fills in the gaps with assumptions.
Software development is knowledge work. Before changing a system, you must discover what the software should do and what must stay true when it does. If you leave those questions unanswered, the agent doesn’t pause and wait for clarity. It makes assumptions and keeps writing.
The larger the change, the more assumptions you may have to untangle when it fails.
Don’t wait for broken code to tell you what you should have learned first.
Fast Code Creates Slow Rework
AI makes code cheap to produce and uncertainty expensive to untangle.
Fast code generation turns into uncertainty then in slow rework when developers have to reconstruct the agent’s decisions before they can fix a failure.
Did the agent misunderstand the intended behavior, miss a system constraint, or implement the right idea incorrectly? Say an agent adds a discount to checkout, and the total comes out wrong. Did it apply the discount at the wrong step? Did it miss an existing rounding rule? Or did it understand both and make a mistake in the calculation?
The developer has to sort through those possibilities before they can judge the next fix.
The agent can produce a patch in seconds. If that patch fixes the total but breaks refunds, the developer now has two changes to understand and another behavior to verify. That’s where the time goes. Before the team can ship, someone has to work out which decisions were sound and which ones need to be undone.
The code took seconds to generate. Understanding the damage can take much longer.
Discover First, Generate Second
DO NOT put developers in a situation where they’re trying to understand a large change that doesn’t work.
You have two ways to keep that situation from happening.
Make one test-first change. Define what should happen and what the system must preserve, then write a test before asking the agent to implement the change. Suppose a £10 item qualifies for a 10% discount, but checkout still shows £10. Write a test that expects £9. Run it before the agent edits the code and check that it fails because checkout returns £10. Now the agent has a specific result to change and the developer has seen the test catch the gap.
Benefit. The agent can make the change, run the test immediately, and retry against the same expectation. When it passes, the developer reviews the diff while the decisions are still fresh.
Risk. The agent can make the £9 test pass by changing shared checkout logic that refunds also use. If the diff spreads into refunds, stop and find out what that path depends on before accepting the change.
Resolve open questions before generating code. If nobody knows how refunds should handle the discount, ask the agent to trace how refunds calculate the amount today and show you the code and tests behind its answer. Use that evidence to decide what the new behavior should be. Then turn the decision into a test before asking for an implementation.
Benefit. The team can settle questions in plain English before they become assumptions in code. You use the agent to discover how the system works while the developer can still decide what should change.
Risk. Existing code tells you what happens today. If the intended refund policy is unclear, take that specific question to the person who owns it.
These options work together: investigate what you don’t know, turn the decision into a test, and keep the implementation small enough to understand.
The first time you encounter a decision should be before it is buried in a failed change.
Pay for Understanding Early or Pay for Rework Later
You must decide when your team discovers what it needs to know.
The way you structure AI-assisted work determines how much uncertainty developers face and how much work they have to untangle.
If you act now, developers need time to define expected behavior, check relevant constraints, and review each change. Some tasks also need a short investigation before anyone writes a test. That work takes effort before implementation, but it gives the developer and the agent a shared target before implementation begins.
The payoff comes when the test fails. The team has a recent, limited change and an explicit expectation to examine. The agent can try a fix, the developer can review it, and the team can discard the attempt and make the task smaller if the cause remains unclear. Each cycle gives the team an opportunity to learn how the system behaves.
If you do nothing, AI agents can continue producing large changes quickly. Developers then inherit the work of reconstructing the assumptions inside them whenever something breaks. As fixes accumulate, each new failure may involve decisions from several rounds of generated code.
Compare the two workflows on how long it takes developers to locate a failure and how much generated work they have to redo.
You can choose when your team discovers what it needs to know.
You can pay for discovery before the code is written, or pay for it again after the code breaks.
Make that choice before the code fails.
Next Step
Choose one team today and have it define and test the expected behavior for its next small AI-assisted change before the agent writes the implementation.