index_codebase
Builds a semantic search index for an entire codebase, running in background by default and returning a project overview while embeddings are generated.
Instructions
Indexes the entire codebase for semantic search.
Limited to 5000 files per operation. For large codebases use index_changed_files() instead.
By default runs in **background** mode: returns immediately with a project
structure overview while the heavy embedding work continues in a daemon thread.
Call `get_index_progress()` to poll completion status.
Args:
force: If True, clears existing index before indexing.
background: If True (default), runs indexing in a background thread and
returns immediately with a project overview. If False, blocks
until indexing is fully complete (old behaviour — may timeout
on large codebases).
Returns:
- background=True: instant project structure overview + status line
- background=False: final indexing stats string
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | ||
| background | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |