All projects

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.

The thesis behind it

Links & milestones

← Back to the Codegen story

Jay Hack, Founder