All work

graph-sitter

A detour at Codegen: an open-source library for codebase refactors, built on Tree-sitter.

January 28, 2025 · Jay Hack
codegen-sh/graph-sitter

While building Codegen, we took a detour to solve a problem that kept blocking our agents: making large-scale, structural changes to a codebase reliably. The answer was graph-sitter — an open-source library for programmatic codebase refactors, built on top of Tree-sitter.

Instead of nudging files one edit at a time, graph-sitter builds an in-memory graph of a codebase — functions, classes, imports, and their relationships — and exposes high-level APIs that match how engineers actually think about refactors and migrations. It became the foundation for our "act via code" thesis.

We first put that foundation behind an IDE built specifically for refactors — see the demo here.

The thesis behind it

Act via Code

Act via Code

Why the next step for software agents is a more expressive action space — writing and executing programs against well-designed APIs.

Act via Code
IDE for refactors

IDE for refactors

Announcing an IDE purpose-built for codebase refactors.

IDE for refactors
Open-source release

Open-source release

Introducing graph-sitter as an open Python library for manipulating codebases.

Open-source release

← Back to the Codegen story

Jay Hack, Founder