Redcon is a deterministic context budgeting tool for AI coding agents, with the goal of reducing token usage and wasted requests. It selects, compresses, caches, and budget-controls repository context so that coding agents only receive what the task actually needs.
Purpose
AI coding agents are often drained of large numbers of tokens by irrelevant context: either the entire repository is stuffed in and billed at 200,000 input tokens per request, or the agent blindly greps, wasting tool calls to locate things. Redcon solves both problems at once: it ranks files by task relevance, uses language-aware compression strategies, and packs the results within a token budget. The whole process is deterministic, local-first, and does not use embeddings. One MCP service covers Claude Code, Cursor, Windsurf, Cline, and Zed, while the regular CLI covers CI. The repository's own measurements show input tokens reduced by more than 83% under equivalent task coverage.
For fixed subscriptions (Claude Pro/Max, Cursor, GitHub Copilot), the pain point is not the token bill but the usage cap. Redcon lowers the tokens required per task, so the same subscription can cover more work before hitting the weekly limit.
Main capabilities
- Deterministic scoring: keyword matching, import graph, file roles (test/documentation/production), git history.
- Language-aware compression: supports Python, TypeScript, JavaScript, Go, Rust, Java, and others, with strategies including full text, snippets, symbol extraction, and summaries.
- Command-line output compression: 20 compressors covering git, test runners, grep/rg, directory listings, lint, docker, package installs, kubectl, profilers, JSON logs, coverage, SQL EXPLAIN, and bundle stats; the COMPACT level can reduce 70–99%.
- Incremental scanning: cached file metadata with git-aware change detection.
- Multi-repository workspaces: a single task across multiple repositories with shared configuration.
- Budget policies: enforce maximum tokens, quality risk levels, and file counts in CI.
- Quality assurance framework: each compressor declares must-preserve regex assertions, is deterministic, and is robust to truncated/binary input.
- Streaming runner: chunked Popen reader, memory-bounded, reachingEarly SIGTERM/SIGKILL when the output limit is reached.
- Run history: SQLite-backed artifact storage that saves both file bundles and command runs, supporting diff/heatmap/drift analysis.
- Cost analysis: estimates token costs for models such as GPT-4o and Claude.
- PR audit: detects context growth in pull requests.
- Plugin system: custom scorers, compressors, token estimators, summarizers.
- Cache backends: in-memory, local files, Redis.
- Doctor command: diagnoses the environment, Python version, disk space, git availability.
Usage
Option 1: VS Code extension (simplest)
Install Redcon - Context Budget from the marketplace; open the Redcon sidebar, click Install & Set Up; reload the window and you're done. The extension installs the CLI via pip, registers MCP services for Claude Code, Cursor, and Windsurf, and provides a sidebar with budget analysis, file ranking, and a compression dashboard.
Option 2: CLI + MCP service
The init command automatically configures MCP for Claude Code, Cursor, and Windsurf, and also configures it when VS Code, Codex CLI, Gemini CLI, Junie CLI, Cline, and Zed are detected, enabling AI agents to call redcon_rank, redcon_search, redcon_compress, and redcon_budget as native tools. It also writes a short AGENTS.md section telling agents to prioritize these tools when selecting context.
Option 3: CLI only
Output is written to run.json (machine-readable) and run.md (human-readable). It can be used in CI, or to feed compressed context directly to an agent.
The MCP integration uses a pull model: instead of pushing a large 30k-token chunk to the agent, it exposes 9 MCP tools for the agent to call on demand. A typical agent exploration flow uses about 5k tokens instead of a 30k chunk. Configuration is automatically written to .mcp.json (Claude Code), .cursor/mcp.json (Cursor),~/.codeium/windsurf/mcp_config.json (Windsurf).
Command-line output compression wraps calls via the redcon_run MCP tool (and the redcon run CLI), parses the output, and returns a budget-aware compressed view that preserves every fact the agent actually needs. Quality is enforced separately: each compressor declares must_preserve_patterns, and the M8 quality framework rejects any compressor that loses original input facts in the compressed output, and can be run as a CI step.
Cross-call dimensions: on top of single-call compression, four layers of mechanisms combine across the entire agent session — path aliases (repeated paths collapse to f001 on subsequent occurrences, lazily on first use, never net negative), a content reference ledger (passage blocks over 6 cl100k tokens get a session-stable {ref:001} alias on their second and later occurrences), symbol aliases (CamelCase types/multi-word snake_case identifiers collapse to c001 aliases), and snapshot diffing against the previous call (when the same argv is run again, only the delta is sent, using pattern-aware renderers for pytest, git_diff, and coverage, always taking min(cost_delta, cost_abs)). Invariant certificate (V93): every COMPACT/VERBOSE output is stamped with mp_sha=<16hex>, and auditors can recompute the certificate over the compressed text to detect spurious additions or capture dilution. Measurements on 5 simulated agent sessions show that the cross-call layers add +8.3% session-level savings on top of single-call compressors, +15% for high-overlap sessions (debugging, search-edit), and near zero for disparate-content sessions.
Applicable scenarios
- Developers who program with tools such as Claude Code, Cursor, Windsurf, Cline, and Zed and want to reduce token consumption.
- Teams that enforce constraints on context budget, quality risk, and file count in CI.
- Scenarios that need to span multiple repositories within a single task, implemented via workspace TOML configuration (the workspace file is placed in the folder containing all repositories; repository paths must resolve within that folder and cannot go outside it).
- PR review workflows that want to audit compression quality and detect context growth.
Limitations and notes
- The repository uses the Functional Source License, FSL-1.1-MIT license: free to use for any purpose, but you may not build a competing commercial product or service; each release automatically converts to the MIT license two years after its release.
- The hosted Redcon Cloud control plane (organizations, quotas, usage metering, billing, team dashboards) is separate commercial software maintained in a private repository.
- For commercial licensing, contact: natjiks@gmail.com
- Specific installation commands, Python API details, configuration field descriptions, migration notes, and similar content are not provided in this material; refer to its documentation.
- No pricing, details beyond the scope of platform support, or other effect promises are provided.