AI WorkflowsFree
Claude Token Optimization
Use when a Claude or Claude Code session is hitting usage limits or you want to cut token consumption. Provides concrete habits to reduce context-reload costs.
Drop the file into ~/.claude/skills/learned-claude-token-optimization/SKILL.md and your agent knows it in every session.
Claude Token Optimization
Core mechanic: Claude re-reads the ENTIRE conversation history (every message, reply, and uploaded file) on every new message before answering. Token cost compounds as the session grows — a message costing 500 tokens early can cost ~10x more by message 30. Reduce what sits in context and how often it reloads.
The 5 habits
- Convert PDFs to text/markdown before uploading. Claude charges PDFs twice — it reads the text AND renders every page as an image (1,500–3,000 tokens/page; a 50-page PDF ≈ 150,000 tokens just sitting there). Converting to plain
.txtor.mddrops the same document to a few thousand tokens.
- Batch requests into a single message. Every separate message = a full context reload. Instead of three messages ("summarize this article", "list the main points", "suggest a headline"), combine into one. Same result at ~1/3 the token cost.
- Keep CLAUDE.md under 500 tokens (Claude Code). The file loads automatically and is charged on every turn for the whole session. A 5,000-token CLAUDE.md costs 5,000 tokens before you type anything, every message. Keep it a tight summary of only what Claude actually needs.
- Switch models mid-session with
/model. You can change models without losing context. Use Haiku for quick lookups and simple edits; bump to Sonnet/Opus only for heavy lifting. Haiku costs a fraction of Opus. Author reports this alone cut weekly token use by ~60%.
- Fix errors surgically, never full redos. A full redo regenerates the entire output (output tokens) AND that big output then gets re-read on every subsequent message. Instead, point at the exact part: "Only fix the third paragraph, keep everything else." Same result at ~1/10 the tokens.
Rule of thumb
Before upgrading a plan, audit for these habits first — most limit-hitting is caused by context bloat, not message volume.