How I Cut AI Coding Token Usage by 90% Using Local AST Pruning (At Age 15)
Hey developers! 👋 I'm Toprak, a 15-year-old software engineer from Turkey building open-source developer tooling at Siber Akademi. Like many developers using AI coding assistants like Cursor, Claude Desktop, and Windsu
Hey developers! 👋
I'm Toprak, a 15-year-old software engineer from Turkey building open-source developer tooling at Siber Akademi.
Like many developers using AI coding assistants like Cursor, Claude Desktop, and Windsurf, I constantly hit a major wall on large codebases: Context Window Bloat.
The Core Problem: Implementation vs. Interface
When you @ tag directories in Cursor Composer, 85-90% of the ingested tokens are function execution bodies (loops, SQL queries, helper transforms) that the AI doesn't need to read just to understand your architecture.
The Solution: AST Skeletonization (T-Zero)
I spent the last several months engineering T-Zero (v11.11), an open-source local Model Context Protocol (MCP) server that prunes multi-language code down to typed AST interface skeletons.
📊 Real Benchmark on 481-File Repository:
- Raw Codebase Context: 10,998,573 tokens ($32.99 per single Claude 3.5 prompt fill)
- T-Zero 4-Tier AST Skeletons: 1,319,828 tokens (-88.0% reduction)
- Focus File Skeleton: -94.6% reduction
- Local Latency: <400ms (pure local CPU, 0 cloud telemetry)
- Security: In-memory Shannon entropy scanner (H >= 4.75) detects and redacts hardcoded API keys locally.
⚡ 30-Second Setup in Cursor or Claude Desktop:
Add this to your Cursor MCP settings (~/.cursor/mcp.json):
{
"mcpServers": {
"tzero": {
"command": "npx",
"args": ["-y", "tzero-mcp@latest"]
}
}
}
(Or install via pip: pip install tzero-mcp)
Everything is 100% free and open-source under the MIT License!
I'm currently on a mission to hit my first 100 GitHub Stars ⭐ — if this saves your AI context budget, dropping a star would mean the world to an independent 15-year-old engineer:
👉 GitHub Repo (MIT): https://github.com/toprakahmetaydogmus/TZeroAlgorithm
👉 Interactive Web Playground: https://tzero-indol.vercel.app
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.