Universal context manager for AI coding agents
Project description
context-pilot
Universal context manager for AI coding agents.
It tracks file relevance, compresses stale files, and evicts dead weight to keep your agent's context window optimized. Works with aider, Claude Code, Cursor, or anything that reads files.
Features
- Per-file event tracking and state management
- Staleness scoring engine
- AST-based file compression
- Eviction decision engine
Installation
pip install -e .
Usage
CLI Adapter
You can use context-pilot in any terminal:
# Track files and events
context-pilot track src/api.py --event added
context-pilot advance
# Evaluate when context gets full
context-pilot evaluate-context
MCP Server (Claude Code / Cursor)
Run the MCP server to let AI agents automatically read/compress/evict files:
{
"mcpServers": {
"context-pilot": {
"command": "context-pilot-mcp"
}
}
}
Configuration
You can configure behavior by placing a .context-pilot.toml file in your project root:
[context-pilot]
mode = "suggest" # "suggest", "auto", or "off"
pressure_threshold = 0.8 # Trigger eviction when window is 80% full
stale_after_turns = 5 # Unreferenced turns before considering stale
edit_stickiness = 3 # Edited files stay in context for N extra turns
compress_before_drop = true # Try AST compression before full eviction
max_context_tokens = 128000 # Your model's context window size
min_staleness_to_flag = 0.6 # Only flag files that are at least 60% stale
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file context_pilot_mcp-0.1.0.tar.gz.
File metadata
- Download URL: context_pilot_mcp-0.1.0.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b384c607145c80921817509aa424360806f14d816df760d76df5fea74c66aace
|
|
| MD5 |
b02a347407ec3152e88bc2a3a714b1f4
|
|
| BLAKE2b-256 |
8b665e1f44bbb5d706ee15129643b4b9d50e6d09ab51fa06304f352c2873ef9d
|
File details
Details for the file context_pilot_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: context_pilot_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcc11459812288526dcf10683cc1944c9e3f54b350c4d1d867a3034b2cbce4f8
|
|
| MD5 |
2de41ba4c73aa41622c13ef88d8c7837
|
|
| BLAKE2b-256 |
77226763b4988f61c5c17a53ab51b1e5a313aa00e93af0be96f73039ca8d56b1
|