Why your AI reads the whole file when it only needs three functions.
AI coding tools aren't lazy — they're blind. They can't see inside a file without reading it. Agent Booster gives them a map so they don't have to.
Imagine asking a colleague to fix a bug in a 2,000-line file. A good engineer skims the structure, finds the relevant function, reads it, and fixes it. They don't read all 2,000 lines.
An AI coding tool, by default, does read all 2,000 lines. Not because it's inefficient — but because it has no other choice. It can't see the shape of a file without reading it. Every read is a full read.
This post explains how Agent Booster solves that — and what an AST actually is, in plain terms.
What is an AST?
AST stands for Abstract Syntax Tree. It sounds technical. It's actually a simple idea.
When you write code, you're writing text. But that text has structure — functions, classes, arguments, return values. An AST is just a structured representation of that text. Instead of treating your file as a long string of characters, an AST treats it as a tree of named parts.
A 1,800-line file, two ways
As raw text
1,800 lines of characters. To find anything, you read from the top. There's no index. No structure. Just text.
As an AST
A map: 42 functions, 8 classes. Each with a name, line range, and signature. You jump straight to what you need.
Agent Booster uses a tool called tree-sitter to parse your codebase into an AST when you run booster index. The result is stored in a small local database — a symbol index.
The symbol index
After indexing, Booster knows about every function and class in your project: its name, which file it lives in, which lines it spans, and its signature (the first line — the part that tells you what it accepts and returns).
Nothing is sent anywhere. It's a local SQLite file at .booster/symbols.db.
# what the index knows about a single file
function execute_block lines 45–89 (block, state, db)
function _write_trace lines 126–136 (db, run_id, block_id, ...)
function _emit lines 139–145 (db, run_id, block_id, kind, payload)
function _execute_output lines 1165–1252 (block, state, credentials, ...)
... 38 more symbols in this file
smart_read: the surgeon
When Claude needs to read a file, it normally calls a read tool and gets back the whole thing. With Agent Booster installed, smart_read intercepts that call.
It takes two inputs: the file path and a description of the task. It looks up that file in the symbol index, matches the task description against the symbol names, and returns only the source lines for the matching functions — with a header showing exactly where they came from.
Without smart_read
Claude reads executor.py.
Gets back 1,800 lines.
~14,000 tokens consumed.
Finds the 3 functions it needed on lines 126–145.
With smart_read
Claude calls smart_read with task “write trace row”.
Gets back 22 lines.
~170 tokens consumed.
Same result. 98% fewer tokens.
Semantic search: finding the right file first
Sometimes you don't know which file to read. You just know what you're trying to do.
search_context handles this. It takes your task description and searches the symbol index by meaning — not just keyword matching. It uses a small local embedding model to understand that “handle Slack notification failure” and “post_message error handling” are related, even if they share no words.
The result is a ranked list of the most relevant functions across your codebase, with file paths and line numbers. Claude can then call smart_read on exactly those files rather than guessing.
# search_context("handle Slack notification failure")
integrations/slack.py:84 function post_message
integrations/slack.py:121 function post_approval_message
runtime/executor.py:1192 function _execute_output
Why this matters at scale
On a small project, reading whole files is fine. On a codebase with 200 files and 15,000 functions, every unnecessary read compounds. An agentic session might read 30–50 files across a single task. Without smart_read, that's potentially millions of tokens — most of it irrelevant.
Reuven Cohen's observation that swarm-style AI development costs ~$2,500/day is not a model pricing problem. It's an information flow problem. The same context — architecture docs, source files, conversation history — gets resent on every call. Smart_read is the fix at the file level.
Try it
# install and index
pip install agent-booster
booster index
# wire to Claude Code
booster init claude
# see savings after a session
booster gain
Add --embed to the index command to enable semantic search. Without it, Booster falls back to keyword matching — still useful, just less precise.
