Menu

How I Cut AI Coding Token Usage by 90% Using Local AST Pruning
πŸ“°

How I Cut AI Coding Token Usage by 90% Using Local AST Pruning

DEV Community: securityΒ·ToprakΒ·about 12 hours ago
#SrziQU5a
#devtosecurity#devto#dev#cursor#context
Long article (256 words) β€” no AI summary yet.
Reading 0:00
15s threshold

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…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.