Guide to AI Tokenomics: Eleven Principles for Token Efficient Software Engineering
Optimizing token consumption is key to keeping AI coding assistants fast and accurate. You might not be writing every line of code any more, but now you’re responsible for directing those coding assistants to focus on getting the most out of each token. Context bloat increases latency and causes models to forget instructions or hallucinate, it also costs money and drives human attention away from the problems that actually matter. Structured habits help you maintain a fast, precise, and productive feedback loop. 1. Start with a balanced model When you are unsure, start with the default Gemini 3.5 Flash (Medium reasoning). Gauge complexity as you go. Scale up to larger models or higher reasoning if a task fails, seems to take too many hops, or needs complex design. 2. Use skills from the beginning Avoid explaining your workflow, testing rules, or environment in every prompt. Ask around, find online, or package your own reusable skills with SKILL.md files and scripts. The agent triggers them automatically, keeping prompts clean and avoiding unnecessarily searching for online docs or inspecting local code and environment. 3. Automate with scripts and CLI tools For repetitive chores like formatting many files or extracting log data, have the agent create simple local tools. Use official CLI tools for setup, linting, and testing. Run read-only commands to research the codebase before writing code, avoiding long trial-and-error loops. 4. Delegate output-heavy tasks Delegate output-heavy tasks, like deep research or separating frontend and backend work, to sub-agents. Once their work is done, you only reconcile the final results, rather than the full trajectory. 5. Divide and conquer David Rensin wrote “Elephants, Goldfish and the New Golden Age of Software Engineering” that explains how to use high-reasoning, long-context sessions (“Elephant”) to generate a detailed execution plan (the “Goldfish”). Execute that plan in a clean, low-token session. Checkpoint your progress often with commits or artifacts so you can restart from a clean state when context fills up. 6. Shift verification left Automate testing early. Run local builds and unit and functional tests before doing UI testing. Tell the agent to perform the expensive smoke-test in the browser right before handoff. Save expensive verification loops for the very end of the milestone. 7. Undo when adrift If the agent drifts and you know the fix, use the Undo button in the trajectory thread or revert your files. Do not pile corrective prompts on top of a broken state, which poisons the context. 8. Be specific with context Be specific rather than micro-managing. A clear instruction with a few spelling errors is better than a grammatically accurate broad request. Similarly, pointing the agent to the exact file, section, or error you care about (with an obvious // SHOULD BE X, NOT Y, FIX THIS annotation) instead of sending it on an open-ended search in a 10k log quest goes a long way. Whenever possible, use inline comments, so the agent knows exactly where you want the fix. 9. Iterate on rules If you keep correcting the agent’s behavior, update your global rules in AGENTS.md or edit the skill. Fix the instructions instead of prompting the agent repeatedly, so the change persists. 10. Avoid uncontrolled loops Supervisor loops that scan projects for pending work can find optimizations, but they can easily burn your entire token budget. If you run loops, set strict limits and stop conditions. High autonomy requires tighter guardrails and better evaluations. Do not let agents poll status in a loop; use event-driven wakeups. 11. Start new sessions for each new topic If you are continuing on the same topic, using the same chat can allow the agent to reuse the existing context, but if you are changing the topic, start a new chat. The agent will be able to provide better answers with fewer tokens if it only pulls in the context that it needs. Prioritize and spend wisely Tokens aren’t infinite. Behind every LLM call is a real, physical machine doing work to produce output for you. Prioritize the projects and features you care about. Token optimization is about directing the AI’s attention. By using a tiered approach you keep development fast and output sharp, while optimizing spending. We hope these 11 principles will inspire you to find the right balance between steering and automation in your AI sessions.
Related articles
Cloudflare WAF protects WordPress applications from two high-severity vulnerabilities
Cloudflare has deployed two WAF rules in response to high-severity vulnerabilities disclosed to us by the WordPress security team. The new rules protect all Cloudflare customers using affected WordPress versions, but customers should still update immediately to a patched release
Eclipse Dataspace Components on AWS: Cost optimization strategies
When you deploy Eclipse Dataspace Components (EDC) connectors on AWS, one of the first challenges you face is predicting and controlling the cost of the required infrastructure. Without clear benchmarks, it is difficult to make informed decisions about workload sizing, environment configuration, and long-term investment. Part 1 of this 3-part blog series covered the fundamentals
Eclipse Dataspace Components on AWS: Architecture patterns in production
Running Eclipse Dataspace Components (EDC) connectors in production on AWS requires deliberate architecture decisions around isolation, managed services, and security layering. In Part 1 of this series, we covered the fundamentals of data space architectures and EDC per the International Data Space Association’s (IDSA) standards. If you are new to EDC, we recommend starting there.