v0.1.2 · MIT · TypeScript · Go · Python · Rust

Your agent is
structurally
blind.

Give it a knowledge graph.

codeindex builds a persistent structural graph of your codebase —
symbols, references, call chains — queryable via MCP tools.
No more reading entire files to find one function signature.

brew brew install 01x-in/tap/codeindex

also: go install

Your codebase,
mapped.

Symbols become nodes. Calls, imports, and type references become directed edges. Query any relationship — callers, callees, subgraphs — in milliseconds.

live knowledge graph

calls calls calls calls calls calls fn startServer fn routeRequest fn processWebhook fn handleRequest handler.ts:24 fn validateInput fn queryDatabase [stale] fn formatResponse fn node selected stale

Agents navigate
code like it's 1995.

Every structural question costs context. Grep calls, file reads, repeated parsing — all because there's no persistent structural memory. Until now.

grep calls per "who calls this?"
The agent reads files sequentially, searching for patterns instead of querying a graph. Every question restarts from scratch.
500+
context lines wasted on structure
Reading entire files to find one function signature. Most of that context is never needed — the agent is just lost.
0%
refactor blast radius visibility
Before changing a function, the agent can't see who calls it. Downstream callers break. The graph knows — the agent doesn't.

Parse once.
Query forever.

// .codeindex/graph.db
NODES (symbols)
fn handleRequest fn validateInput
type Request fn oldHelper [stale]
EDGES (relationships)
handleRequest ──calls──▶ validateInput
routeRequest ──calls──▶ handleRequest
service.go ─imports─▶ type User
FILE METADATA
src/api/handler.ts · fresh
src/db/query.ts · stale
1
ast-grep parses your codebase
Tree-sitter powered rules extract symbols and relationships from TypeScript, Go, Python, and Rust — without bundling a parser.
2
Nodes and edges persist in SQLite
Every symbol is a node. Every call, import, and type reference is a directed edge. Stored locally in .codeindex/graph.db.
3
Staleness tracked per file
SHA-256 hashes detect changes. Every query response includes a stale flag — the agent always knows how fresh the data is.
4
Query via MCP or CLI
Any agent that supports MCP connects over stdio. codeindex serve — that's it. Or explore interactively with codeindex tree.

Six tools.
Replace fifty grep calls.

get_file_structure
Structural skeleton of a file — exports, functions, classes, types — without reading the source.
reading entire files
find_symbol
Locate where any function, type, class, or variable is defined across the entire codebase.
grep -r "function X"
get_references
Every file and line that uses a given symbol — with relationship kind: calls, imports, references.
multi-file symbol search
get_callers
Trace the call graph upstream from any function. Configurable depth, cycle-safe.
manual call tracing
get_subgraph
Bounded neighborhood around any symbol — N hops of nodes and edges. Structural context without reading files.
reading 5–10 files
reindex
Re-index a single file in under 100ms, or the full repo incrementally. Call after every edit.
stale data risks

What the agent
actually sees.

codeindex serve
<100ms single-file reindex
Hash check + one ast-grep invocation. Fast enough to call after every edit in the agent loop.
🔗
MCP stdio — agent agnostic
Works with Claude Code, Cursor, Codex, Gemini, OpenCode, Copilot, Cline, and any MCP-compatible agent.
👁
Stale flag on every response
The agent always knows if the graph data is fresh. No silent staleness.
📡
Watch mode
codeindex reindex --watch auto-reindexes on save via fsnotify. Hands-free freshness.

Four languages.
One graph.

Auto-detected from project markers. More coming — powered by ast-grep's tree-sitter rules.

TypeScript
tsconfig.json · package.json
Go
go.mod
Python
pyproject.toml · setup.py
Rust
Cargo.toml

Two ways in.

Single static binary. No runtime deps. Requires ast-grep in PATH.

Homebrew
macOS + Linux. Recommended.
brew install 01x-in/tap/codeindex
go install
Requires Go 1.22+
go install github.com/01x-in/codeindex/cmd/codeindex@latest
Quick start
# 1. index your repo codeindex init # 2. start the MCP server codeindex serve # 3. add to your agent's MCP config "command": "codeindex", "args": ["serve"]