A developer at Tesco shares how he and a colleague built a local code index to drastically reduce AI coding tool costs. They discovered that 90% of AI costs come from input tokens, not output, and that most tools send far more context than needed. Their solution: a local search layer that breaks code into meaningful chunks, runs hybrid semantic and keyword search, scores results with a simple formula, and sends only relevant snippets to the AI. Tested on FastAPI's codebase, it reduced tokens per query from 83K to 4.9K — a 94% reduction — while maintaining 90% recall accuracy. The tool also creates a shared index across multiple AI coding tools (Claude Code, Cursor, Copilot) so context is learned once and reused. It's free, open source, and called CCE.