codexray
A Repository-Aware, Knowledge-Learning local MCP that understands your codebase in Real Time powered by Hybrid Semantic + Full-Text Engine, both supports claude code and codex
A local code search tool that plugs into AI coding assistants, combining keyword search, semantic search, and a code call graph to answer questions about your codebase.
CodeXRay is a code search tool that plugs directly into AI coding assistants like Claude Code or OpenAI Codex. It reads your codebase, builds an index of every function, class, and method it finds, and then answers questions like "where is the login logic" or "what calls this function" by combining two different search techniques at once.
The first technique is keyword search, which finds exact matches for names and tokens in your code. The second is semantic search, where your question gets converted into a mathematical representation (a vector) and the tool finds code that means the same thing, even if the words are different. Results from both techniques are merged and then scored a second time by a separate ranking model for precision. If you do not have access to an AI embedding API, the tool falls back to keyword search and a code call graph, so it still works offline.
The call graph is built by parsing your source files with a tool called Tree-sitter, which understands the structure of code in seven languages: Rust, Python, JavaScript, TypeScript, Go, C/C++, and Java. From that parsing, CodeXRay maps out which functions call which other functions, so you can ask about dependencies in either direction.
Indexing is incremental. The first time you run it, every file gets processed. After that, only files that changed are re-indexed, tracked by a checksum of each file's contents. The index is stored in a folder in your home directory and is never sent anywhere; everything stays on your own machine.
Installation is a single curl command that downloads the right binary for your operating system, installs it, and registers it with Claude Code or Codex automatically. After restarting your AI assistant, CodeXRay starts alongside it, indexes your project, watches for file changes during the session, and exits when the session ends. There is no background process running when you are not using it.
The project is written in Rust and released under the MIT license.
Where it fits
- Ask an AI coding assistant where a specific piece of logic lives in a large codebase.
- Trace every function that calls a given function using the built-in call graph.
- Search code offline with keyword and call-graph fallback when no AI embedding API key is available.