ANI

7 Effective Ways to Reduce Claude Code Token Usage

# Introduction

Claude's code is really useful, but it can get expensive much faster than people expect. The reason is simple. You only pay for the order you just wrote. In most cases, Claude carries the remainder of the session with it such as previous messages, previously read files, tool results, memory files such as CLAUDE.mdand other background instructions. So when the use of tokens starts to increase, the real problem is usually not the discipline. It is a dirty context.

Most of the general advice on this topic is not very helpful. “Keep conversations short” is true, but it doesn't tell you what really moves the needle. What really helps is understanding how Claude Code builds context, what gets annoying, and what parts of your workflow add up to quiet garbage over time. In this article, we will take a look 7 practical ways to help you use Claude Code successfully without ever having to worry about the cost. So, let's begin.

# 1. Changing Models for Task Complexity

This one is simple but very little used. Not every job requires your expensive setup. In API billing, Opus costs 5 times more than Sonnet per token. In subscription plans, heavy models pull your share window faster.

/model sonnet    # Day-to-day: writing tests, simple edits,
                 # explaining code, refactoring
/model opus      # Complex: multi-file architecture decisions,
                 # debugging gnarly cross-system issues
/model haiku     # Quick: lookups, formatting, renaming,
                 # anything repetitive

Start every time in the Sonnet. Switch to Opus only if you really need an in-depth analysis or complex reconstruction. Go down to Haiku to get the machine stuff. You can also control the effort level directly with /effort. For direct tasks, reducing the effort level reduces the reasoning budget provided by the model, which directly saves output tokens.

# 2. Keeping CLAUDE.md Small and Useful

One of the best ways to save tokens is to stop retyping the same project rules in every conversation. That's exactly it CLAUDE.md it belongs to. It loads before Claude reads your code, before it reads your work, before anything. It persists in the window's content for the entire session and does not lag or exit. This means 5,000 tokens CLAUDE.md it costs 5,000 tokens per turn, whether you send 2 or 200 messages. So, put your stable guidelines in there: how to run tests, which package manager to use, your formatting rules, important architectural constraints, and documents that Claude should avoid touching. This reduces repeated information at all times.

Another important part is keeping it strong. Do not attach meeting notes, design history, or lengthy user guides to it. You will get the best results if CLAUDE.md it works more like a lookup table than a giant brain dump.

# 3. Delegation of Verbose Work to Subagents

This is one of the most useful tips because it changes the way the context grows. Subagents are individual Claude instances that run in their own context window. When the subagent is running, all verbose output – file searches, log dumps, multi-step reasoning – remains the same. It's just a summary that goes back to your main conversation. This can keep your main thread very clean. But this is also where a lot of conventional advice goes wrong. Subagents are not automatically cheap. Community testing shows that for small tasks, especially simple shell actions or quick git tasks, subagent can be a waste because the architecture itself adds overhead by using information, tool definitions, and additional tool call trips. So the rule of thumb is not to “use subagents for everything.” It says “use subagents when the storage clutter of the main content is more expensive than the original title.”

# 4. Pointing Claude to Direct Files and Line Categories

One of the fastest ways to waste tokens is to ask Claude to “look around the repo” when the problem resides in one or two files. When the task is unclear, Claude is more likely to spend tokens opening several files, checking for dead ends, and reconstructing the context that you could directly provide. Here is an example.

Original:

“Check the auth code and tell me what's wrong.”

Better:

“Compare src/auth/session.ts line 30 to 90 with src/api/login.ts line 10 to 60 and explain the discrepancy.”

The first one sounds natural, but it often leads to expensive experiments.

Another tip is use program mode before running expensive. Change it Shift+Tab. In program mode, Claude pulls out the program step by step without making any changes. You review the program, cut anything unnecessary, and return to normal mode. This eliminates the biggest source of token waste: the use of trial and error, where Claude tries things out, makes mistakes, and iterates – with tokens costing each iteration.

# 5. Consistency / Consistency Continuously (Not Continuously)

Claude can automatically merge your session, and you're good to go /compact on your own. But time is more important than people think.

By the time Claude has checked a lot of files, run commands, and tested a few false leads, your session usually contains a lot of stuff that doesn't matter anymore. That is the right time to combine. Instead of carrying all that extra context to the next step, you narrow down the conversation when the important parts are clear, and move on to a much simpler session.

A common mistake is to use /compact late. Most developers wait until Claude starts forgetting things or displays a context warning. At that point, the session is already overloaded, and the snapshot is neither clean nor useful. If you merge earlier, while the session is “alive,” the snapshot is better. You retain key information, reduce noise, and avoid pulling unnecessary tokens in every step ahead.

# 6. Checking/Context Before Doing Preparation

One of the most underrated ideas is just looking at what is eating the context. A lot of token waste feels confusing until you remember that the expensive part may not be the visible information. It could be a large file that Claude read before, a generated tool stack, a heavy memory file, or a total of additional tools.

I /context command is your diagnostic tool. Before changing your entire workflow, look at what is actually being uploaded or resubmitted. In most cases, big improvements don't come from better requests. It comes from seeing the “silent criminal” who was always riding. That's why it's better not to multiply blindly. First, check what's in your context. Then eliminate or reduce the components that actually cause constipation.

# 7. Keeping Your Tool Setup Simple

Claude Code it can connect to many external tools and data sources, which is powerful – but using more connected tools can also mean more context when those tools start working. If too many tools or assistants are involved, the model can end up dragging on more than the work it really needs. Keep your setup minimal. Use integration that solves a real iterative problem. Don't load Claude Code with all the skills available because you can't.

# Final thoughts

The best way to reduce Claude Code token usage is not to child-guard every instruction. It's designing your workflow so that Claude sees only what he really needs. The biggest wins come from automatic content management, narrowing search scope, and preventing noisy side work from polluting the main session.

Stop thinking only about information and start thinking about context.

Kanwal Mehreen is a machine learning engineer and technical writer with a deep passion for data science and the intersection of AI and medicine. He co-authored the ebook “Increasing Productivity with ChatGPT”. As a Google Generation Scholar 2022 for APAC, he strives for diversity and academic excellence. He has also been recognized as a Teradata Diversity in Tech Scholar, a Mitacs Globalink Research Scholar, and a Harvard WeCode Scholar. Kanwal is a passionate advocate for change, having founded FEMCodes to empower women in STEM fields.

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button