Veteran dev shares practical tips to cut AI token costs
A developer with a long background in software shares how to use AI coding tools like Codex without burning through your budget. The main idea: keep requests small and limit what context you hand the AI. Less input means lower bills.
Every time you use an AI coding assistant, you pay based on 'tokens' — the chunks of text the AI reads and writes. The more text you feed it (your question, your code, the conversation history), the higher the cost. This post comes from someone with deep experience who has thought carefully about how on-demand pricing adds up.
The practical advice centers on discipline: break big tasks into small steps, explicitly name only the files the AI needs to see, and reset the conversation context window regularly so old messages don't keep accumulating costs. These habits can significantly reduce spending without sacrificing the quality of results.
Key points
- Break large tasks into small, focused requests to avoid wasting tokens
- Only include the files or code the AI actually needs — don't dump everything in
- Reset the conversation history often to prevent old context from adding up
- On-demand pricing rewards careful, incremental prompting habits
- Explicit file references stop the AI from reading irrelevant code
Quick term guide
- software
- Programs or apps that run on a computer or smartphone.
- AI coding tools
- Programs like Claude, Cursor, or ChatGPT that write code for you when you describe what you want in plain language.
- AI coding tool
- Software that uses AI to help write, edit, or explain code.
- context
- The information an AI uses to understand your request, such as files, notes, and past messages.
- on-demand pricing
- A billing model where you pay only for what you actually use, rather than a flat monthly subscription.
- context window
- The amount of text an AI tool can remember and use in one chat.
- prompting
- Writing instructions or questions to an AI to get a response.
- reference
- Using a source to find information or confirm facts while working.