Crisp Repos, Sharp AI.
Built Crespo because I kept hitting the context limit on multiple AI's.
pip install crespo && crespo ./myproject
The Problem
When we paste the whole codebase to any LLM either it dosent understand fully or we hit the token limit. But when we try to give the context file by file it can't understand the relation between files and all these requires limited tokens that are wasted on making the AI understand the codebase rather than doing work.
Crespo solves this differently.
Instead of concatenating raw files, Crespo uses Tree-sitter AST parsing to extract only the structural aspects of your repository such as imports, classes, functions, module connections and generates a compact XML blueprint. This helps the AI understand better at the cost of a fraction of tokens.
Usage
# Structure mode (default)
crespo ./myproject
# Summary mode — requires Groq key
crespo ./myproject --mode summary --groq YOUR_KEY
# Save your Groq key for future runs
crespo --groq YOUR_KEY
# Concat mode — full source, redacted
crespo ./myproject --mode concat
# Analyse a GitHub repo directly
crespo --git https://github.com/user/repo
# Custom output filename
crespo ./myproject --output blueprint.xml
How It Works
your repo
│
▼
walker respects .gitignore · skips tests · skips build artifacts
│
▼
tree-sitter real AST parse · 10 languages · no regex
│
▼
extractor imports · classes · functions · structs · enums
│
▼
blueprint XML compact · structured · LLM-ready
Tree-sitter handles language grammar without failing on edge cases where regex fails.
Demo
Modes
| Mode | What it produces | Best for |
|---|---|---|
structure |
AST skeleton — imports, classes, functions | When you want LLM to understand the codebase |
summary |
Structure + AI one-line descriptions per file | When you want descriptions for files |
concat |
Full source, secrets redacted, in structured XML | When you want to make changes in code |
Languages supported
Python · JavaScript · TypeScript · JSX · TSX · Rust · Go · Java · C · C++
Example output
<?xml version='1.0' encoding='utf-8'?>
<repo n="kara" s="Gesture-controlled PDF viewer using PyQt6, MediaPipe, and OpenCV.">
<meta>
<dep>cv2,mediapipe,numpy,PyQt6,fitz,groq,markdown</dep>
</meta>
<files>
<f p="Ui.py" e=".py" s="Main PyQt6 window coordinating PDF rendering, gesture input, and AI summarisation.">
<imp>PyQt6,fitz,render,summarise,gesture,markdown</imp>
<cls n="Window">
<fn n="summary" p="(self)" />
<fn n="startGest" p="(self, state)" />
<fn n="gestZoom" p="(self, state: int)" />
</cls>
</f>
<f p="gesture.py" e=".py" s="MediaPipe hand tracking with gesture classification and debouncing.">
<imp>mediapipe,cv2,numpy</imp>
<cls n="GestureController">
<fn n="detect" p="(self, frame)" />
<fn n="classify" p="(self, landmarks)" />
</cls>
</f>
</files>
</repo>
Benchmarks
Tested on real open-source repositories. Structure accuracy evaluated by asking an LLM three questions from the blueprint alone — no access to the original source.
Structure mode accuracy
| Repo | Components & connections | Dependencies | Entry point | Score |
|---|---|---|---|---|
| Axios | ✅ correct and specific | ✅ correct and specific | ✅ correct and specific | 3/3 |
| Express | ✅ correct and specific | ✅ correct and specific | ✅ correct and specific | 3/3 |
| Kara | ✅ correct and specific | ✅ correct and specific | ✅ correct and specific | 3/3 |
| Moodilist | ✅ correct and specific | ✅ correct and specific | ✅ correct and specific | 3/3 |
| Requests | ✅ correct and specific | ✅ correct and specific | ⚠️ partially correct | 2/3 |
| Urai | ✅ correct and specific | ✅ correct and specific | ⚠️ partially correct | 2/3 |
| FastAPI | ✅ correct and specific | ✅ correct and specific | ⚠️ partially correct | 2/3 |
| Flask | ✅ correct and specific | ✅ correct and specific | ⚠️ partially correct | 2/3 |
| Average | 2.75 / 3 |
⚠️ Entry points are partially correct on framework-level repos (FastAPI, Flask) and convention-driven repos (Next.js) where the entry point is implicit rather than explicit. Architecture and dependency accuracy remains perfect across all tested repos.
Token reduction — structure mode
| Repo | Raw tokens | Blueprint tokens | Reduction |
|---|---|---|---|
| Kara | ~4,667 | ~934 | ~80% |
| Moodilist | ~8,580 | ~1,396 | ~84% |
| Axios | ~61,494 | ~6,989 | ~89% |
| Express | ~17,222 | ~707 | ~96% |
| FastAPI | ~145,606 | ~124,993 | ~14% |
| Flask | ~77,402 | ~13,848 | ~82% |
| Requests | ~49,556 | ~9,585 | ~81% |
| Urai | ~ 17,418 | ~2,304 | ~87% |
| Average | ~86% |
FastAPI (14% reduction) excluded from average — as a framework repo its structure IS the content. Crespo correctly preserves it rather than discarding it.
Framework-heavy repos compress slightly less because the preserved structure is genuinely useful as there is less noise to discard.
Token Counting is done using tiktoken python library.
Compression Depends on Repo Type
Security
Before writing anything in the concat mode, crespo scans the file body for secrets and then replaces them with [REDACTED].
It is still not perfect but captures common patterns such as:
- Quoted assignments —
api_key = "...",token: '...' - Raw
.envstyle —GROQ_KEY=abc123 - Known key prefixes — Groq (
gsk_), OpenAI (sk-), Anthropic (sk-ant-), GitHub (ghp_), AWS (AKIA), Slack (xox)
Groq Setup
Summary mode uses Groq to generate one-line descriptions per file and function. The free tier is more than enough.
# pass once — saved to ~/.crespo/config
crespo --groq YOUR_KEY
# all future summary runs pick it up automatically
crespo ./myproject --mode summary
Your key is stored locally at ~/.crespo/config and never sent anywhere except Groq's API.
Roadmap
- Something for Humans coming soon!
- More aggressive compression preset
- More language support (Ruby, PHP, Swift, Kotlin)
.crespoignoresupport
Troubleshooting
crespo: command not found
This usually means Crespo was installed successfully, but the executable isn't on your system PATH.
Verify installation
python -m pip show crespo
If Crespo appears in the output but the crespo command still isn't recognized, it's a PATH issue
Follow the steps below for your OS.
Windows
Add your Python Scripts directory to PATH (typically):
C:\Users\<you>\AppData\Local\Programs\Python\Python3x\Scripts
Restart your terminal afterwards.
macOS / Linux
Find your user scripts directory:
python3 -m site --user-base
Then add its bin folder to your shell configuration:
export PATH="$HOME/.local/bin:$PATH"
Restart your shell and try again.
Multiple Python installations
If you have multiple Python versions installed, make sure installation and execution use the same interpreter. Check which python/pip you're actually using:
where python # Windows
which -a python3 # macOS / Linux
Reinstall using that same interpreter explicitly if needed:
python -m pip install --force-reinstall crespo
Recommended: use pipx
For CLI tools, pipx avoids most PATH-related issues entirely:
pipx install crespo
crespo ./myproject
Contributing
Contributions are welcome. If you have ideas for new output modes, better parsing, or additional language support, open an issue or PR.
License
MIT © Hrudul Krishna K V
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crespo-1.0.17.tar.gz.
File metadata
- Download URL: crespo-1.0.17.tar.gz
- Upload date:
- Size: 643.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e1836ea1a936156086409fbe4e06009535915bc6191539285a703db442d9b31
|
|
| MD5 |
be81c6ef8bb8eb41f916a2b08d10c2da
|
|
| BLAKE2b-256 |
660eda91159b1ec6a65b3b6d5cb37a504b4b4ece5d4fc05f0f4f621b5bf5e24c
|
Provenance
The following attestation bundles were made for crespo-1.0.17.tar.gz:
Publisher:
publish.yml on hrudulmmn/crespo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crespo-1.0.17.tar.gz -
Subject digest:
3e1836ea1a936156086409fbe4e06009535915bc6191539285a703db442d9b31 - Sigstore transparency entry: 1935402199
- Sigstore integration time:
-
Permalink:
hrudulmmn/crespo@37ba0bbd60fcba1c4af4ea9bbb28d7edf19b3362 -
Branch / Tag:
refs/tags/1.0.17 - Owner: https://github.com/hrudulmmn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@37ba0bbd60fcba1c4af4ea9bbb28d7edf19b3362 -
Trigger Event:
release
-
Statement type:
File details
Details for the file crespo-1.0.17-py3-none-any.whl.
File metadata
- Download URL: crespo-1.0.17-py3-none-any.whl
- Upload date:
- Size: 640.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35b77cfe254899556f96dedf5d86beb571d3d81e2c1a081be885fe897e6ef0e9
|
|
| MD5 |
2a19b12e0514ca7aada6a296911336c7
|
|
| BLAKE2b-256 |
f0f3c9b0ded264466b70c560e3452ed2026b61afd40b1b7ea5098bb11eb7aef4
|
Provenance
The following attestation bundles were made for crespo-1.0.17-py3-none-any.whl:
Publisher:
publish.yml on hrudulmmn/crespo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crespo-1.0.17-py3-none-any.whl -
Subject digest:
35b77cfe254899556f96dedf5d86beb571d3d81e2c1a081be885fe897e6ef0e9 - Sigstore transparency entry: 1935402217
- Sigstore integration time:
-
Permalink:
hrudulmmn/crespo@37ba0bbd60fcba1c4af4ea9bbb28d7edf19b3362 -
Branch / Tag:
refs/tags/1.0.17 - Owner: https://github.com/hrudulmmn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@37ba0bbd60fcba1c4af4ea9bbb28d7edf19b3362 -
Trigger Event:
release
-
Statement type: