# CodeRLM – Tree-sitter-backed code indexing for LLM agents

I've been building a tool that changes how LLM coding agents explore codebases, and I wanted to share it along with some early observations. Typically claude code globs directories, greps for patterns, and reads files with minimal guidance. It works in kind of the same way you'd learn to navigate a…

- **Page:** https://magpie.gallery/i/coderlm-tree-sitter-backed-code-indexing-for-llm-a-c5xv
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Tags:** code-indexing, tree-sitter, llm, agents, codebase

## Source

Web · jared_stewart: CodeRLM – Tree-sitter-backed code indexing for LLM agents

- **Original:** https://news.ycombinator.com/item?id=46974515

> I've been building a tool that changes how LLM coding agents explore codebases, and I wanted to share it along with some early observations. Typically claude code globs directories, greps for patterns, and reads files with minimal guidance. It works in kind of the same way you'd learn to navigate a city by walking every street. You'll eventually build a mental map, but claude never does - at least not any that persists across different contexts. The Recursive Language Models paper from Zhang, Kraska, and Khattab at MIT CSAIL introduced a cleaner framing. Instead of cramming everything into context, the model gets a searchable environment. The model can then query just for what it needs and can drill deeper where needed. coderlm is my implementation of that idea for codebases. A Rust server indexes a project with tree-sitter, builds a symbol table with cross-references, and exposes an API. The agent queries for structure, symbols, implementations, callers, and grep results — getting back exactly the code it needs instead of scanning for it. The agent workflow looks like: 1. `init` — register the project, get the top-level structure 2. `structure` — drill into specific directories 3. `search` — find symbols by name across the codebase 4. `impl` — retrieve the exact source of a function or class 5. `callers` — find everything that calls a given symbol 6. `grep` — fall back to text search when you need it This replaces the glob/grep/read cycle with index-backed lookups. The server currently supports Rust, Python, TypeScript, JavaScript, and Go for symbol parsing, though all file types show up in the tree and are searchable via grep. It ships as a Claude Code plugin with hooks that guide the agent to use indexed lookups instead of native file tools, plus a Python CLI wrapper with zero dependencies. For anecdotal results, I ran the same prompt against a codebase to "explore and identify opportunities to clarify the existing structure". Using coderlm, claude was able to ge

## GitHub projects

- https://github.com/brainqub3/claude_code_RLM
- https://github.com/JaredStewart/coderlm

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
