
Optimizing Claude Code token usage: lessons learned
After a few weeks of heavy Claude Code usage, the bill climbs. Not because tasks are more complex — because sessions get bloated. Claude loads all available context, re-reads the same files every exchange, and CLAUDE.md grows longer with each new rule added. Result: you're paying for useless context, not for actual work. Here are the levers that had the most impact on my project — a PHP portfolio with an automated news monitoring system in Node.js. No magic recipes, just concrete adjustments with real effects. .claudeignore: what Claude should never read By default, Claude Code can index any file in the working directory. On my project that included uploads/ (hundreds of runtime JSON files), .playwright-mcp/ , temporary session plans, and all binary assets. None of these files are useful when debugging a Node.js script. The solution is a .claudeignore at the root, using the same syntax as .gitignore : # Runtime data — useless for coding uploads/ scripts/.retro-state.json scripts/.veill
Continue reading on Dev.to
Opens in a new tab

.png&w=1200&q=75)