Is it just me?
This happens to me a lot: I’m thinking deeply on how to translate a business problem into code, or staring at 1000s of lines of SQL trying to figure out why I’m not quite getting the answer I expect when I run it.
So I reach for my trusty AI coding tool of choice and I start to write my prompt.
A good prompt has good context, so I usually start by describing what I'm trying to achieve, my expectations about the outcome, and maybe some examples of the behaviour I'm seeing in the existing code, and how I expect it to behave with the correct solution in place.
And then as I’m explaining the edge cases for the AI to code against, I see it, clear as day, I forgot something obvious in the code.
Often as analysts or engineers we are so deep in the code, on the nth iteration of a solution to squash some pesky bug, that we can be completely blinded to simple solutions. And if we set up our agents to already be buried in the problem by sending them a section of code or pointing them at where we’ve been unable to resolve an issue, sometimes they miss it too.
Sorry if you started reading expecting some hack for free tokens, but I think there’s actually some real value in the process I’m going to describe below, so stick around and you might actually end up saving yourself some tokens!
How to save on tokens & ducks
I sort of think of this as the latest version of rubber duck debugging. If you don’t know, this is where you verbalise a problem to a rubber duck (or any inanimate object or unlucky-enough-to-be-nearby coworker of choice) and through the explaining and very patient listening you have a eureka moment and solve the problem all by yourself.
AI coding tools are constantly improving, and I’m still pretty regularly stunned by what can be achieved by pointing an AI agent at a problem. But typically the work that I’m doing is a little complex, and a lot of the context lives inside my or another stakeholders head, and AI isn’t that good yet.
So a lot of the time I’m using AI in that co-pilot capacity, leaning on it for the simple but time consuming tasks, or extending existing code within a codebase that it can interact with. More and more though, I find myself reaching for it when I’m trying to achieve a specific outcome and want some input for how to approach the problem.
By writing out a really thorough prompt, you can treat the AI as a little robot rubber ducky patiently sitting there and watching you explain how you want it to approach the problem. Usually by about half way through I’ve revised what I’m asking it to do, or I’ve realised that I actually know exactly what to do to solve the problem. Then I can spend $0 in tokens, and just do the work myself now that it's been clarified for me, or I can hit send with a really well crafted prompt that has narrowed in on the specifics of the problem (probably also saving some tokens!)
A slightly more expensive but slightly more useful way to approach this is with Cursor’s Plan Mode. I really like how it asks for clarifying questions, those often lead to that ‘a-ha’ moment. Sometimes I don’t even get it to execute on the plan, I just use the plan as … well … a plan and build it myself. Obviously you can mimic this approach with the tool/model of your choice by prompting for asking clarifying questions too.
So give it a go next time you’re staring at your wallet and regretting all those tab completes, or if you want to experience the joy of solving a problem using your slow old monkey brain once in a while.
