Skip to main content

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

context_pilot_mcp-0.1.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

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

context_pilot_mcp-0.1.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

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

Hashes for context_pilot_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b384c607145c80921817509aa424360806f14d816df760d76df5fea74c66aace
MD5 b02a347407ec3152e88bc2a3a714b1f4
BLAKE2b-256 8b665e1f44bbb5d706ee15129643b4b9d50e6d09ab51fa06304f352c2873ef9d

See more details on using hashes here.

File details

Details for the file context_pilot_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for context_pilot_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcc11459812288526dcf10683cc1944c9e3f54b350c4d1d867a3034b2cbce4f8
MD5 2de41ba4c73aa41622c13ef88d8c7837
BLAKE2b-256 77226763b4988f61c5c17a53ab51b1e5a313aa00e93af0be96f73039ca8d56b1

See more details on using hashes here.

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