Instantly speed up your coding agent.
AST-aware semantic code search as an MCP server — one install and Claude Code, Codex, Cursor, or OpenCode sees your whole repo at once. 70% fewer tokens per turn. 80–90% cache hits on re-index. Works with every major agent.
Agents see code one file at a time.
Today's coding agents read whichever file you point them at. They miss the global structure — so they duplicate logic, drift DRY, and over time make the codebase inconsistent. Global understanding is the difference between scaffolding and shipping.
One file is not the whole story.
Agents miss callers, siblings, and the module a function actually belongs to — so changes ripple in ways nobody anticipated.
DRY dies when context is thin.
When the agent can't see that a helper already exists, it writes a new one. A month later the two versions have drifted and nobody knows which is canonical.
Save a file. Your agent sees it.
Tree-sitter splits code by syntax, not by line count — so CocoIndex Code knows which chunks actually changed. Only those are re-embedded. Everything else reuses prior work from cache. Sub-second freshness, any repo size.
Only the delta. Always.
A save triggers a diff against the prior AST. Untouched functions keep their embeddings. Changed ones re-embed. Deleted ones retire. No full-repo rebuilds, ever.
Cache-aware by design.
Embedding calls — the expensive part — are memoized. Typical workloads see 80–90% cache hits, so you pay for new content, not the same content twice.
At scale, it's not optional.
A 2M-file rebuild costs real money and takes real hours. By the time it finishes, more commits have landed — the context is stale on arrival. Incremental is the only way agents and corpus velocity can coexist.
A real context layer — not a grep wrapper.
Natural-language search
Ask for "where we embed documents" instead of grepping fifteen variant names. Tree-sitter parses by syntax, so chunks are real semantic units.
Incremental indexing
Only changed files are re-chunked and re-embedded. Sub-second freshness at any repo size.
Token-efficient
Agents receive the few chunks that matter — not whole files. Saves ~70% tokens and speeds up every turn.
Multi-language
Python, TypeScript, JavaScript, Rust, Go, Java, C/C++, C#, SQL, Shell — 20+ languages via Tree-sitter.
Local or cloud
Run fully local with SentenceTransformers, or plug in 100+ cloud providers via LiteLLM. Your data, your choice.
Rust core
Built on the CocoIndex engine. Production-grade from day zero with lineage, caching, and failure isolation baked in.
Any agent. Any repo. One context layer.
CocoIndex Code is a CLI, an MCP server, and a Claude skill. Drop it into whatever agent you're shipping — it brings its own fresh index and gets out of the way.
Coding agents
Give Claude Code, Cursor, Codex, or OpenCode a map of the whole repo. Less grep, fewer duplicate helpers, better refactors.
Code-review agents
Review PRs with full blast-radius context. Know every caller a function has before you greenlight the change.
Security-review agents
Trace a vulnerable pattern across repos. Find every touch point, not just the one the author flagged.
Operational agents
On-call triage with live semantic search. Ship answers in tokens, not tabs.
Spec ↔ code agents
Keep spec documents and code in two-way sync. Detect drift the moment either side moves.
Build your own
Ship custom agents on top of ccc via MCP, the Claude skill, or the CLI. Same context layer, different surface.
Three commands. Fresh context.
Install
pipx install 'cocoindex-code[full]'
One command. Ships with local SentenceTransformer embeddings — no API key required.
Index your repo
ccc init ccc index
Tree-sitter chunks every file by syntax. Only changed files re-index on subsequent runs.
Query from your agent
ccc search "where we embed docs" # or run an MCP server ccc mcp
Query via CLI, MCP, or the Claude Code skill. Agents auto-invoke when helpful.
Your agent. Already.
One shared index. Every agent. Every teammate.
Rebuild-per-developer works fine for one laptop repo. At enterprise scale — many repos, millions of files, hundreds of agents — every engineer re-embedding the same code burns compute and drifts out of sync. CocoIndex Code runs as a persistent daemon so the index is built once and served to the whole team.
Index once. Serve many.
A 100-engineer team re-embeds the repo once, not 100 times. The Rust daemon runs in your VPC; every MCP client, Claude session, and CLI call queries the same fresh index — one embed bill, one source of truth, no drift between laptops.
Cross-repo context.
Point the daemon at services, libraries, infra, and schemas together. Agents see callers in sister repos — blast radius is a query, not six GitHub tabs of spelunking.
Dedicated deployment.
VPC or on-prem with managed sync against private repos, SSO, and team-scoped indexes. See the full enterprise deployment story or talk to us about your corpus.
One index. Every branch. Every PR, instantly in context.
A 10,000-engineer org runs thousands of branches in flight on any given day — feature work, release cuts, long-lived forks. Re-embedding the full corpus for each one is compute you can't afford and freshness you can't rely on. CocoIndex treats each branch as a delta layered on top of the shared main index: only the files that actually differ are re-chunked, re-embedded, and queried through an overlay.
Rebuild once, query from every branch.
Main is indexed once and served to the whole org. Every branch — feature, release, hotfix — reads the same base and layers only its own changed chunks on top.
Cost scales with delta, not with branches.
A typical PR touches a handful of files. That's all CocoIndex re-chunks and re-embeds. A thousand branches open simultaneously doesn't multiply your embedding bill — it just accumulates small deltas.
PR agents see the right code, every time.
Review agents query the branch as if it had its own full index. Under the hood, reads union the main base with the branch's delta — so blast-radius, call graphs, and vector search reflect the PR's actual state, not stale main.
Cleanup is automatic.
When a branch merges or closes, its delta retires with it. No orphaned vectors piling up in your store. Lineage is preserved — every chunk traces back to its branch + commit.
Questions, answered.
What is CocoIndex Code?
An open-source semantic code search engine built for AI coding agents. It parses source with Tree-sitter into AST-aware chunks, embeds them incrementally, and serves results via CLI or MCP server. Apache 2.0. Runs locally.
Why is my coding agent slow on large codebases?
Most agents read one file at a time and burn context re-opening related files. On a mid-size monorepo that is dozens of tool calls per question and frequent context overflow. CocoIndex Code replaces that with one semantic search call returning only the relevant AST chunks — typically 70% fewer tokens per turn and fewer retries.
What is the best MCP server for code search?
CocoIndex Code is the reference MCP server for AST-aware semantic code search: Apache 2.0, runs locally, 20+ languages, incremental re-index on file change, local embeddings by default. One-liner for Claude Code: claude mcp add cocoindex-code -- ccc mcp.
How do I install it in Claude Code?
Skill (recommended): npx skills add cocoindex-io/cocoindex-code, then invoke /ccc. MCP: claude mcp add cocoindex-code -- ccc mcp. Run ccc index once in your repo and the agent will start auto-using it.
How do I install it in Codex or OpenCode?
Codex: codex mcp add cocoindex-code -- ccc mcp. OpenCode: opencode mcp add and choose type=local, command=ccc mcp. Both expose the same search(query, limit, paths, languages) tool to the agent.
Which coding agents does it work with?
Claude Code (skill or MCP), OpenAI Codex CLI (MCP), OpenCode (MCP), Cursor (any MCP client can point at ccc mcp), Factory droid, Kilo Code, and any MCP-compatible agent. Plus a CLI (ccc search) for humans and CI.
How is it different from grep or ripgrep?
Grep matches strings. CocoIndex Code matches meaning — ask for "where we embed documents" and it finds the function regardless of what it is named. Tree-sitter keeps chunks aligned to real semantic units (functions, classes, blocks), not arbitrary line spans.
How is it different from plain embedding-based code search?
Line-chunked embeddings return ragged snippets that cut through functions. CocoIndex Code chunks along AST boundaries first, so every result is a complete semantic unit. Incremental AST-diff re-indexing keeps the index fresh without re-embedding the whole repo.
Does it work with monorepos and multi-repo setups?
Yes. Point ccc index at a monorepo root and it indexes everything under it. For multi-repo, run the daemon once per workspace or a shared indexer on a build machine. Branches overlay incrementally — switching branches re-embeds only the files that diverged.
What languages are supported?
Python, TypeScript, JavaScript, Rust, Go, Java, C, C++, C#, SQL, Shell, and 20+ more via Tree-sitter grammars. Unknown extensions fall back to line-based chunking.
Does it work offline?
Yes. The [full] extra installs SentenceTransformers so embeddings run locally — no API key, no code leaving the machine. Swap to 100+ cloud providers via LiteLLM when you need scale.
How does incremental indexing work?
On a file change, CocoIndex Code diffs the AST, re-embeds only the chunks that changed, and retires deleted ones. Typical workloads see 80–90% cache hit rates.
Can multiple team members share an index?
Yes — run it as a persistent daemon. Every MCP client, Claude session, and CLI call queries the same index. In enterprise deployments the daemon runs in your VPC and serves the whole team.
Is it free? What is the license?
Apache 2.0. Free forever for individuals and teams. Enterprise support (SSO, audit logs, managed deploys) is available via cocoindex.io/enterprise.
Give your agent the whole codebase.
Install in a minute. Index in seconds. Query from any MCP-compatible agent.