Repolode
cocoindex-io

cocoindex-io/cocoindex-code

AST-based semantic code search CLI and MCP server that indexes your codebase so coding agents can find code by meaning.

Stars
2,968
Forks
247
Open issues
62
Last commit
2 days ago

What is it?

cocoindex-code is a lightweight semantic code search tool for local codebases. It parses source files with tree-sitter into AST-based chunks, embeds them, and stores the index locally so you can search by natural-language description instead of exact text. It is built on the CocoIndex Rust data transformation engine and only re-indexes files that have changed.

It can be used from the command line with commands such as ccc index and ccc search, or connected to coding agents like Claude Code and Codex through an MCP server (ccc mcp) or an installable agent skill. A separate ccc grep command performs structural search by code example without requiring an index.

Embeddings can come from a local SentenceTransformers model, which needs no API key when installed with the full extra, or from cloud providers through LiteLLM. Configuration lives in global and per-project YAML files, and a Docker image is available for containerized setups.

Key features

  • 01Searches code by meaning using natural-language queries instead of exact text matching.
  • 02Parses many languages with tree-sitter, including Python, TypeScript, Rust, Go, Java and C/C++.
  • 03Re-indexes only changed files to keep updates fast.
  • 04Exposes search as an MCP tool for coding agents such as Claude Code and Codex.
  • 05Supports local embedding models or cloud embedding providers via LiteLLM.
  • 06Provides ccc grep for structural search by code example without an index.

Use cases

  • Helping a coding agent locate relevant code in a large unfamiliar repository.
  • Finding implementations by describing behavior when the exact function or variable name is unknown.
  • Reducing token usage for coding agents by retrieving only relevant code chunks.
  • Running private code search locally with a local embedding model and no API key.

Quick start

  1. 1

    Install the CLI with pipx (batteries included)

    pipx install 'cocoindex-code[full]'
  2. 2

    Install the ccc skill for your coding agent

    npx skills add cocoindex-io/cocoindex-code
  3. 3

    Or build the index manually in your project

    ccc index
  4. 4

    Search the codebase by meaning

    ccc search "authentication logic"

Things to know

  • The full install pulls in roughly 1 GB of torch and transformers for local embeddings.
  • The slim variant requires a cloud embedding provider and API key.

In collections

Topics

FAQ

What is cocoindex-code?
AST-based semantic code search CLI and MCP server that indexes your codebase so coding agents can find code by meaning. cocoindex-code is a lightweight semantic code search tool for local codebases. It parses source files with tree-sitter into AST-based chunks, embeds them, and stores the index locally so you can search by natural-language description instead of exact text. It is built on the CocoIndex Rust data transformation engine and only re-indexes files that have changed.
Is cocoindex-code free to use? What license does it have?
cocoindex-code is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is cocoindex-code still maintained?
Actively maintained. The last commit to cocoindex-code was on Nov 5, 2026.
What can I use cocoindex-code for?
Helping a coding agent locate relevant code in a large unfamiliar repository. Finding implementations by describing behavior when the exact function or variable name is unknown. Reducing token usage for coding agents by retrieving only relevant code chunks. Running private code search locally with a local embedding model and no API key.
How do I install cocoindex-code?
Install the CLI with pipx (batteries included): pipx install 'cocoindex-code[full]' Install the ccc skill for your coding agent: npx skills add cocoindex-io/cocoindex-code Or build the index manually in your project: ccc index Search the codebase by meaning: ccc search "authentication logic"
Where can I get cocoindex-code?
The source code and installation instructions are on GitHub: https://github.com/cocoindex-io/cocoindex-code

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects