DEV Community

pabli44
pabli44

Posted on

Are you burning through tokens needlessly while coding with AI?

If you use AI agents for everything, this tip will save you a lot of money and frustration. Many developers make the mistake of letting the agent "try and fail" directly on the code, which spikes token consumption through endless trial-and-error loops.

The key to optimization lies in two features we often overlook: Ask and Plan.

✅ Why use "Ask" first?
Instead of going straight to implementation, use "Ask" mode to agree on a step-by-step strategy. You define the scope and attach only the necessary files. This prevents the AI from hallucinating or modifying files it shouldn't, saving tokens on failed iterations.

✅ The power of "Plan Mode"
If you use AI agents, leverage Plan Mode (often accessible via Shift + Tab in the input field). Let the AI analyze your codebase and draft a detailed plan in a Markdown file before writing a single line of code.

In short:
Implement only when the strategy is clear. AI is an incredible tool, but it's cheaper (and more effective) when you use it as an architect, not just an executor.

Are you already using Plan Mode in your daily workflow, or do you jump straight into the code?



You know, enjoy learning!!

Top comments (0)