
How I Cut My AI Coding Agent's Token Usage by 65% (Without Changing Models)
I've been using Claude Code on a 200-file TypeScript project. The model is great. The token bill was not. The problem wasn't the model — it was what I was feeding it. Every session, the agent would read 30-40 files trying to orient itself before doing any actual work. Same files, same discoveries, same wasted tokens. Every single time. After a lot of trial and error, I got my average input tokens per query from about 8,200 down to 2,100. Here's what worked, in order of impact. Step 1: Write a real CLAUDE.md (not a vague one) Most people write something like: This is a TypeScript project using Express and React. Please follow best practices. This tells the agent almost nothing. It's going to read your whole codebase anyway. What actually works is being specific about decisions, not descriptions: ## Auth - Auth uses middleware in src/auth/middleware.ts - JWT tokens, not sessions. Refresh token rotation in src/auth/refresh.ts - DO NOT touch src/auth/legacy.ts — deprecated, will be removed
Continue reading on Dev.to
Opens in a new tab


