Developer builds Rust CLI tool that cuts JS/TS codebase token usage by 83%
A developer has released urai-ecma, an open-source command-line tool written in Rust that compresses JavaScript and TypeScript codebases before they are fed into large language models. The tool uses SWC (Speedy Web Compiler) to parse code into Abstract Syntax Trees, stripping out syntactic noise such as Tailwind CSS class strings and imperative loops while preserving architectural structure. In testing, it reduced a 209,757-token React codebase to roughly 36,000 tokens — an 82.7% reduction — in milliseconds. The project was motivated by the creator's own experience building an agentic Chrome extension, where oversized prompts caused slow inference, rate-limit exhaustion, and model hallucinations. The tool is designed to help developers avoid wasted API costs and attention degradation when using LLMs for codebase-level reasoning tasks.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in