Brf.it – Extracting code interfaces for LLM context
Tree-sitter extraction cuts LLM context 50-tokens-to-8 tokens. Cursor and Cody ignore this.
Instant code briefing for AI comprehension.
Tree-sitter interface extraction cuts token usage by 6x, but chat context window optimization is becoming table stakes.
AI engineers and developers using LLM coding assistants with large codebases
Cursor's codebase indexing · Continue.dev context selection · GitHub Copilot context window management
The problem
When we give repository context to LLMs, we often send full files and implementations. But for many tasks (like understanding architecture or navigating a repo), the model doesn't actually need most of that.
This leads to two issues: - unnecessary token usage - noisy context
The idea
Instead of sharing the full implementation, what if we only shared the interface surface of the code?
Function signatures, types, imports, and documentation — basically the structure of the system rather than the implementation details.
The experiment
I built a small CLI tool called Brf.it to test this idea. It uses Tree-sitter to parse code and extract structural information.
Example output:
<file path="src/api.ts"> <function>fetchUser(id: string): Promise<User></function> <doc>Fetches user from API, throws on 404</doc> </file>
In one example from a repo, a ~50 token function compresses to about ~8 tokens when reduced to just its signature and documentation.
The goal isn't to replace sharing full code, but to provide a lightweight context layer for things like: - architecture understanding - repo navigation - initial prompt context for AI agents
Inspired partly by repomix, but with a different approach: instead of compressing the full repo, it extracts the API-level structure.
Language support so far: Go, TypeScript, JavaScript, Python, Rust, C, C++, Java, Swift, Kotlin, C#, Lua
Project: https://indigo-net.github.io/Brf.it/
Curious if others have tried similar approaches.
What information do you think is actually essential for LLM code understanding? Are function signatures + docs enough for architecture reasoning? Are there formats that work better for LLM consumption?
Tree-sitter extraction cuts LLM context 50-tokens-to-8 tokens. Cursor and Cody ignore this.
Drag-to-merge conversations treats chat history as composable objects.
Graph-based context compression beats lossy summarization when tokens run out.
Local LLM email parsing when Plaid and receipt scanners already exist.
Knowledge graph memory beats pure vector search, but Mem0 and LangChain already own this space.
Extracts recipes from TikToks/YouTube locally—no cloud, no subscription, just yours.