Stop feeding your AI assistant the whole codebase.

Tokengraph parses your repository into a structural graph with Tree-sitter — so Claude Code, Cursor, and other assistants read only the functions, callers, and tests that actually matter to a change.

MIT licensed Python 3.10+ Works over MCP
~/your-project

One small change shouldn't cost a whole repository.

To touch one function, an assistant without a map re-reads whatever it can find. Tokengraph already knows what connects to what, so it hands over a slice instead of a dump. Pick a task to see the difference.

Reading the repo — no graph0
Reading the slice — with Tokengraph0
— fewer tokens loaded before the assistant writes a single line.

Illustration on a ~40k-line repository, not a benchmark. Your numbers depend on repo size, language mix, and how tangled the call graph is.

What happens between build and your next prompt.

Four stages run once up front, then stay current as you edit. Step through them.

auth/login.py def login_user(email, pw): user = User.find(email) if not hash_pw(pw): raise AuthError() tok = validate_token(u) return create_session(u) class SessionStore: def put(self, k, v): ... function_definition call_expression call_expression class_definition tree-sitter AST handle_login login_user validate_token hash_pw test_login test_token callscallscovers .Tokengraph/graph.db · 1,482 nodes · 3,915 edges handle_login login_user validate_token ✎ hash_pw test_login test_token blast radius 3 callers · 1 test · 0 subclasses hash_pw unaffected — skipped validate_token 2 callers test_token from the graph assistant context window ✓ validate_token() body ✓ login_user() caller ✓ refresh_session() caller ✓ test_token() coverage — 1,478 other symbols not loaded 4,190 tokens sent

Click any function. Watch what it drags along with it.

This is a miniature of what Tokengraph visualize opens on a real repo. Selecting a node traces every caller, dependent, and test that a change to it would touch — that set, and nothing else, is what your assistant gets. Drag nodes to untangle them.

click a node · drag to move
selected symbol
validate_token
auth/tokens.py
Direct callers0
Full blast radius0
Tests covering it0
Context sent0
    Whole-repo read would be 186,400 tokens. This slice is — of that.

    Two commands, then keep working.

    Tokengraph detects the assistants you already use and registers itself as an MCP server. Nothing leaves your machine — the graph is a SQLite file in .Tokengraph/.

    Then just ask

    “Build the code review graph for this project” — your assistant calls the MCP tools itself.

    It stays fresh

    Hooks re-parse on file save and git commit, so the graph never drifts from the code.

    Nothing to host

    No API key, no cloud, no external database. Delete .Tokengraph/ to undo it.

    What's in the box.

    Claude CodeCursorWindsurf ZedContinueOpenCode Python · TS/JS · Go · Rust · Java · more

    Give your assistant a map.

    Free and MIT licensed. Works on any repo Tree-sitter can parse.