Skitflow
Code Review

Code Intelligence

The Code Review context layer that indexes a repository's default branch and searches it semantically to give reviews codebase-aware context.

Code Intelligence is the context layer inside Code Review, not a separate product. It indexes a connected Code Review repository's default branch into files and symbols, and — when a vector database is configured — semantic embeddings, so an automated review can pull in relevant context from the rest of the codebase instead of only the diff.

Without it, a review sees only the diff. With it, a review can answer "where else does this pattern live?" before it comments.

Availability

Code Intelligence needs three things to be true at once:

  1. The code_review.intelligence feature flag is on for the organization (Dashboard → Settings → Code Review → Feature availability). This is the deployment-wide kill switch for indexing and repository-aware review context.
  2. The organization is entitled to it: on Cloud, the Pro tier or above (platform admins always pass); self-hosted, an active enterprise license.
  3. Code Intelligence (repository-aware reviews) is enabled for the repository. Like Review skills, this setting inherits from organization to project to repository — leave it unset to inherit, or override it at a narrower scope.

The repository must also be an active, connected Code Review repository. listRepositoryStatus reports the repository as disabled rather than erroring when any gate fails; reindexRepository instead throws PRECONDITION_FAILED if Code Intelligence is disabled. semanticSearch and disableRepository don't check these gates themselves.

Indexing

Indexing always targets the repository's configured default branch — there is no per-branch indexing.

  • Automatic — a push to the default branch (observed through the Code Review webhook) enqueues a reindex after a short debounce, as long as Code Intelligence is enabled and the provider installation is active.
  • Manual — codeIntel.reindexRepository queues a full reindex of the current default-branch head. If a snapshot for that branch is already queued, cloning, parsing, or embedding, it returns that in-flight snapshot instead of creating another one. It requires the code_review.manage_repositories permission and at least one previously observed branch head (Skitflow must have seen a push to the branch before it can index it).

A snapshot moves through queued → cloning → parsing → embedding → ready, or failed. Only one ready snapshot exists per repository branch at a time — an older ready snapshot superseded by a new one moves to obsolete. Once ready, a snapshot records its commit, file count, symbol count, and a per-language file breakdown.

codeIntel.listRepositoryStatus returns this state per repository in a project, and backs the Code Intelligence panel on the Code Review repository settings page, which polls every 5 seconds while a snapshot is actively indexing. It requires the code_review.read permission.

codeIntel.semanticSearch embeds a natural-language query and returns the closest indexed code chunks from one snapshot, ranked by cosine similarity:

POST /api/trpc/codeIntel.semanticSearch
{
  "repositoryId": "...",
  "snapshotId": "...",
  "query": "where do we validate webhook signatures?",
  "limit": 10
}

Each result includes the file path, an optional symbol id, the matched content, and a score between 0 and 1. Results with a cosine distance greater than 0.6 are dropped rather than returned as weak matches. limit accepts 1–50 and defaults to 10.

If no vector database is configured, or the embedding call fails, the endpoint returns { "unavailable": true } instead of an error — callers should treat that as "not available right now," not as a failed request.

semanticSearch requires the code_review.read permission and organization membership; members additionally need access to the repository's project.

Disabling and cleanup

codeIntel.disableRepository turns off the per-repository setting and schedules cleanup of that repository's stored index data (snapshots, files, symbols, and embeddings). It requires the code_review.manage_settings permission.

Cloud vs self-hosted

Code Intelligence is available on both Cloud (Pro tier and above) and self-hosted (with an enterprise license and the feature flag enabled) — see Availability. All codeIntel endpoints are tRPC-only: they back the Code Review dashboard UI and are not part of the REST/OpenAPI API reference.

On this page