> ## Documentation Index
> Fetch the complete documentation index at: https://docs.overcut.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Repository Code Indexing

> Enable semantic code search to help agents find relevant context faster. Learn how to set up, trigger, and monitor code indexing.

## Overview

Code Indexing creates a semantic index of your repository, allowing agents to search code by meaning rather than just keywords. When enabled, agents can find relevant APIs, understand code relationships, and locate files more efficiently.

Once enabled, indexing runs automatically whenever your repository cache is refreshed. The system detects changes since the last update and only re-indexes modified files, keeping the index current with minimal overhead. You can also trigger indexing manually at any time from the repository settings page.

<Note>
  **Semantic search is optional.** Agents work effectively without code indexing by using standard file searches, grep, and glob patterns. Code indexing provides an additional search capability that can help agents find context more efficiently, but it is not required.
</Note>

### How agents use semantic search

When Code Indexing is enabled, agents automatically gain access to a semantic search tool alongside their standard search capabilities (file search, grep, glob). Agents intelligently choose the best tool for each situation: using semantic search when looking for conceptually related code and standard searches for exact matches.

**No configuration required.** You don't need to instruct agents to use semantic search or modify your workflows. Once indexing is enabled, agents transparently leverage the semantic index when it's helpful, falling back to standard searches when the index isn't available or when exact matching is more appropriate.

<Warning>
  Code Indexing is **disabled by default**. To use this feature, you must enable it in repository settings. Additionally, **Repository Caching must be enabled first**. The indexer uses the cached repository snapshot to process files.
</Warning>

## Prerequisites

Before enabling Code Indexing, ensure you have:

1. **Repository Caching enabled** – Code Indexing requires caching to be enabled first. See [Repository Caching](/docs/repositories/repository-caching) for setup instructions.

## Enabling Code Indexing

<Steps>
  <Step title="Open repository settings">
    Navigate to **Integrations → \[Your Organization] → \[Your Repo]** and open the repository settings.
  </Step>

  <Step title="Enable Repository Caching">
    If not already enabled, turn on **Repository Caching** first. This is a prerequisite for code indexing.
  </Step>

  <Step title="Enable Code Indexing">
    Turn on the **Code Indexing** toggle. The first indexing job will queue automatically once the cache is ready.
  </Step>

  <Step title="Save Changes" />
</Steps>

## How indexing works

### Automatic updates

Once Code Indexing is enabled, the system keeps your index up to date automatically:

* **After cache refresh** – Whenever the repository cache is refreshed, indexing runs automatically
* **Incremental updates** – The indexer compares the current code to the last indexed version and only re-processes changed files
* **Branch coverage** – By default, Overcut indexes the repository's default branch

### Manual triggers

Use the **Index Now** button in repository settings to trigger indexing immediately. This is useful when:

* You've made large refactors and want the index updated right away
* You're switching default branches
* Agents are referencing outdated code and you don't want to wait for the next automatic update

<Steps>
  <Step title="Open repository settings">
    Go to **Integrations → \[Your Organization] → \[Your Repo] → Code Indexing**.
  </Step>

  <Step title="Click Index Now">
    Click the **Index Now** button. For non-default branches, expand **Advanced options** and specify the branch.
  </Step>

  <Step title="Confirm the job started">
    A success message confirms the indexing job has been queued. You can monitor progress in **Executions** list.
  </Step>
</Steps>

## Monitoring indexing runs

### Workspace Runs

Indexing jobs appear in **Executions** alongside your other workflow executions. You can:

* View real-time progress as files are processed
* See detailed logs for each stage (clone, analysis, indexing)
* Compare current runs with historical performance
* Diagnose issues if a run fails
