Say Goodbye to Raw Code! Introducing “Crespo,” the Lightning-Fast Tool for Passing Only the ‘Blueprint’ to LLMs Using Tree-sitter
What Happened? Overview of the News
- No Need for Raw Code Structure Extraction: Utilizing Tree-sitter AST analysis to extract only the “structural DNA” such as imports, classes, and functions from the codebase, generating a compact XML blueprint.
- Massive Token Reduction: Compared to traditional raw code injection, token consumption is reduced by an average of 86%. Even with large repositories, you can help LLMs grasp architecture without overwhelming their context windows.
- Three Versatile Modes: Featuring “Structure” for only the structure, “Summary” with AI-generated single-line explanations, and “Concat,” which passes the full source while masking confidential information.
Why Is This Important? Key Points to Note
- Eliminating “Can’t See the Forest for the Trees”: Prevents the “loss of architecture” that occurs when LLMs read raw code linearly across tens of thousands of tokens, helping them accurately grasp the connections within the entire system.
- Precise Analysis with Tree-sitter: Instead of rough scraping with regular expressions, it employs real language grammars, like those used in GitHub and Neovim, boasting extremely high parsing accuracy across over 10 major languages.
- Security Assurance: Automatically masks sensitive information like API keys and tokens when outputting, reducing the risk of sending code to external LLMs.
🦈 Shark’s Eye (Curator’s Perspective)
Say goodbye to the days of endlessly copy-pasting raw code and shouting, “I’m out of context, mate!” The brilliance of this tool isn’t just in “compression,” but in its ability to understand the syntax of programming languages and extract only the “meaningful skeleton.” Especially in frameworks like FastAPI, where “structure itself is specification,” it excels at filtering out noise while maintaining important connections! This will undoubtedly speed up onboarding for large repositories and consultations for refactoring!
What’s Next?
In the future, we can expect this kind of AST-based context management to be integrated as a standard feature in IDEs. LLMs will start preferring “structured XML” over “raw text,” leading to a logical shift in prompt engineering from “attaching source code” to “presenting AST blueprints”!
A Word from Haru Shark
Unnecessary token consumption is a feast for sharks! Engineers who communicate smartly with “blueprints” will emerge victorious in 2026! 🦈🔥
Terminology
-
Tree-sitter: A parser generator tool for fast and incremental parsing of programming language syntax, generating syntax trees.
-
AST (Abstract Syntax Tree): A tree representation of the structure of source code, abstracting away irrelevant details like parentheses that do not affect computation.
-
Context Window: The maximum amount of information an LLM can process at once. When this is filled, the AI may forget past information or lose accuracy.
-
Source: Crespo – Tree-sitter AST blueprints instead of raw code for LLMs