r/LocalLLaMA · · 2 min read

A local code index for coding agents that resolves imports without a language server (Rust, MIT, runs offline)

Mirrored from r/LocalLLaMA for archival readability. Support the source by reading on the original site.

Last time I posted about this here someone asked the right question: why not just use rust-analyzer, and how do you build a call graph without real semantics? I did not have a good answer then. I do now, and it comes with a concession.

The concession first. This is not LSP-precision. A language server has a type checker; for generics, macros, dynamic dispatch, DI containers and monkey-patching it will be right where this is wrong. What you get instead is no build step, no language server, and no per-language daemon, which matters when the repo does not compile because an agent is halfway through editing it.

How the resolution actually works, split by tier, because "300+ languages" is a parsing number and not an understanding number:

  • JavaScript and TypeScript go through oxc. Real scope tree, symbol table, import/export resolution, intra- and cross-file, including tsconfig path aliases in a monorepo.
  • Python and Java go through stack-graphs, GitHub's declarative name-binding rules that run against a tree-sitter parse tree. GitHub archived that project in September 2025. It is forked and maintained here, with four upstream rule bugs fixed that used to abort a whole file's resolution silently on things like a typed splat parameter or a chained assignment.
  • Everything else gets intra-file lexical scope binding only.
  • 371 grammars parse. About 100 of those give up symbols and calls. Three get real resolution.

The part that matters for agents is that it refuses to over-claim. Asking for a function's callers returns every call site a name scan finds, annotated with which ones resolution could prove, rather than only the proven subset. That is deliberate: an earlier version filtered to proven hits and reported 2 callers on a file that had 172, with no truncation flag. An agent has no instinct to distrust a small number.

Runs fully offline, no API keys, no telemetry, index lives in a local cache. Scanning the TypeScript compiler, 81k files, takes about 18 seconds on an M4; git history queries land in tens of microseconds regardless of history depth.

Rust, MIT: github.com/Goldziher/basemind

Happy to be argued with on the tiering, particularly by anyone who has tried stack-graphs and given up on it. Three other agent projects evaluated it and walked away, so I am aware I may be the one who is wrong.

submitted by /u/Goldziher
[link] [comments]

Discussion (0)

Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.

Sign in →

No comments yet. Sign in and be the first to say something.

More from r/LocalLLaMA