DEV.co
MCP Servers · cocoindex-io

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.

Source: GitHub — github.com/cocoindex-io/cocoindex-code
2.5k
GitHub stars
196
Forks
Python
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorycocoindex-io/cocoindex-code
Ownercocoindex-io
Primary languagePython
LicenseApache-2.0 — OSI-approved
Stars2.5k
Forks196
Open issues26
Latest releasev0.2.37 (2026-06-23)
Last updated2026-07-02
Sourcehttps://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.

Quickstart

Get the cocoindex-code source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/cocoindex-io/cocoindex-code.gitcd cocoindex-code# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

AI-assisted code exploration in large codebases

Semantic search reduces agent context-window usage (~70% token savings claimed) by finding relevant code snippets quickly without regex or full-text search.

Coding agent augmentation (Claude Code, Grok, Cursor)

Marketplace skill or MCP server integration allows agents to autonomously search and index code, improving context efficiency in iterative development workflows.

Local-first development with no external API keys

Full install variant includes sentence-transformers for offline embeddings, eliminating cloud API dependency for small-to-medium projects.

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.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceMedium
Security considerations

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.

Software development agency

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.co

Related 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?
Claimed reduction in LLM context tokens by returning smaller, more relevant code snippets instead of full files or broad search results. Not independently validated in provided data.
Can I use cocoindex-code in a CI/CD pipeline to pre-index code?
Likely yes via `ccc index` CLI command, but documentation does not explicitly cover CI/CD workflows or headless index generation. Requires manual verification.
Do I need an API key for local use?
No if using full install with sentence-transformers (Snowflake Arctic Embed-XS default). Slim variant requires a cloud embedding API key (OpenAI, Anthropic, etc. via LiteLLM).
What happens if the codebase is very large?
Indexing speed and search latency not quantified in excerpt. Tree-sitter parsing scales with file count; embedding generation depends on model choice. Likely suitable for small-to-medium projects; large codebases may benefit from cloud embeddings.

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.