A fast, in-memory codebase index — beyond the AST.
Graph-sitter parses whole repositories into an in-memory index of imports, usages, and references — backed by tree-sitter and optimized for coding agents that need to analyze and safely rewrite code.
$ uvx graph-sitter parse .$ uvx graph-sitter transform delete_dead_code.py:run . --check$ uvx graph-sitter transform delete_dead_code.py:run . --writefrom graph_sitter import Codebase # Parse the repo into a fast, in-memory indexcodebase = Codebase("./") # Delete functions with no usages anywherefor function in codebase.functions:if not function.usages:function.remove() codebase.commit()Fast, in-memory index
Parse a whole repository into an in-memory index that captures more than the AST — imports, exports, usages, references, and call relationships.
Backed by tree-sitter
Built on tree-sitter parsing for Python, TypeScript, JavaScript, and React, with the heaviest indexes moving into Rust for scale.
Optimized for coding agents
A clean, scriptable API designed for AI coding agents to explore code and make safe, graph-aware edits without breaking imports.
What people build with graph-sitter.
Reach for graph-sitter when a change is too mechanical for hands and too structural for find-and-replace.
Large-scale reorganization
Restructure directories and move symbols across a codebase while every import and reference is repaired automatically.
Reorganize a codebaseDead code monitoring & deletion
Find functions, classes, and imports with no usages across the index, then remove them with confidence in a single pass.
Delete dead codeCodebase visualization
Turn the dependency and call graph into interactive visualizations to understand structure and blast radius before you change it.
Visualize a codebaseOne command surface: uvx graph-sitter.
Run it with no install. Start with fast parse summaries, then run codemods in explicit check and write modes — with the heaviest indexes moving into Rust for scale.
Open CLI referenceuvx graph-sitter parse . \--language auto --backend rust --format summary # run a codemod in check mode, then writeuvx graph-sitter transform delete_dead_code.py:run . --checkuvx graph-sitter transform delete_dead_code.py:run . --write