CocoIndex Code

Embedded AST-based semantic and structural search for code agents.

Stars
★ 2.7k
Last updated
1d ago
License
Apache-2.0
Primary language
Python

At a glance

Works with
Universal · cross-platformCodex · Claude Code · OpenAI API
You'll need
pipx or uvShell / CLINetwork accessLocal filesystemMCP Server
Typical use
A developer joining an unfamiliar Python, TypeScript, or Rust repository who needs to find session handling from a natural-language description.
Main limitation
The full native install adds roughly 1 GB of torch and transformers dependencies, while the full Docker image is approximately 5 GB.

What does this agent do, and when should you use it?

CocoIndex Code is an embedded semantic code-search CLI built on CocoIndex’s Rust indexing engine. Its ccc commands initialize a project, build or incrementally update an index, and return matching chunks with paths, languages, source, line numbers, and similarity scores. It can also run as the ccc mcp stdio server for Codex, Claude Code, OpenCode, and Kilo Code, while the installable ccc skill guides compatible coding agents to use the CLI. Project settings and index databases live by default under .cocoindex_code, and a background daemon starts on first use to keep the embedding model loaded. It supports native Python-based installation or a persistent Docker deployment.

ccc init creates global and project YAML settings and adds .cocoindex_code/ to .gitignore. ccc index builds or updates the semantic index; the documented behavior is to re-index changed files only. ccc search <query> performs similarity search with --lang, --path, --offset, --limit, and --refresh options. ccc grep <pattern> performs syntax-structure matching through CocoIndex code_match without an index, daemon, or embedding model. ccc mcp exposes search(query, limit, offset, refresh_index, languages, paths), returning matching code chunks and their metadata. Embeddings can come from local SentenceTransformers or cloud providers accessed through LiteLLM.

  1. A developer joining an unfamiliar Python, TypeScript, or Rust repository who needs to find session handling from a natural-language description.
  2. A Codex or Claude Code user who wants an MCP search tool to retrieve relevant code chunks during an agent session.
  3. A maintainer who does not know an implementation’s exact identifier and needs conceptual retrieval beyond text grep.
  4. A developer looking for function definitions, calls, or class shapes who can express the target as a ccc grep structural pattern.
  5. A team that wants a reproducible environment can run the persistent Docker container so its daemon and model cache remain warm.

How do you install or deploy this agent?

For local embeddings without an API key:

pipx install 'cocoindex-code[full]'

Or:

uv tool install --upgrade 'cocoindex-code[full]'

From the target repository, run:

ccc init
ccc index
ccc search "authentication logic"

The [full] extra defaults to local Snowflake/snowflake-arctic-embed-xs. The slim cocoindex-code installation requires a cloud embedding provider and its API key.

How do you use this agent?

Search directly with ccc search "database schema". Filter languages with ccc search --lang python --lang markdown schema, or refresh first with ccc search --refresh "query handler". For structural search, use ccc grep 'def \NAME(\(ARGS*\)):'. Register the MCP server in Codex with codex mcp add cocoindex-code -- ccc mcp. The MCP search tool accepts query, limit, offset, refresh_index, languages, and paths. To install the agent skill, run npx skills add cocoindex-io/cocoindex-code.

What are this agent's strengths and limitations?

Pros
  • Combines semantic retrieval with ccc grep AST structural search, which does not require an index or embeddings.
  • Provides a documented stdio MCP server with a defined search tool for direct Codex and Claude Code integration.
  • Supports local SentenceTransformers as well as multiple LiteLLM-backed cloud providers; the default local model needs no API key.
  • Keeps indexes in the project and uses a background daemon to hold the model warm; the Docker option keeps that daemon alive across sessions.
Limitations
  • The full native install adds roughly 1 GB of torch and transformers dependencies, while the full Docker image is approximately 5 GB.
  • The slim installation requires a cloud embedding provider and API key, adding network and provider-configuration dependencies.
  • Changing embedding models requires ccc reset && ccc index because vector dimensions can differ.
  • ccc grep depends on CocoIndex code_match; the documentation says a local CocoIndex build is needed until that feature is released.

How does this agent compare with similar options?

Key facts side by side with the most closely related agents.

Agent Source review Stars Updated Language Full support on
CocoIndex Code This agent 52 · Major gaps ★ 2.7k 1d ago Python Codex · Claude Code · OpenAI API
Claude Context — Semantic Code Search MCP for AI Coding Agents 49 · Major gaps ★ 13k 2mo ago TypeScript Codex · Claude Code · OpenAI API
Arbor Research Optimizer 55 · Major gaps ★ 1.1k 16d ago Python Codex · Claude Code · OpenAI API · Claude API
ACE Context Learning Engine 51 · Major gaps ★ 2.6k 2d ago Python Claude Code · OpenAI API · Claude API

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
52/ 100 5-point scale 2.6 / 5
Trust 10/29
Reliability 8/14
Adaptability 12/18
Convention 10/18
Effectiveness 9/13
Verifiability 3/8
Why each dimension lost points
Trust10 / 29 · 1.7/5

Evidence: SECURITY.md provides contact and scope; install via pipx/uv with no special permissions; Docker mount of $HOME has security note; reset command exists; dependencies have version ranges. Deductions: no explicit data flow transparency (e.g., where index data is stored, whether uploaded), no user confirmation mechanism, no rollback mechanism, publisher identity unverified.

Reliability8 / 14 · 2.9/5

Evidence: README and pyproject.toml consistent; CLI commands and config clear; dependencies have version ranges; CI tests present. Deductions: no specific failure message examples, dependency availability not verified (static review).

Adaptability12 / 18 · 3.3/5

Evidence: clear target audience (coding agents), multiple integration methods (CLI, MCP, Docker), multi-language support, environment variable config. Deductions: capability boundaries (e.g., codebase size limits) not specified, trigger conditions for automatic search not detailed.

Convention10 / 18 · 2.8/5

Evidence: README well-structured with install, CLI reference, config guide; LICENSE (Apache-2.0) present; version number in pyproject.toml. Deductions: no CHANGELOG, known limitations not explicitly listed, maintenance responsibility unclear (publisher unverified).

Effectiveness9 / 13 · 3.5/5

Evidence: claims 70% token saving, provides search, grep, Docker image, multiple install methods. Deductions: no performance benchmarks or user feedback, cost-benefit not quantified.

Verifiability3 / 8 · 1.9/5

Evidence: README describes features, tests exist (tests/), CI config present. Deductions: no reproducible benchmarks, claims (e.g., 70% token saving) lack data support, facts vs. inferences not clearly separated.

Risks and how to mitigate them
  • Publisher identity is unverified; assess risk before installation.
  • Docker mounting $HOME may expose sensitive data; consider narrower mounts.
  • Static review cannot verify runtime behavior; conduct actual testing.
Evidence confidence: Low Reviewed Aug 09, 2026 Reviewed revision 9fd2e7470a8b New commits since this review; the score may not cover them
See the full review method →

FAQ

Do I need a cloud API or paid embedding model?
No. cocoindex-code[full] supports local SentenceTransformers and defaults to Snowflake/snowflake-arctic-embed-xs. The slim package instead requires a cloud embedding provider and API key.
Does it read or send my source code?
It reads project files that match its include and exclude rules to build an index. The documented anonymous telemetry excludes source code, paths, queries, results, embeddings, and settings, and can be disabled with COCOINDEX_DISABLE_USAGE_TRACKING=1. Cloud-embedding data handling depends on the selected provider.
Must the index be rebuilt manually after every edit?
ccc index builds or updates the index and is documented to re-index only changed files. ccc search --refresh can update before searching.
What does MCP search return?
The ccc mcp search tool returns matching code chunks with file path, language, code content, line numbers, and similarity score.
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related agents