cocoindex-code
A lightweight, AST-based code search CLI tool designed to reduce token consumption for coding agents. Built on a Rust engine, it integrates with Claude Code, Grok, and other coding agents via skills or MCP servers.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | cocoindex-io/cocoindex-code |
| Owner | cocoindex-io |
| Primary language | Python |
| License | Apache-2.0 — OSI-approved |
| Stars | 2.5k |
| Forks | 196 |
| Open issues | 26 |
| Latest release | v0.2.37 (2026-06-23) |
| Last updated | 2026-07-02 |
| Source | https://github.com/cocoindex-io/cocoindex-code |
What cocoindex-code is
Python-based CLI wrapper around CocoIndex (Rust-based semantic indexing engine). Uses Abstract Syntax Tree parsing via tree-sitter for code understanding. Supports local embeddings (sentence-transformers) or cloud providers (LiteLLM). Integrates as Claude Code marketplace plugin, MCP server, or standalone CLI.
Get the cocoindex-code source
Clone the repository and explore it locally.
git clone https://github.com/cocoindex-io/cocoindex-code.gitcd cocoindex-code# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Setup is one-line install via pipx/uv + skill add or mcp add; no manual config required if using marketplace plugin.
- Indexing is incremental; hooks (Grok only) or manual `ccc index` needed to refresh after code changes. Skill auto-manages this in Claude Code.
- Token savings of 70% are claimed but not independently verified; actual performance depends on query type, codebase size, and embedding model.
- Local embeddings (full install) work offline but require 1 GB+ disk and warm-up time; cloud embeddings (slim) avoid disk bloat but add API latency and cost.
- MCP server mode (`ccc mcp`) requires agent support; not all coding agents have mature MCP integration.
When to avoid it — and what to weigh
- Pure lexical/regex search requirements — AST-based semantic search is overkill if you need simple exact-match, line-number, or pattern-based code lookups.
- Minimal disk footprint required — Full install pulls in torch + transformers (~1 GB). Slim variant requires external embedding API, increasing latency and cost.
- Multi-language projects with unsupported syntax trees — Relies on tree-sitter parsers; languages not in tree-sitter's grammar coverage may degrade gracefully but without full AST benefits.
- Strict air-gapped or non-Python environments — Requires Python runtime and setup; no standalone binary distribution mentioned. Slim variant still needs network for embedding API.
License & commercial use
Apache License 2.0 (Apache-2.0). Permissive OSI-approved license allowing commercial use, modification, and distribution with attribution and no liability.
Apache 2.0 explicitly permits commercial use, closed-source derivatives, and resale. No additional commercial licensing restrictions stated in available data. Attribution required; review license text for indemnification clauses if embedding.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | Medium |
Local embeddings eliminate data transmission to third-party servers. Cloud embedding variants (LiteLLM) require API key handling; standard secret-rotation practices apply. No stated security audit or vulnerability disclosure policy provided. Index files stored locally in `.cocoindex_code/` — access control depends on filesystem permissions. AST-based parsing is safer than regex but malformed code may cause indexer failure (graceful handling not documented).
Alternatives to consider
Grepbuilt / code-search
Simple regex/grep-based search; no embeddings or ML overhead. Better for exact-match queries; worse for semantic/conceptual search and token reduction.
Vespa / Elasticsearch code-search
Scalable full-text and vector search. Higher operational overhead; suited for enterprise monorepos and multi-team setups. Overkill for single-codebase agent augmentation.
Built-in agent features (Claude Code @workspace, etc.)
No extra tooling needed; relies on agent's native context retrieval. May not optimize for token reduction or semantic search; less transparent than standalone tool.
Build on cocoindex-code with DEV.co software developers
Get started in 60 seconds. Install cocoindex-code, integrate with your coding agent, and let semantic search handle the rest.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
cocoindex-code FAQ
What does '70% token savings' mean?
Can I use cocoindex-code in a CI/CD pipeline to pre-index code?
Do I need an API key for local use?
What happens if the codebase is very large?
Software development & web development with DEV.co
From first prototype to production, DEV.co delivers software development services around tools like cocoindex-code. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across mcp servers and beyond.
Reduce token waste. Search smarter.
Get started in 60 seconds. Install cocoindex-code, integrate with your coding agent, and let semantic search handle the rest.