Skip to content

lci

Semantic code search built for AI assistants.

Lightning Code Index (lci) is the C++ implementation of lci — semantic code search over large corpora, aiming to be fast enough for interactive use and to cut the context an AI assistant has to read compared with grep. It parses 13 languages with tree-sitter and exposes the index through a CLI, an MCP server for AI assistants, and an HTTP server over a Unix domain socket.

Fast search

Literal match, optional synonym expansion, and regex fallback — over an in-memory trigram index. Results carry the enclosing symbol’s metadata.

13 languages

Go, Python, JavaScript, TypeScript (incl. TSX), Rust, C, C++, Java, C#, PHP, Kotlin, Zig, and Ruby via vendored tree-sitter grammars.

MCP-native

lci mcp exposes 15 tools to AI assistants over stdio — search, symbol lookup, code insight, git analysis, and more.

Four surfaces

CLI for interactive use, lci server over a Unix socket / HTTP, and lci mcp for agent integration — one engine, four ways in.

Terminal window
lci search "myFunction"
lci def MasterIndex
lci tree run_search
lci git-analyze

| Surface | Use | |---------|-----| | lci search PATTERN | substring + symbol-aware ranked search across the corpus | | lci grep PATTERN | literal text search over the corpus, grep-style output | | lci tree SYMBOL | function call hierarchy with annotations | | lci def SYMBOL / lci refs SYMBOL | definition + reference lookup | | lci git-analyze | analyze working-set changes for duplicates, naming, complexity | | lci mcp | MCP server over stdio for AI assistants | | lci server | long-running HTTP server over a Unix socket; per-corpus daemon | | lci status | index health + runtime metrics |

Indexer pipeline

scanner → parser pool (tree-sitter) → per-file extraction and per-file trigram bloom → integrator → search engine.

Lock-free hot path

RCU-style atomic snapshot for reads; mutex only on the write/indexing path. Per-language parser pools, no global lock.

Full CLI reference: lci --help or lci <command> --help.