Skip to content

How to Reduce Claude Code Token Usage: 7 Proven Strategies

Problem

I was using Claude Code to remove a currency symbol from a few files. Simple task, right? But when I checked my usage afterward, I saw this:

Claude Code usage after simple task
Task: Remove $ symbol from 3 files
Usage: 9% of Max $100 session

Nine percent of a Max session for removing currency symbols? That felt wrong. I was burning through my session limit way too fast for trivial work.

I started investigating why Claude Code was consuming so many tokens, and I found several strategies that actually work.

What I discovered

I checked a Reddit thread about Claude Code limits, and users were reporting similar issues:

User reports from Reddit
"9% of a Max $100 session used for a simple currency symbol removal task"
"My session ran out after just a few file edits"
"The displayed usage doesn't match what I expected"

One user shared advice they got from Claude itself about minimizing token usage:

Claude's own optimization advice
"Minimize tool calls. Don't re-read files you've already read this session.
Don't read files for context unless I explicitly ask.
Work from what's already in the conversation.
Batch all changes into as few operations as possible."

This helped users “claw back a significant portion of the overusage.”

So I tested these strategies myself.

Strategy 1: Constrain context gathering in CLAUDE.md

Claude Code’s default behavior is to aggressively gather context. It reads files, searches for patterns, and explores the codebase even when you don’t ask it to.

I added explicit rules to my CLAUDE.md file:

CLAUDE.md context rules
## Context Rules
- Minimize tool calls
- Never re-read files already in this session
- Only read files when explicitly asked
- Work from existing conversation context
- Batch all changes into minimal operations

This single change made Claude Code much more conservative about reading files. Instead of exploring the entire codebase for context, it now asks me when it needs more information.

Strategy 2: Enable LSP plugins

Another user mentioned this tip:

Reddit user recommendation
"For programming, you should absolutely use the LSP plugins for the languages
of your project. This saves a lot of tokens and makes everything much faster."

LSP (Language Server Protocol) provides intelligent code navigation without needing to read entire files:

What LSP provides
- Go to definition without full file reads
- Find references efficiently
- Autocomplete and IntelliSense
- Type information on hover

This means Claude Code can understand your code structure without reading every file. I enabled LSP for my main languages:

Claude Code LSP configuration
{
"lsp": {
"enabled": true,
"languages": ["typescript", "python", "go"]
}
}

Strategy 3: Batch operations

I used to make many small edits in sequence. That’s inefficient because each edit triggers context processing.

Inefficient approach
1. Read file A
2. Edit line 1
3. Edit line 5
4. Edit line 10
Result: Multiple context processes, more tokens used

Now I batch everything:

Efficient approach
1. Read file A once
2. Apply all edits in a single operation
Result: One context process, fewer tokens

Strategy 4: Use the rtk tool

A user recommended the rtk tool for token reduction:

rtk recommendation
"I suggest you to install rtk to reduce token usage.
I am trying and results are good"

rtk is available at https://github.com/rtk-ai/rtk. It helps optimize your prompts and reduce unnecessary context.

Strategy 5: Write tighter prompts

I realized my prompts were often too open-ended:

Inefficient prompt
"Can you look at the users API and add email validation?
Check the patterns we use elsewhere in the codebase and
make sure it's consistent."

This triggers Claude Code to explore the entire codebase for patterns. Now I use focused prompts:

Efficient prompt
"Edit src/api/users.ts to add email validation.
Use the existing patterns in that file.
Don't read any additional files."

The difference is clear:

  • First prompt: Claude reads multiple files, searches for patterns
  • Second prompt: Claude reads one file, makes the change

Strategy 6: Session management

I learned to manage my sessions better:

Session management tips
- Use /compact to reduce context bloat periodically
- Start fresh sessions for unrelated tasks
- Monitor actual usage vs displayed usage
- Don't keep conversations running forever

The /compact command is particularly useful for long sessions. It summarizes the conversation history, reducing the context window size.

Strategy 7: Optimize your CLAUDE.md structure

I restructured my CLAUDE.md to be cleaner:

Optimized CLAUDE.md structure
# Project Instructions
## Context Gathering Rules
- Minimize tool calls aggressively
- Never re-read files already in context
- Only fetch additional context when explicitly asked
- Work from existing conversation knowledge
- Batch all file changes into single operations
## Code Style
- [Brief, focused style preferences]
## Project Structure
- [Minimal structure notes - not the entire codebase map]

The key is keeping it focused. A bloated CLAUDE.md with too many instructions can actually increase token usage because Claude processes it on every message.

Results

After applying these strategies, my token usage dropped significantly:

Before and after comparison
Before:
- Simple file edit: 9% of session
- Multiple file changes: 15-20% of session
- Long coding session: Ran out of tokens quickly
After:
- Simple file edit: 3-4% of session
- Multiple file changes: 6-8% of session
- Long coding session: Much more usable time

That’s roughly a 50-60% reduction in token usage.

Summary

Claude Code consumes tokens quickly because it aggressively gathers context by default. The key strategies to reduce usage are:

  1. Add explicit constraints to CLAUDE.md - Tell Claude to minimize context gathering
  2. Enable LSP plugins - Let the language server provide code intelligence
  3. Batch operations - Combine multiple edits into single operations
  4. Use rtk tool - External tool for prompt optimization
  5. Write focused prompts - Avoid open-ended “explore the codebase” requests
  6. Manage sessions - Use /compact and start fresh when appropriate
  7. Optimize CLAUDE.md - Keep it focused, not bloated

The most impactful change for me was adding context constraints to CLAUDE.md. That single change made Claude Code much more efficient without sacrificing usefulness.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments