Skip to main content

The repo index that makes coding agents smart

Project description

Repox

The repo index that makes coding agents smart.

Repox scans any codebase and builds a persistent intelligence profile - 13 extraction dimensions covering everything from tech stack and architecture to auth flows, state machines, and security posture. Instead of starting from zero, your coding agent gets institutional knowledge so generated code fits the project like a senior wrote it.

What It Extracts

# Dimension What it captures
1 Tech Stack Language, framework, package manager, test runner, dependencies
2 Architecture Pattern detection (layered, DDD, MVC, hexagonal, flat, etc.)
3 Symbols Full AST symbol graph - functions, classes, methods, constants
4 Dependencies Import graph, call graph, PageRank-based file importance
5 API Surface HTTP endpoints, MCP tools, Celery tasks, WebSocket events
6 Data Models ORM entities, Pydantic models, Prisma schemas, field definitions
7 Design Patterns Factory, Builder, Observer, Repository, Middleware, Strategy
8 Infrastructure Docker services, env vars, deployment targets, external integrations
9 Conventions Naming, error handling, async patterns, import style, type hints
10 Test Patterns Framework, file naming, fixtures, mocking, assertion style
11 Hotspots Churn-complexity analysis, temporal coupling, knowledge islands
12 Custom Rules Team conventions from CLAUDE.md, .cursorrules, AGENTS.md, etc.
13 Behavioral Auth flows, state machines, middleware chains, background jobs, API contracts

Plus two cross-cutting layers:

  • LLM Interpretation - architecture insights, convention synthesis, and pattern enrichment beyond what static analysis finds
  • Security Posture - auth defaults, input validation, SQL safety, CORS, secret management, rate limiting

How to Use

1. Install

pip install repoxai

Requires Python 3.12+. Uses tree-sitter for language-independent AST parsing and LiteLLM for LLM features.

2. Configure LLM

An LLM is needed for repox scan (interpretation layer) and repox context (advisory briefs). repox show works without one, but only provides static analysis results.

export ANTHROPIC_API_KEY=sk-...   # or OPENAI_API_KEY or GEMINI_API_KEY

3. Commands

repox scan

Scan a repository and build the intelligence profile.

repox scan /path/to/repo          # incremental (skips unchanged files)
repox scan /path/to/repo --force  # full rescan
repox scan                        # scan current directory

This creates a .repox/ directory in the repo root with:

  • profile.json - full structured profile (all 13 dimensions)
  • profile.md - human-readable summary
  • hashes.json - SHA-256 file hashes for incremental scanning

repox show

Display the full codebase profile. No LLM needed.

repox show                # current directory
repox show /path/to/repo  # specific repo

Returns everything extracted - all 13 dimensions at full detail. When used with a coding agent, the agent's own LLM decides what's relevant.

repox context

Generate an LLM advisory brief for a specific task. Requires an LLM.

repox context "Fix the login bug in auth.py"
repox context "Add rate limiting" --target-files src/server.py
repox context "Refactor payments" --task-type refactor --target-files src/payments.py,src/billing.py

Returns a structured advisory with confidence-tagged sections (high/medium/low):

  • Recommendation - what to do and the approach
  • Files to Change - which files and why
  • Dependencies Affected - what might break
  • Risks & Side Effects - hotspots, knowledge islands, gotchas
  • Testing Strategy - how to test, matching existing patterns
  • Conventions to Follow - project-specific rules

The brief is advisory, not prescriptive - the host agent's LLM may be more capable and can override low-confidence recommendations.

repox learn

Teach Repox project-specific conventions that get reinforced over time.

repox learn "Use tenacity for retries" --category error_handling
repox learn "Use tenacity for retries" --category error_handling  # reinforces (confidence goes up)
repox learn "Always add type hints to public functions" --category typing --source review_pattern

repox learned

Show active learned rules.

repox learned                          # all rules above 40% confidence
repox learned --min-confidence 0.6     # only high-confidence rules
repox learned --category error_handling # filter by category

Learned rules are stored in profile.json and included in context briefs.

4. Agent Integration

The simplest way to give any coding agent codebase intelligence. Add one of these to your agent's rules file (CLAUDE.md, .cursorrules, AGENTS.md):

Without LLM - agent gets the full profile and interprets it:

Before starting any task, run `repox show` to understand the codebase structure, conventions, and patterns. Use this context to write code that fits the project.

With LLM - agent gets a task-specific advisory brief:

Before starting any task, run `repox context "<description of what you're about to do>"` with relevant --target-files to get an advisory brief. Use the recommendations to guide your approach, but apply your own judgment - especially for low-confidence suggestions.

5. MCP Server (optional)

For MCP-compatible agents (Claude Code, Cursor, Windsurf), Repox exposes a single get_context tool:

{
  "mcpServers": {
    "repox": {
      "command": "repox",
      "args": ["serve"]
    }
  }
}
  • get_context() - returns the full codebase profile (same as repox show)
  • get_context(task="...", target_files=["..."]) - returns an LLM advisory brief (same as repox context)

6. Python API

from repox import scan, generate_context, get_profile, serve

profile = scan("/path/to/repo")

context = generate_context(
    "/path/to/repo",
    task="Fix the login bug in auth.py",
    task_type="bug_fix",
    target_files=["src/auth.py"],
)

profile = get_profile("/path/to/repo")

serve("/path/to/repo")

Development

git clone https://github.com/kmandana/RepoX.git
cd RepoX
uv sync
uv run pytest
uv run repox scan .

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repoxai-0.1.0a1.tar.gz (94.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repoxai-0.1.0a1-py3-none-any.whl (83.5 kB view details)

Uploaded Python 3

File details

Details for the file repoxai-0.1.0a1.tar.gz.

File metadata

  • Download URL: repoxai-0.1.0a1.tar.gz
  • Upload date:
  • Size: 94.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for repoxai-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 4053a80c0eeba35f2be40e63c4251314ebdd0bc9ba9847614d482c3d18353cb5
MD5 0f3e3e349fd8b13911905a2a93ed26bb
BLAKE2b-256 9e37ddf456b39a60b03a2df331dd713a27da6791159b1ce183ecec5c7d0d606d

See more details on using hashes here.

Provenance

The following attestation bundles were made for repoxai-0.1.0a1.tar.gz:

Publisher: publish.yml on kmandana/RepoX

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file repoxai-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: repoxai-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 83.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for repoxai-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed506b959e88d9b58eac14d5fd56aa5f5cef44561bde0184de81de100cdeec10
MD5 5fba04320234244bc1a7a50d07453482
BLAKE2b-256 49eaf6ec87887665428a902018f8114db1e95f97b44833c69147891f91b654e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for repoxai-0.1.0a1-py3-none-any.whl:

Publisher: publish.yml on kmandana/RepoX

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page