Dev & Engineering semantic-code-searchast-searchmcp-servercode-indexingstructural-searchlitellm

CocoIndex Code

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

FollowAgents review · FARS-2.0
Not yet reviewed
See the full review method →

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.

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

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.

Related agents