Crespo – Tree-sitter AST blueprints instead of raw code for LLMs
FreeAbout Crespo – Tree-sitter AST blueprints instead of raw code for LLMs
Crespo is an open-source command-line tool that generates compact XML blueprints of code repositories using Tree-sitter AST parsing. Instead of concatenating raw source files, Crespo extracts only structural elements (imports, classes, functions, module connections) to create a lightweight representation optimized for large language models. This approach dramatically reduces token consumption while preserving the relationships between files, enabling LLMs to understand codebases more effectively without hitting context limits. Crespo supports 10 programming languages, respects .gitignore rules, and offers three modes: structure (AST skeleton), summary (AI-generated one-line descriptions per file using a Groq API key), and concat (full source with secrets redacted). It can analyze local directories or GitHub repositories directly, and is installable via pip.
Key Features
Pros & Cons
- Dramatically reduces token usage compared to raw code concatenation
- Preserves structural relationships between files (imports, dependencies)
- Open source and free to use (MIT license implied from public repo)
- Easy installation via pip
- Multi-language support covering popular programming languages
- Respects existing .gitignore files to avoid unnecessary bloat
- Provides multiple modes for different use cases (structure, summary, concat)
- Handles edge cases reliably through Tree-sitter parsing (no regex failures)
- Summary mode requires a Groq API key, adding a dependency on an external service
- Only supports 10 languages; other languages are not parseable
- Structure mode does not include actual code logic, only structural skeletons
- Concat mode may still produce large output for very large repos despite redactions
- New tool with limited community adoption and documentation (as of initial release)