Get Started With SourceIndex

Welcome to SourceIndex!

SourceIndex plugs into your coding agent as a CLI in Claude Code and OpenCode, and as MCP tools in Codex, so that the agent searches a prebuilt index of your repository and jumps straight to the right files and functions. Want to see it first? Watch the demo.

Before you begin

Make sure you have:

  • Python 3.10+ on macOS and Linux. (Windows isn't supported natively yet)
  • A code project to work with Claude Code, Codex or OpenCode (only these agents are supported at present)
  • A SourceIndex API key (it starts with sk-si-) — apply for access here

Setup with a Few Steps

  1. Install SourceIndex.
    Show installation steps
    macOS & Linux
    1. pip install sourceindex
    2. Confirm the installation worked.
      sourceindex --version
    3. In your repository, set SourceIndex up in your agents.
      cd /path/to/your/repository
      sourceindex init claude # Claude Code only
      sourceindex init codex # Codex only
      sourceindex init opencode # OpenCode only
      sourceindex init # all

    If the repo has no CLAUDE.md or AGENTS.md yet, run /init in your agent first.

    Heads-up before you run it: SourceIndex sends your source files to our backend for processing — your code isn't stored. Exactly how that works: Security & Data Handling.

  2. Open your agent. Open an existing repository and try to use claude, codex or opencode to enter the agent and work with SourceIndex.
  3. Complete your first task using SourceIndex. Ask questions regarding the repository. SourceIndex will be invoked automatically. Here is the prompt “tell me what this repo for” in each supported agent:
    Show examples
    A Claude Code session. The user asks what this repo is for; the agent runs sourceindex search with the request, and the status line reads: sourceindex is running.
    Claude Code. Ask your agent about the code as you normally would. Before it answers, it runs sourceindex search on its own — init told it to — and gets back a roadmap of the exact files and functions for the task. While that runs, the status line shows sourceindex is running.
    A Codex session, with the OpenAI Codex header box at the top. The user asks what this repo is for; the agent calls the sourceindex search_index tool and the codebase roadmap comes back.
    Codex. SourceIndex is registered as an MCP server, so the agent calls its search_index tool first, then reads the exact files and functions the roadmap points to.
    An OpenCode session. The user asks what this repo is for; the agent runs sourceindex search with the request as the query.
    OpenCode. The agent runs sourceindex search with your request as the query and gets back a roadmap of the exact files and functions for the task.

Explore SourceIndex

The savings line

After each turn, SourceIndex tells you what it saved in this session and over the past week — an estimate built from your agent's own token counts. Each agent shows it in its own way.

Show the savings line
The Claude Code status line reading: SourceIndex saved $0.18 this session, $12.09 in the past 7 days.
Claude Code. In the status line under the prompt, updated after every turn.
Codex, after a turn finishes: Stop (completed) says: SourceIndex saved $0.11 this session, $8.36 in the past 7 days.
Codex. As a message when a turn finishes, just above the prompt.
An OpenCode notification reading: SourceIndex saved $0.06 this session, $3.74 in the past 7 days (use the command sourceindex savings to find more information).
OpenCode. As a notification that pops up after a turn.

The savings report

Run sourceindex savings in your terminal for the full picture: the past 7 days in total and day by day, plus your best day and what SourceIndex has handled in the last 30 days.

Show the savings report
Output of sourceindex savings: a past-7-days total across sessions and searches, searches and savings per day, and a summary of the best day, jobs done, savings, and files and functions handled in the last 30 days.

Essential commands

Here are the most important commands for daily use. Shell commands run from your terminal.

Shell commands

CommandWhat it does
sourceindex deinit --force Remove SourceIndex from a repository
sourceindex api-key set [KEY] Replaces the stored API key.
sourceindex savings Prints the savings from the local ledger.
sourceindex doctor Checks the install end to end.

Feedback

We're early, and every bit helps — even “I can't tell if it's working” is useful. Write to [email protected].

For more questions, see the FAQ.