cd /news/developer-tools/show-hn-crespo-tree-sitter-ast-bluep… · home topics developer-tools article
[ARTICLE · art-36099] src=github.com ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Show HN: Crespo – Tree-sitter AST blueprints instead of raw code for LLMs

Crespo, a new open-source tool, uses Tree-sitter AST parsing to extract structural blueprints from codebases, reducing token usage by up to 89% while preserving architectural understanding for LLMs. The tool supports 10 programming languages and offers structure, summary, and concat modes for different use cases. In tests on real repositories, LLMs answered architectural questions correctly 2.75 out of 3 times on average using only the compressed blueprints.

read5 min views1 publishedJun 22, 2026
Show HN: Crespo – Tree-sitter AST blueprints instead of raw code for LLMs
Image: source

Stop burning your context window on raw source files.Crespo extracts what matters — and compresses everything else.

pip install crespo && crespo ./myproject

You paste a codebase into any LLM. It hits the context limit but you problem remains unfinished. You paste one file at a time. The AI loses the big picture. You give AI the full code. The AI reads 40,000 tokens linearly and still misses the architecture.

Crespo solves this differently.

Instead of concatenating raw files, Crespo uses Tree-sitter AST parsing to extract only the structural DNA of your repository — imports, classes, functions, module connections — and emits a compact XML blueprint. Same architectural understanding. A fraction of the tokens.

crespo ./myproject

crespo ./myproject --mode summary --groq YOUR_KEY

crespo --groq YOUR_KEY

crespo ./myproject --mode concat

crespo --git https://github.com/user/repo

crespo ./myproject --output blueprint.xml
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

No heuristics. No regex scraping. Real language grammars via Tree-sitter — the same parser used by GitHub, Neovim, and Zed.

Mode What it produces Best for
structure
AST skeleton — imports, classes, functions Architecture review, onboarding, LLM context
summary
Structure + AI one-line descriptions per file Deeper codebase understanding
concat
Full source, secrets redacted, in structured XML Passing entire repos to LLMs safely

Python · JavaScript · TypeScript · JSX · TSX · Rust · Go · Java · C · C++

<?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>

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.

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 2/3
Urai ✅ correct and specific ✅ correct and specific 2/3
FastAPI ✅ correct and specific ✅ correct and specific 2/3
Flask ✅ correct and specific ✅ correct and specific 2/3
Average
2.75 / 3
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 — there is less noise to discard.

Token Counting is done using tiktoken

python library.

Compression Depends on Repo Type

Crespo redacts secrets before writing any output. Patterns covered:

  • Quoted assignments — api_key = "..."

,token: '...'

  • Raw .env

style —GROQ_KEY=abc123

  • Known key prefixes — Groq ( gsk_

), OpenAI (sk-

), Anthropic (sk-ant-

), GitHub (ghp_

), AWS (AKIA

), Slack (xox

)

Summary mode uses Groq to generate one-line descriptions per file and function. The free tier is more than enough.

crespo --groq YOUR_KEY

crespo ./myproject --mode summary

Your key is stored locally at ~/.crespo/config

and never sent anywhere except Groq's API.

  • Something for Humans coming soon!
  • More aggressive compression preset
  • More language support (Ruby, PHP, Swift, Kotlin) .crespoignore

support

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

Contributions are welcome. If you have ideas for new output modes, better parsing, or additional language support, open an issue or PR.

MIT © Hrudul Krishna K V

── more in #developer-tools 4 stories · sorted by recency
── more on @crespo 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-crespo-tree-…] indexed:0 read:5min 2026-06-22 ·