redcon_run
Run shell commands and get compressed output with guaranteed token limits. Use for test runs, diffs, and logs to avoid overwhelming LLM context.
Instructions
Run a shell command and return its output compressed for LLM consumption via schema-aware compressors (pytest, git diff/status/log, builds, coverage, kubectl and more). Use INSTEAD of a raw shell whenever output may exceed a screenful - test runs, diffs, logs. The token caps are hard guarantees, and failures keep their essential detail (failing test names, error lines). DISABLED by default because it executes commands; set REDCON_MCP_ENABLE_RUN=1 on the server to enable it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory | . |
| command | Yes | Full command line, e.g. 'git diff HEAD' | |
| quality_floor | No | Lowest acceptable detail level | compact |
| timeout_seconds | No | Kill the command after this many seconds | |
| remaining_tokens | No | Remaining budget hint (drives compression aggressiveness) | |
| max_output_tokens | No | Hard cap on tokens returned | |
| semantic_fallback | No | Enable the LLMLingua-2 semantic compression fallback for commands that no schema-specific compressor recognised. Requires the optional redcon[heavy_compression] extra (torch + transformers + ~280 MB BERT-base checkpoint). Silently falls through to plain passthrough when the extra is missing. | |
| prefer_compact_output | No | Rewrite known commands to runner-native compact flags (pytest --tb=line, cargo --quiet, jest --reporter=basic) before spawning. Trades full tracebacks for ~60-80% upstream reduction on test-failure runs. |