Across the first six chapters you chose your tools, set up Claude Code, learned to ask well, worked your way out of stuck spots, and even picked up extensions. The last topic that remains ― and one you cannot avoid over the long run ― is "cost and efficiency." With AI coding, the more you use it, the more you run into the realities of pricing and usage limits. This chapter pulls together, from a practical standpoint, how tokens and pricing work, how to get along with usage limits, and how to get the same results for less. This is the final chapter of the course.
The goal: keep AI as your partner efficiently, for the long haul
Why cost management matters
AI coding tools are not free and infinite to use. Behind the scenes, a massive language model processes each of your requests, and that computation carries a real cost. That's why fixed monthly plans cap "how much you can use," and pay-as-you-go APIs rack up charges in proportion to what you use.
The key point here is not "hold back on AI to save money." The aim is the opposite: to produce the same, or better, results for less. Use it without understanding how it works, and you invite wasted spending ― or the situation where you "hit the limit and grind to a halt at the worst moment." Understand how it works, and you can make the most of a limited allowance and keep AI as your partner for the long haul.
You keep dragging a huge history into every message, and before you know it the bill has ballooned. Right before a deadline, you hit the limit and can't lift a finger.
You pass only the information that's needed and dial your effort to the task. You get twice the work out of the same allowance, and you spend your limit on purpose.
How tokens and pricing work
The first step to understanding cost is the "token." A token is the smallest unit the AI uses to process text. Words and symbols get broken into a handful of tokens, and the AI reads and writes in these units. As a rough mental model, in English one word is roughly one to two tokens; that's enough to work with.
Pricing is determined by the number of tokens. The important thing is that billing splits into two kinds: "input" and "output."
Your instructions, plus every file that gets read, the conversation history so far, and the system settings. AI agents read large amounts of code, so input tends to balloon.
The explanations, code, and diffs the AI generates. Output tokens are generally priced higher per unit than input. The longer the answer, the more it costs.
One thing that's easy to overlook is that "the bigger the context, the more it costs." As a conversation drags on, the AI re-reads the entire exchange so far as input every time. In other words, the more the history swells, the more input tokens ride on each exchange ― so the same question grows pricier the later in the conversation you ask it.
💡 Get to know the "context window," too. There's an upper limit on how many tokens the AI can handle at once, and this is called the context window. Older information that doesn't fit gets forgotten. So "hanging on to irrelevant history" is a loss on both the cost and the accuracy front. For details, see What is a context window.
Exact per-unit rates and per-model pricing can be revised. For the latest ballpark figures and concrete ways to save, see How to save on AI token costs and A guide to optimizing AI coding costs. Here it's enough to hold on to the principle that "you're billed on input plus output token volume, and the longer the history, the more it costs."
Usage limits ― understanding rate limits
When you use an AI coding tool on a fixed-price plan, what you run into before the pricing itself is the usage limit (rate limit). There's an allowance for "how much you can use within a given time span or period," and once you exceed it, you're temporarily locked out. Limits mainly come in two time frames.
An allowance divided into fixed time slots. Even if you use it up, once the window rolls over you can use it again. You tend to hit this when you run heavy work in a short, concentrated burst.
A bigger, aggregate cap managed on a weekly basis. It's a safety valve for heavy users. Overspend in the first half of the week and you'll feel it in the second half, so pacing is key.
What matters most when you hit a limit is "don't panic." In most cases, the limit resets once time passes. Check the displayed "time until reset," and until then it's the smart move to shift to lighter work ― design, review, and other steps that don't lean on AI much. For concrete steps on what to do when you hit a limit, see What to do about "usage limit reached".
⚠️ Don't judge the reset timing by assumption. Even when you feel "it must have recovered by now," the actual allowance may still be empty, or it may reset earlier or later than you expect. Checking the display for real is the sure way. We've pulled together real examples and verification of this behavior in Investigating the weekly limit resetting earlier than expected.
The limits themselves, like the pricing, change by plan and over time. So what you should remember isn't "specific numbers" but the way to get along with them: "there's a short window and a long window; exceed them and they come back if you wait ― so pace yourself in advance." The effort settings and cost-optimization tips explained next are also means of making that allowance last longer.
Adjusting depth with effort
What sways cost the most is "how much thinking you have the AI do on a single task." The deeper the AI reasons, the more likely it is to produce a good answer ― but thinking uses tokens too, so cost and time go up. The right answer here is not "always full power." Go deep only on hard tasks and keep it light on easy ones ― this balance is the single biggest trick to cutting waste.
This "depth of thinking" can be adjusted in many tools as effort. Think of it like the heat when cooking: high heat for a stew, low heat for a quick blanch ― you match the setting to the job.
Fixing typos, simple find-and-replace, boilerplate additions ― no need to make it think hard. Lower the effort and it's done faster and cheaper.
Design, tracking down complex bugs, large structural changes ― these are worth making it think deeply. Skimp here and you pay more later in rework.
When you can't decide, try a middle setting and adjust up or down based on the result. Toss it out light first and raise it if that's not enough ― that's the safe route.
📊 The concrete controls for the effort setting vary in name and number of levels depending on the tool and version. How to set it in Claude Code, what each level means, and real examples of when to use which are explained in detail in Claude Code's effort setting. The smart way to use it is not "always the highest setting" but raising and lowering it to match the task.
Tips for cutting cost and working efficiently
Building on the mechanics so far, here are practical tips that pay off right away in day-to-day work. None of them are about "holding back" ― they're about "cutting waste." The more you combine them, the more you get done within the same allowance.
Show only the relevant files. Don't have it read the entire project wholesale. The less information you hand over, the cheaper, faster, and more accurate it gets.
Use a lightweight, low-cost model for light work, and switch to a high-performance model only for the hard parts. Just not running everything on the top tier makes a big difference.
If you repeatedly use the same premise (long instructions or specs), reusing it via prompt caching can hold down input cost from the second time onward.
Don't throw a big request in one shot; split it small and go in order. If something fails, the impact is small and the redo costs fewer tokens.
When the topic changes, reset the conversation or compact it down to the essentials (the /compact mindset). Not carrying unnecessary history pays off.
Specify the form you want, like "no explanation, just the code." Output tokens are priced higher, so preventing verbose answers pays off.
✅ What works is matching "how much you send, how much you get back, and how deep it thinks" to the situation. The essence of saving is simply tuning these three to a size that fits the weight of the task. Spend freely on the hard parts and trim on the light ones. More detailed steps and a checklist are gathered in A guide to optimizing AI coding costs.
Incidentally, many of the common errors covered in Chapter 5 also, in fact, often arise from cramming in too much context. Narrowing the information is a cost cut and at the same time ties directly to better accuracy ― keep this double benefit in mind.
Keeping it up for the long haul ― closing the course
Well done. With this, you've completed all seven chapters of the "AI Coding in Practice" course. Let's look back one last time over the road you've walked.
You understood the three types of tools, set up Claude Code, and gave your first instruction (Chapters 1–2).
You learned to use Cursor, Copilot, and Codex for different jobs and picked up how to give good instructions (Chapters 3–4).
You worked your way out of errors, expanded your abilities with extensions, and in this chapter gained the means to rein in cost (Chapters 5–7).
The knowledge you've gained here won't stick from reading alone. The best learning comes from actually getting your hands moving. Start by handing one small task to Claude Code. Give the instruction, read the code that comes back, and adjust cost and effort where needed ― it's within that repetition that AI truly becomes your partner.
🚀 The next step is "building your own creation." Now that you've become able to wield the tools, the next question is what you'll create with them. A sister course guides you exactly through what comes next ― taking an idea, giving it form, publishing it, and nurturing it, all in one flow.
- AI coding is billed on input plus output token volume, and the longer the history (context), the more it costs.
- Usage limits come as a short window and a weekly window. Even if you exceed them, they come back if you wait ― so pace yourself without panic.
- With effort, go deep only on the hard parts and light on simple work. Not always going full power is the smart move.
- The core of efficiency is matching "how much you send, how much you get back, and how deep it thinks" to the task. Narrow it down and it gets cheaper ― and more accurate too.
You now hold the ability to use AI coding tools at a professional level. This isn't the finish line ― it's the starting line for your own creative work. Next, why not use that ability to put your own product out into the world?