"Token Budget Management: Do More With Less"
2026-06-24 · token optimization context window performance
More tokens isn't always better — curated information usually works better than dumping everything.
What Are Tokens?
Tokens are the smallest units AI processes. Rough estimates: - 1 English word ≈ 1.3 tokens - 1 Chinese character ≈ 2 tokens - 1 line of code ≈ 10-20 tokens
Claude's context window: 200K tokens GPT-4's context window: 128K tokens
Sounds like a lot? It fills up fast.
Why Manage Tokens?
More tokens = more distraction: When context is huge, AI may struggle to find relevant information.
Tokens = money: API calls are billed per token.
Tokens have limits: Exceed the context window and AI "forgets" earlier content.
Suggested Allocation
Experience-based suggestion (not a validated standard):
Task description: 10% (20K tokens)
Relevant code: 40% (80K tokens)
Examples/refs: 20% (40K tokens)
Constraints/rules: 10% (20K tokens)
AI output space: 20% (40K tokens)
Practical Tips
1. Summaries Instead of Full Files
❌ Give AI a 500-line file
✅ Give a 10-line summary + the 50 critical lines
2. Type Signatures Instead of Implementations
❌ Give the entire function implementation
✅ Give the signature and key logic
3. Diffs Instead of Full Files
❌ Give before and after versions of a file
✅ Give only the changed parts
4. Use CLAUDE.md for Persistent Context
# CLAUDE.md
## Project
React + TypeScript e-commerce app
## Stack
- React 18, TypeScript 5
- Zustand, Tailwind CSS
A few hundred tokens that persist across every conversation.
5. Process in Batches
❌ Ask AI to handle 10 files at once
✅ Split into 3 batches of 3-4 files
Tools
| Tool | Purpose | What We Know |
|---|---|---|
| context7 | Latest library docs | Know it exists |
| headroom | Compress tool outputs | Know it exists |
| CLAUDE.md | Persistent project context | We use it, works well |
Common Mistakes
- Too much code — "here's my entire project"
- Too little context — "write a function" with no specs
- Repeating yourself — re-describe project every conversation instead of using CLAUDE.md
Summary
- Curate: Only give what AI needs
- Structure: Use summaries, signatures, diffs
- Persist: Use CLAUDE.md for project context
These are experience-based suggestions. Try different strategies and see what works best for your project.
Token management is a practical topic. If you have better tips, share them on GitHub.