How cocoindex-io/cocoindex-code works
Cocoindex Code provides AST-based semantic code search through the ccc CLI and MCP integrations. Users initialize project settings, index source files into an embedding-backed SQLite index, then search by natural-language query; a client connects to a shared daemon, which dispatches work to project indexing and query logic. The README also documents agent skill, automatic indexing hooks, literal grep, status/doctor, and custom chunkers. Edges reflect shown imports/calls or README-described integrations; some subsystem internals were not excerpted.
Main entry points: cli.py CCC CLI · indexer.py Index flow · project.py Project manager · query.py Semantic query
Components 24
User interfaces
- CCC agent skill
skills/ccc/SKILL.md - Auto-index hooks
hooks/hooks.json - OMP extension
extensions/ccc-index.ts - CCC CLI
src/cocoindex_code/cli.py - MCP server
src/cocoindex_code/server.py
Daemon runtime
- Daemon client
src/cocoindex_code/client.py - IPC protocol
src/cocoindex_code/protocol.py - Daemon dispatcher
src/cocoindex_code/daemon.py - Daemon paths
src/cocoindex_code/_daemon_paths.py - Project manager
src/cocoindex_code/project.py
Indexing pipeline
- Source file matcher
src/cocoindex_code/file_walk.py - Index flow
src/cocoindex_code/indexer.py - Custom chunkers
src/cocoindex_code/chunking.py - Embedding factory
src/cocoindex_code/shared.py - Embedding defaults
src/cocoindex_code/embedder_defaults.py - Embedding parameters
src/cocoindex_code/embedder_params.py - LiteLLM embedder
src/cocoindex_code/litellm_embedder.py - SQLite vector index
- CocoIndex engine
Search and configuration
- Project settings
src/cocoindex_code/settings.py - Semantic query
src/cocoindex_code/query.py - Literal grep
src/cocoindex_code/grep.py - Query schema
src/cocoindex_code/schema.py
Other components
- Developer or agent
Connections 28
- Developer or agent → CCC agent skill: invokes
README.md - CCC agent skill → CCC CLI: runs commands
README.md - Developer or agent → CCC CLI: runs
README.md - Auto-index hooks → CCC CLI: triggers indexing
README.md - OMP extension → CCC CLI: triggers indexing
README.md - CCC CLI → Daemon client: requests work
src/cocoindex_code/cli.py - MCP server → Daemon client: delegates requests
src/cocoindex_code/server.py - Daemon client → Daemon paths: resolves socket
src/cocoindex_code/_daemon_paths.py - Daemon client → IPC protocol: encodes requests
src/cocoindex_code/client.py - Daemon dispatcher → IPC protocol: decodes messages
src/cocoindex_code/daemon.py - Daemon dispatcher → Project manager: dispatches project work
src/cocoindex_code/daemon.py - Daemon dispatcher → Project settings: loads configuration
src/cocoindex_code/daemon.py - Project manager → Index flow: builds index flow
src/cocoindex_code/project.py - Project manager → Semantic query: runs search
src/cocoindex_code/project.py - Project manager → CocoIndex engine: configures runtime
src/cocoindex_code/project.py - Index flow → Source file matcher: selects source files
src/cocoindex_code/indexer.py - Index flow → Custom chunkers: uses chunkers
src/cocoindex_code/indexer.py - Index flow → Embedding factory: embeds chunks
src/cocoindex_code/indexer.py - Index flow → SQLite vector index: writes vectors
- Semantic query → Embedding factory: embeds query
src/cocoindex_code/query.py - Semantic query → SQLite vector index: searches vectors
src/cocoindex_code/query.py - Semantic query → Query schema: uses result schema
src/cocoindex_code/query.py - Embedding factory → LiteLLM embedder: creates provider
src/cocoindex_code/shared.py - Embedding parameters → Embedding defaults: uses defaults
src/cocoindex_code/embedder_params.py - Embedding parameters → Project settings: reads settings
src/cocoindex_code/embedder_params.py - CCC CLI → Literal grep: runs literal search
src/cocoindex_code/cli.py - Literal grep → Source file matcher: walks matching files
src/cocoindex_code/grep.py - Developer or agent → MCP server: uses MCP search
README.md