oxcode
oxcode indexes source code into a graph and serves it to coding agents. It is
built on oxgraph — a storage-agnostic,
zero-copy-friendly graph/hypergraph topology substrate for Rust — and stores the
index in a native oxgraph database under .oxcode/index.oxgdb/.
The CLI keeps raw OxQL available, but agent navigation should usually start
with context, symbols, files, and the call graph commands because they
expand graph IDs back into function names, definition ranges, signatures,
docstrings, source previews, and call-site source context.
Get Started
1. Install
Prebuilt binary (recommended — no Rust toolchain, grammars are statically
linked so it runs offline):
# macOS / Linux
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/oxgraph/oxcode/releases/latest/download/oxcode-cli-installer.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://github.com/oxgraph/oxcode/releases/latest/download/oxcode-cli-installer.ps1 | iex"
Or download an archive from the Releases
page. With Cargo instead:
cargo binstall oxcode-cli # prebuilt, no compile
cargo install oxcode-cli # build from source
This installs one oxcode binary — the CLI plus the MCP server (oxcode mcp).
(The crate is oxcode-cli because the bare oxcode name is taken on crates.io;
the command is still oxcode.)
2. Index a project
cd your-project
oxcode index
oxcode context "How does authentication work?"
3. Wire up an agent (MCP)
Add the server to your agent. For Claude Code (~/.claude.json):
{
"mcpServers": {
"oxcode": { "type": "stdio", "command": "oxcode", "args": ["mcp"] }
}
}
Optionally auto-allow the read-only tools in ~/.claude/settings.json:
mcp__oxcode__oxcode_explore, _search, _callers, _callees, _symbol,
_files, _status.
Claude Code plugin (one-command install)
Instead of hand-editing the config above, install the bundled plugin from the
oxgraph marketplace — it wires up the MCP server for you:
/plugin marketplace add oxgraph/oxgraph
/plugin install oxcode@oxgraph
The plugin still needs the oxcode binary on your PATH and an indexed project
(steps 1–2). See claude-plugin/README.md.
How Indexing Works
- Extraction — tree-sitter parses each source file into a syntax tree. A
per-language extractor walks it (hand-written) or runs a tree-sitter query
(generic), emitting symbol nodes (file, module, class, struct, trait,
interface, function, method, field, …) and edges (
contains, calls,
imports, references, implements). Qualified names are normalized to a
::-joined internal form regardless of the language's own separator, so the
resolver and graph are language-neutral.
- Resolution — references resolve to definitions across files through tiers:
exact qualified name → enclosing module scope → in-scope imports → receiver
type → bare name. Ambiguous matches are kept and marked, not dropped.
- Storage — the resolved graph is reconciled into the oxgraph database with
stable symbol identities, so re-indexing is
O(change), not O(repo).
Personalized PageRank over the graph powers the context command's bounded,
relevance-ranked output.
Languages
Run oxcode languages to list the registered extractors. Coverage is tiered:
| Language | Extensions | Tier |
|---|
| Rust | .rs | High-fidelity |
| Go | .go | High-fidelity |
| TypeScript | .ts .tsx .mts .cts | High-fidelity |
| JavaScript | .js .jsx .mjs .cjs | High-fidelity |
| Python | .py .pyi | Generic |
| Java | .java | Generic |
| C | .c .h | Generic |
| C++ | .cpp .cc .cxx .hpp .hh .hxx | Generic |
| C# | .cs | Generic |
| PHP | .php | Generic |
| Ruby | .rb | Generic |
| Swift | .swift | Generic |
| Kotlin | .kt .kts | Generic |
| Scala | .scala .sc | Generic |
| Dart | .dart | Generic |
| Lua | .lua | Generic |
| Luau | .luau | Generic |
| Objective-C | .m .mm | Generic |
| Pascal/Delphi | .pas .dpr .dpk .lpr | Generic |
| Svelte | .svelte | Embedded script |
| Vue | .vue | Embedded script |
| Liquid | .liquid | Recognized |