CodeGraph ( GitHub - colbymchenry/codegraph: Pre-indexed code knowledge graph, auto syncs on code changes, for Claude Code, Codex, Gemini, Cursor, OpenCode, AntiGravity, Kiro, CoPilot, and Hermes Agent — fewer tokens, fewer tool calls, 100% local · GitHub ) is a code index that
AI coding agents query instead of grepping and reading files: one call returns
a symbol’s source, its callers and what depends on it. I use it daily on a
large Rails app and the difference is substantial.
It doesn’t support Crystal yet. I opened a PR adding it (disclosure: I’m the
author, written with Claude’s help): feat(crystal) Add Crystal language support by n-rodriguez · Pull Request #1458 · colbymchenry/codegraph · GitHub
It extracts modules, classes, structs, enums, lib/fun bindings, macros,
accessor macros (getter/property…) and cross-file calls, inheritance and
mixins. It indexes the compiler repo (2,423 files) as well as kemal and lavinmq.
A/B on those three repos, 3 questions each, 2 runs per arm:
wall-clock -46%, tool calls -65%, file reads -75%. Cost only -4%.
Known limits:
- macros are not expanded, so macro-generated methods (Kemal’s
get/postDSL) have no symbol; - overloaded visitors (
def visit(node : Call)) are where it falls back to
grep: static extraction can’t tell which overload is reached.
The PR has been waiting for review since July. If you work on Crystal code
with an agent, trying the branch and reporting on the PR would help it land.
Feedback on the extraction choices (macro expansion in particular) is welcome.
Edit
I’m not affiliated with CodeGraph or its author in any way, beyond having
submitted this PR as an outside contributor. Nothing to sell here: I just
want to share what I’ve seen, because I think it can be useful to people
writing Crystal with an agent. ![]()