Skip to content

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:

text
┌─────────────────────────────────────────────────────┐
│                 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.

HostIntegrationPage
OpenClawNative plugin slotOpenClaw
Codex CLILocal proxy + hooksCodex
Claude CodeLocal gateway + MCPClaude Code
DeepSeek HarnessNative Cordis pluginDeepSeek Harness
piIn-process extension + native recovery toolpi
OpenCodeIn-process v1 plugin + recovery MCPOpenCode

Feature availability varies by host. See Host Compatibility and each host's setup guide before choosing configuration or commands.

Quick Tour ​

Released under the MIT License.