---
title: "CocoIndex Code: the code intelligence layer for AI agents"
description: "CocoIndex Code Plus (ccx) keeps a live index of the codebase across the organization: search by meaning, structural grep, symbol definitions and references, cited answers. Runs on-prem, queried by agents and people over CLI and MCP."
canonical: https://cocoindex.io/cocoindex-code/
last_updated: 2026-11-05
---

# The code intelligence layer for AI agents.

> CocoIndex Code Plus (ccx) keeps a live index of the codebase across the organization: search by meaning, structural grep, symbol definitions and references, cited answers. Runs on-prem, queried by agents and people over CLI and MCP.

Last updated: 2026-11-05 · Canonical: https://cocoindex.io/cocoindex-code/

CocoIndex Code Plus (ccx) keeps a live index of your whole codebase: search by meaning, structural grep, every symbol's definitions and references. Agents query it instead of grepping; people ask it how the software works. It runs on-prem.

[Book a 30-min call](https://calendly.com/linghua-cocoindex/30min)
[Docs on GitHub](https://github.com/cocoindex-io/cocoindex-code-plus-pub)

Thirty minutes with the team that runs the pilot: we scope one on your repositories, no commitment.

Figure: Overview: code review agents, software harnesses, individual developer harnesses, knowledge engines and customer support all call CocoIndex Code Plus through its API, CLI, MCP server and plain-language query API. ccx searches code and documents by meaning, greps structurally or as text, goes from a symbol to its definition and references, shows code with progressive disclosure, and answers questions with grounded answers. It has single sign-on through your identity provider mapped to Git host identity, a Git host app for onboarding, and ccx Insights for usage, cost and savings. It reads a codebase index in Postgres inside your network, built incrementally per branch from your GitHub or GitLab repositories.

One index of your whole codebase, kept current as code changes, behind one API that every agent and every person can use.

## What an agent can do with ccx.

Below, an agent tracks a charge that is retried too often across two repos. Each step is one command in place of a clone and a file-by-file search. Results come back short and cited to file and line, so the agent spends its tokens on the task, not on reading.

agent session · ccx
acme/billing @ main

```console
$ ccx search 'retry a charge after a gateway timeout' --repo acme/billing --repo acme/gateway
[0.534] acme/billing billing/charge/retry.py
 38| class RetryPolicy:
 41:     def schedule_retry(self, charge: Charge, err: GatewayTimeout) -> RetryTicket:
 42:         delay = self.backoff.next_delay(charge.attempts)
---
[0.488] acme/gateway src/clients/billing.ts
 57:   if (err.code === 'DEADLINE_EXCEEDED') return retryCharge(req, { attempt: n + 1 });

$ ccx refs RetryPolicy.schedule_retry --role call
billing/charge/service.py:212:20 [call]
  resolved  → billing/charge/retry.py RetryPolicy.schedule_retry  in ChargeService.capture
billing/webhooks/processor.py:88:12 [call]
  resolved  → billing/charge/retry.py RetryPolicy.schedule_retry  in on_gateway_timeout

$ ccx grep --text 'MAX_CHARGE_RETRIES'
billing/charge/retry.py:17:MAX_CHARGE_RETRIES = int(os.getenv("MAX_CHARGE_RETRIES", "4"))
deploy/helm/billing/values.yaml:57:    MAX_CHARGE_RETRIES: "6"

$ ccx ask 'why do charges retry past MAX_CHARGE_RETRIES?' --repo acme/billing --repo acme/gateway
Investigating — an agentic answer can take minutes...
Retries stack in two layers. The gateway retries a timed-out charge call itself,
up to 3 times [s1:src/clients/billing.ts#L52-L61]. In billing, both
`ChargeService.capture` and the timeout webhook call `schedule_retry`, and each keeps
its own attempt count [s0:billing/charge/service.py#L205-L218]
[s0:billing/webhooks/processor.py#L80-L95].

So the limit of 6 set in production applies per path, not per charge
[s0:deploy/helm/billing/values.yaml#L57].

s0: acme/billing @ heads/main (commit 3f9c2a1e07b4)
s1: acme/gateway @ heads/main (commit 9b07d4e1c2a8)
follow-up: ccx ask --parent 7e3a0012 "<question>"
```

## What ccx gives you out of the box.

Four things every deployment includes, with no custom build.

[Deployment guide →](https://github.com/cocoindex-io/cocoindex-code-plus-pub/blob/main/docs/deploy.md)

### Large repos, many branches

Figure: Three branches, main, v2.1-lts and release/3.0, share the same indexed files; only the one file that differs on a branch is processed for it

A repository can be indexed at several long-lived branches, for example one per long-term-support version. Each file is processed once and shared by every branch that holds it. The symbol graph is updated incrementally rather than rebuilt after every merge.

### Versatile indexes

Figure: Three indexes per branch: embeddings of structural chunks, a symbol graph of definitions and references for nine languages, and a text index for grep

For each indexed branch, beyond embeddings of structurally chunked code, ccx extracts every symbol’s definition and the references to it for Python, TypeScript/JavaScript, C/C++, Objective-C, C#, Rust, Java, Go and Kotlin, and builds a text index that makes grep fast across every file.

### One query layer for every client

Figure: A plain-language question enters ccx, an agent inside picks the symbol graph, and a cited answer comes back

Beyond an API for each index, ccx offers a plain-language query API: send a question and get an answer grounded in the code it was read from, with citations. An agent inside ccx picks the right index, so clients integrate without choosing among indexes.

### Enterprise controls

Figure: A person signs in through the identity provider, is mapped to their Git host account, and sees three of four repositories

Single sign-on through your identity provider, with each login mapped to the user’s Git host identity, so a user sees only the repositories they can already read. A Git host app for onboarding. ccx Insights for usage, cost and savings across the deployment, also from the ccx usage command.

## Answers about your code for the whole organization.

ccx is not only for coding agents. Anyone with access can ask a question about your software in plain English and get an answer cited to the exact files, from the latest code, limited to the repos they are allowed to read. People stop waiting on the one engineer who knows a service.

### Program managers

Which services does this feature touch? Where is this setting read?

ccx ask · example: Which services does the invoicing feature touch?

> Three. `billing` owns it: `InvoiceService.issue` totals the order, applies tax and stores the invoice [s0:billing/service/invoice.py#L40-L96]. `gateway` exposes it to the web app as `POST /v2/invoices` [s1:src/routes/billing.ts#L12-L58]. `notify` emails the PDF when the `invoice.issued` event arrives [s2:internal/handlers/email.go#L120-L141].
>
> - **s0:** acme/billing @ heads/main (commit 3f9c2a1e07b4)
> - **s1:** acme/gateway @ heads/main (commit 9b07d4e1c2a8)
> - **s2:** acme/notify @ heads/main (commit c41e8a05d3f6)

### Test and QA engineers

Where is this error message raised? Which code calls this function? Where are the tests for this module?

ccx ask · example: Where is "payment declined" raised, and who calls it?

> `ChargeService.capture` raises `CardDeclined("payment declined")` when the processor returns `card_declined` [s0:billing/service/charge.py#L210-L224]. Two paths reach it: checkout, through the gateway [s1:src/routes/checkout.ts#L64-L90], and the nightly renewal job [s0:billing/jobs/renew.py#L31-L58]. Only the checkout path has a test [s0:billing/tests/test_charge.py#L88-L130].
>
> - **s0:** acme/billing @ heads/main (commit 3f9c2a1e07b4)
> - **s1:** acme/gateway @ heads/main (commit 9b07d4e1c2a8)

### Security and DevSecOps

Where do we handle authentication tokens? Which repos call this library? Where does user input reach this database?

ccx ask · example: Where do we handle authentication tokens?

> In one place. `verify_token` checks the signature against the KMS key and rejects tokens older than 15 minutes [s0:auth/token/verify.py#L18-L74]. The gateway calls it on every request from its auth middleware [s1:src/middleware/auth.ts#L30-L61]. The signing key is created in Terraform and rotates every 90 days [s2:terraform/kms.tf#L1-L22].
>
> - **s0:** acme/auth @ heads/main (commit 5d2e90b7a1c3)
> - **s1:** acme/gateway @ heads/main (commit 9b07d4e1c2a8)
> - **s2:** acme/infra @ heads/main (commit e86f13c94b20)

### Support and field engineers

Why does the product behave this way? Which configuration flag controls it, and what is its default?

ccx ask · example: Which flag controls retry on timeout, and what is its default?

> `retry_on_timeout`. It is on by default: up to 3 attempts, with backoff starting at 500 ms [s0:core/config/flags.py#L140-L152]. An admin can turn it off for one workspace with `workspace.settings.retry_on_timeout = false`; the operator guide documents the override [s0:docs/ops/configuration.md#L77-L90].
>
> - **s0:** acme/core @ heads/main (commit 7a41c0d9e5b2)

### New engineers

How does a request flow through our services? Which repo owns this code?

ccx ask · example: How does a request flow from the gateway to billing?

> The gateway authenticates the request, then its billing router forwards it over gRPC [s0:src/server.ts#L1-L40] [s0:src/routes/billing.ts#L12-L58]. In `billing`, `InvoiceService` handles the call, writes the invoice and its line items in one Postgres transaction, and publishes `invoice.issued` for `notify` [s1:billing/service/invoice.py#L40-L96].
>
> - **s0:** acme/gateway @ heads/main (commit 9b07d4e1c2a8)
> - **s1:** acme/billing @ heads/main (commit 3f9c2a1e07b4)

Limited to the repos this person can read on the Git host.

## Enterprise engineering

Code Review, Software Factory, Knowledge engine

Code review approval
**40% → 90%+**

Developer approval of AI code review findings, from launch to the whole codebase in context through CocoIndex.

Every pull request goes through it.

On improving developer approval

> “I don't think we can ever achieve that without CocoIndex.”

Technical leader at an enterprise software company

## On-prem deployment for controlled code.

Two container images and a Helm chart on your Kubernetes; the index in your Postgres. Everything inside the boundary below runs on your infrastructure, and developers reach it the way they reach your other internal services.

[Deployment guide →](https://github.com/cocoindex-io/cocoindex-code-plus-pub/blob/main/docs/deploy.md)

Figure: Deployment: inside your Kubernetes cluster, your Git hosts feed the ccx indexer, which writes chunks, embeddings and the code graph to Postgres on an incremental cycle. The ccx query server signs each developer in through your identity provider, applies per-repo read permission, and answers agents over your VPN. The indexer and the query server call embedding and language models on endpoints you approve inside the boundary.

The only things that cross the boundary are container images and license keys coming in. Code, embeddings and queries stay inside.

## Sensitive data stays sensitive.

Source code often holds what you least want copied around: credentials in old commits, customer names in test fixtures, controlled technical data. ccx is built so that the index never becomes a second, looser copy of it.

[Security guide →](https://github.com/cocoindex-io/cocoindex-code-plus-pub/blob/main/docs/security.md)

### Nothing leaves your boundary.

Code, embeddings, the code graph and every query stay on infrastructure you control. There is no CocoIndex service in the data path and no telemetry of your code.

### Permissions follow the source.

With code-host-mirrored authorization, every answer is filtered by what the signed-in person can read on your Git host, so a search or a generated answer never reveals a repo they could not open.

### Deletes and purges propagate.

Indexing is incremental in both directions. When a file is removed or history is rewritten, the index drops it on the next cycle.

### Exclusions you control.

Configuration keeps chosen repos, paths and file types out of the index; binary, generated and oversized files are skipped by policy.

### Every request on record.

The query server writes a structured JSON audit stream of who asked what and when, for your SIEM, and keeps usage history in your database.

### Models you approve.

Embedding and language-model calls go through a model router to the endpoints you configure, so code is never sent to a model you have not cleared.

## ccx Insights: usage, cost and savings.

Who is using the deployment, what its model calls cost, and what the caching saved. Computed by the two services you already run and stored in your own database; nothing leaves the deployment. Below, the overview of an example deployment, some two thousand developers and their agents, over one week.

[How Insights works →](https://github.com/cocoindex-io/cocoindex-code-plus-pub/blob/main/docs/insights.md)

Figure: ccx Insights overview for an example deployment, 1,240 repositories, Oct 27 to Nov 2: 2,140 active developers, 31.3 million queries, 27.1 thousand agentic queries; queries per day, lower on the weekend; and model cost per day, $22.9K spent and $167K saved by reuse.

## Questions.

These cover CocoIndex Code Plus. The open-source `ccc` CLI and MCP server has its own pages.

[Answers about code search for coding agents →](https://cocoindex.io/answers/)

### What is CocoIndex Code Plus?

A self-hosted code intelligence service for AI agents and people. An indexer keeps every repository on your code hosts indexed in your Postgres; a query server answers search by meaning, structural and text grep, symbol definitions and references, file reads and cited answers through the `ccx` CLI, a REST API and an MCP endpoint, with SSO through your identity provider.

### Which agents and tools can use it?

Any client that speaks the Model Context Protocol, over HTTP, with the same API token or SSO login; the `ccx` CLI for terminals, scripts and CI; a Claude Code plugin and an agent skill that send the agent to ccx before it greps. Code review bots and internal knowledge engines call the same API.

### Where does it run, and what leaves the network?

The indexer and query server run on your Kubernetes from a Helm chart; the index lives in your Postgres with pgvector. CocoIndex operates no service in the data path and receives no customer data. Embedding and language-model calls go to the endpoints you configure. See the [security guide](https://github.com/cocoindex-io/cocoindex-code-plus-pub/blob/main/docs/security.md).

### How do people sign in?

Through your identity provider with OIDC (Entra ID, Okta, Keycloak, Auth0, Ping; Google Workspace and SAML-only IdPs through a federated authorization server). CI and agents use labelled, revocable API keys. With code-host-mirrored authorization each person sees only the repositories they can read on the Git host. See the [SSO guide](https://github.com/cocoindex-io/cocoindex-code-plus-pub/blob/main/docs/sso.md).

### What does it cost?

The `ccx` client is free on PyPI. The indexer and query server are licensed per deployment; pricing is quoted per deployment. [Book a call](https://calendly.com/linghua-cocoindex/30min) or see [CocoIndex Plus](https://cocoindex.io/enterprise/) for the data framework behind it.

### One index of the whole codebase, for every agent and every person.

We deploy inside your environment with your DevSecOps team and your developers, from the security review to the readout.

[Book a 30-min call](https://calendly.com/linghua-cocoindex/30min)
[Docs on GitHub](https://github.com/cocoindex-io/cocoindex-code-plus-pub)

## Sitemap

- [Home](https://cocoindex.io/index.md)
- [Documentation](https://cocoindex.io/docs/)
- [Blog index](https://cocoindex.io/blogs.md)
- [Site index (llms.txt)](https://cocoindex.io/llms.txt)
- [Markdown sitemap](https://cocoindex.io/sitemap.md)
- [XML sitemap](https://cocoindex.io/sitemap.xml)
