Menu

I built a CLI harness that strips JS/TS function bodies with Babel AST to save 80% context tokens
📰

I built a CLI harness that strips JS/TS function bodies with Babel AST to save 80% context tokens

DEV Community: typescript·AmanullaShaikh·2 days ago
#mctfDk2n
#devtotypescript#devto#dev#agents#apex
Reading 0:00
15s threshold

While working on large Next.js and TypeScript repositories, I noticed AI coding agents (Cursor, Claude Code) constantly burning through context limits. They were reading 500-line implementation files when all they really needed were the types, interfaces, and exported signatures.

To solve this mechanically, I engineered and open-sourced Apex Agents.

How It Works:

Babel AST Compactor ( npx apex-agents compact ):

Parses TypeScript, JSX, and JavaScript using @babel/parser and replaces function bodies with {} while preserving all types, generics, parameters, and exports.…

Continue reading — create a free account

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