TokenPilot Overview
TokenPilot is LightRSI's first context-management preset. It composes cache-aware context policies for long-running agent sessions, with the goal of reducing token usage and cost.
Context Cleaner is the user-facing product for reviewing tasks and approving a specific cleanup. It reuses shared task and host rewrite capabilities; its interactive workflow is distinct from TokenPilot's automatic runtime policies.
What TokenPilot Does
Agent sessions grow. Every turn adds more messages, more tool outputs, more context. The model sees all of it, and you pay for all of it. Much of that context is repetitive — identical prefixes sent every turn, bloated tool outputs, stale history.
TokenPilot addresses this with three techniques:
┌─────────────────────────────────────────────────────┐
│ TokenPilot Pipeline │
├─────────────────────────────────────────────────────┤
│ 1. Stable Prefix │
│ Rewrites context into cache-stable form │
│ → Higher cache hit rate │
├─────────────────────────────────────────────────────┤
│ 2. Context Reduction │
│ Trims oversized tool output before it pollutes │
│ → Leaner context per turn │
├─────────────────────────────────────────────────────┤
│ 3. Context Eviction │
│ Limits how much old context is carried forward │
│ → Sessions don't grow unbounded │
└─────────────────────────────────────────────────────┘Evaluation
TokenPilot is evaluated on PinchBench and Claw-Eval in isolated and continuous modes. Benchmark tasks, runners, configurations, and current results are maintained in the separate TokenPilot experiment repository; see Benchmarks for the reproduction entrypoint.
Supported Hosts
TokenPilot integrates with six hosts. DeepSeek Harness uses a native Cordis plugin for optional context eviction and session status; pi and OpenCode run in-process; their setup and capabilities differ from the other adapters.
| Host | Integration | Page |
|---|---|---|
| OpenClaw | Native plugin slot | OpenClaw |
| Codex CLI | Local proxy + hooks | Codex |
| Claude Code | Local gateway + MCP | Claude Code |
| DeepSeek Harness | Native Cordis plugin | DeepSeek Harness |
| pi | In-process extension + native recovery tool | pi |
| OpenCode | In-process v1 plugin + recovery MCP | OpenCode |
Feature availability varies by host. See Host Compatibility and each host's setup guide before choosing configuration or commands.
Quick Tour
- Installation — get TokenPilot running
- Configuration — settings and defaults
- Runtime Modes — conservative, normal, aggressive
- Benchmarks — evaluation results
- Troubleshooting — common problems and fixes