Tesco engineer slashes AI coding bills by 94 percent

AI Engineer////2 min read

The Hidden Cost of AI Context

AI coding assistants feel like magic until the monthly invoice arrives. Rajkumar Sakthivel and his co-creator Foss learned this lesson when their development bills suddenly spiked. They realized the problem: tools like Cursor and GitHub Copilot send massive blocks of redundant code with every query.

Typical queries send 45,000 tokens of context when the model only needs about 5,000. You pay for that overhead on every single prompt. The team realized that ninety percent of LLM expenses come from input rather than output. Tinkering with prompts or model temperatures fails because the expensive files already traveled to the cloud.

Tesco engineer slashes AI coding bills by 94 percent
We Cut 94% of AI Coding Tokens With a Local Code Index - Rajkumar Sakthivel, Tesco

Building a Smarter Local Filter

To solve this, the developers created Code Context Engine, a lightweight, local search layer that sits between your codebase and your editor.

Five Steps to Leaner Context

  1. AST-Aware Chunking: Split code by structural logic (functions, classes) instead of random character counts.
  2. Hybrid Retrieval: Run keyword and vector searches simultaneously to catch both exact names and general meanings.
  3. Content Shrinking: Condense 50-line functions down to names and brief descriptions.
  4. Call Graph Tracking: Follow connections to find functions that call each other.
  5. Smart Scoring: Filter out low-relevance blocks.

This workflow runs entirely on your local machine, keeping data secure and eliminating cloud latency.

The Power of Simple Math

During testing on FastAPI, Code Context Engine dropped context sizes from 83,000 tokens to just 4,900 per question, maintaining a ninety percent accuracy rate. It uses a lightning-fast formula (50% vector score, 30% keyword score, 20% recency) that executes in 0.4 milliseconds, proving that simple local heuristics beat heavy cloud models.

Topic DensityMention share of the most discussed topics · 7 mentions across 6 distinct topics
Code Context Engine
29%· products
Cursor
14%· products
FastAPI
14%· products
Foss
14%· people
GitHub Copilot
14%· products
Rajkumar Sakthivel
14%· people
End of Article
Source video
Tesco engineer slashes AI coding bills by 94 percent

We Cut 94% of AI Coding Tokens With a Local Code Index - Rajkumar Sakthivel, Tesco

Watch

AI Engineer // 10:43

We turn high signal in-person events for the top AI engineers, founders, leaders, and researchers in the world into the best free learning opportunities for millions around the world here on YouTube. Your subscribes, likes, comments, speaking, attendance, or sponsorships goes a long way toward making our biz model sustainable indefinitely. We strongly believe this industry deserves a better class of community and that we know how to do this well; we just need your support.

Who and what they mention most
Anthropic
26.9%21
Claude
21.8%17
OpenAI
19.2%15
Cursor
15.4%12
2 min read0%
2 min read