pip install llm-context-router

Scope your AI context
before it explodes.

A minimal CLI tool that routes AI coding tasks to the right agent and scopes the prompt to only the relevant files.
No LLM calls. No automation. No magic.

$ pip install llm-context-router

The problem with AI coding tools

Before
You ask: "fix the auth bug"
AI loads 847 files
touches 6 modules it shouldn't
breaks unrelated code
costs you 40k tokens
After (with llm-context-router)
$ llm-context-router ask "fix the auth bug" \
--file src/auth/token.py

Agent: backend
Files: src/auth/token.py, src/auth/session.py
Prompt: Touch only these files.
Do not modify: src/api/, src/db/

Three commands. Full control.

01
Init your project
$ llm-context-router init --tool claude

Creates .context-router/ with memory files, agent templates, and CLAUDE.md wired up.

02
Route your task
$ llm-context-router ask "fix login form" \
--file src/frontend/login.js

Prints a scoped prompt. Paste it into your AI tool.

03
Validate + retry
$ llm-context-router run --continue

# Validates the diff. Retries with constraints if it fails.
PASS → apply.  FAIL → patched prompt generated.

Validates the diff. Retries with constraints if it fails.

What it does not do

Your project gets a memory

.context-router/
.context-router/
├── CORE.md                     ← global invariants
├── CORE_LITE.md                ← quick task version
├── project_map.json            ← agent ownership map
└── memory/
    ├── MEMORY.md               ← status + recent fixes
    ├── MEMORY_MAP.md           ← file ownership
    ├── MEMORY_CHANGELOG.md     ← full history
    ├── MEMORY_INTELLIGENCE.md  ← domain knowledge
    └── MEMORY_REFERENCE.md     ← lessons learned

Works with your stack

Claude Code
Cursor
GitHub Copilot
Codex
Windsurf
Aider

One init command generates the right config for your tool.

$ llm-context-router init --tool cursor

Install and go

$ pip install llm-context-router
$ cd your-project
$ llm-context-router init --tool claude
$ llm-context-router ask "your task" --file path/to/file.py