Skip to main content
Glama

Scopix

Scopix picks the code an AI model needs for a task. Give it a task and a token budget, and it returns the most useful files, functions and line ranges, with a reason for each one. It runs on your machine with no account or cloud service. Local AI is optional and experimental.

Install

Scopix needs Python 3.11 or later.

pip install scopix

Related MCP server: Sippion

Quick start

cd your-repo
scopix init
scopix select "fix the authentication refresh logic" --budget 6000
scopix export "fix the authentication refresh logic" --budget 6000 --output context.md

init creates .scopix/ and indexes the repository. select prints the context, and export saves it. Each result looks like this:

### 1. `src/payments/retry-policy.ts` (lines 1-61, ~469 tokens)
**Why:** imported by tests/payment-retry.test.ts (distance 1); defines
`RetryPolicy.shouldRetryResult` which matches the task; matches task terms
`retry`, `payment`, `attempt`

Use with coding agents

Scopix can run as an MCP server, so agents such as Claude Code can ask it for context. See the setup guide for other clients.

pip install "scopix[mcp]"
claude mcp add scopix -- scopix serve --path /path/to/repo

Python API

from scopix import Scopix

with Scopix(".") as engine:
    engine.initialize()
    engine.index()  # only changed files are parsed after the first run
    result = engine.select("add retry handling", token_budget=4000)
    for item in result.items:
        print(item.path, item.start_line, item.end_line, item.tokens)
    print(result.to_markdown())  # or to_json(), to_text(), to_xml()

How well it works

On 45 unseen commits from 9 projects, Scopix found 39% of the changed files in 2,000 tokens, while grep needed 16,000 tokens to reach 38%. It still misses about 4 in 10 at 8,000 tokens. See the benchmark.

Commands

Command

What it does

scopix init

Create .scopix/ and build the index

scopix index

Update the index

scopix select "task"

Print context for a task

scopix explain "task"

Show why each item was chosen

scopix export "task"

Write context as Markdown, JSON, text or XML

scopix stats

Show index statistics

scopix graph

Show the dependency graph

scopix watch

Re-index when files change

scopix serve

Run an MCP server for coding agents

scopix bench

Compare results with simple baselines

scopix feedback

Mark a file as helpful or not

scopix profile

Manage selection profiles

scopix model

Set up an optional local AI model

scopix config

Show or change settings

Run scopix COMMAND --help for options, or see the reference.

Languages

Scopix parses TypeScript, JavaScript, Python, Go, Java, Rust, PHP and C#. It indexes other text files with less detail.

Privacy

By default, Scopix sends nothing over the network and never runs your code. It skips files that match secret patterns such as .env and *.pem. Some optional features use the network.

License

MIT. See LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to retrieve focused, bounded repository context locally and read-only, reducing token usage while never modifying the repository or executing its code.
      -
    • A
      license
      B
      quality
      B
      maintenance
      Enables coding agents to retrieve local, token-budgeted, source-traceable context from a workspace, with file:line provenance and selection receipts for chosen spans.
      5
      38 PyPI
      Apache 2.0
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI coding agents and IDEs to query a local structural code graph and retrieve focused, token-bounded context on code entities, Git relationships, callers/callees, impact, paths, and recorded mistakes for more efficient sessions.
      24 npm
      MIT