OpenClaw
OpenClaw is the primary host for LightRSI, with the deepest integration via a native plugin slot.
Installation
pnpm component:install:tokenpilot:openclawThis command:
- Builds one release archive containing the plugin and bundled
lightrsiCLI - Installs the CLI in
~/.local/binby default, or inLIGHTRSI_BIN_DIRwhen set - Updates
~/.openclaw/openclaw.json - Enables the TokenPilot plugin
- Switches
plugins.slots.contextEnginetotokenpilot - Applies the default
normalmode settings - Attempts to restart the OpenClaw gateway
Custom Paths
export LIGHTRSI_OPENCLAW_HOME="/path/to/openclaw-home"
export OPENCLAW_CONFIG_PATH="/path/to/openclaw.json"
pnpm component:install:tokenpilot:openclawExpected Output
After install, your ~/.openclaw/openclaw.json will include a TokenPilot section:
{
"plugins": {
"slots": {
"contextEngine": "tokenpilot"
},
"entries": {
"tokenpilot": {
"enabled": true,
"config": {
"enabled": true
}
}
}
}
}Verification
Inside an OpenClaw session:
/lightrsi statusExpected output:
plugin entry enabledconfig enabledmode normalcontext engine slot tokenpilotstabilizer enabledreduction enabled
For a fuller check:
/lightrsi doctor
/lightrsi report
/lightrsi visualIn-Session Commands
OpenClaw supports in-session slash commands:
/lightrsi status # View current status
/lightrsi report # Session token/cost report
/lightrsi doctor # Integration self-check
/lightrsi visual # Open visual inspector
/lightrsi mode normal # Switch mode
/lightrsi stabilizer target developer
/lightrsi reduction mode balanced
/lightrsi eviction on
/lightrsi help # List all commandsStandalone CLI
Commands also work outside OpenClaw:
lightrsi openclaw status
lightrsi openclaw report
lightrsi openclaw doctor
lightrsi openclaw visual
lightrsi openclaw mode normal
lightrsi openclaw session <session-id> report
lightrsi openclaw clean --require-tty --session <session-id>Model Selection
lightrsi/gpt-5.4-miniContext Cleaner
Analyze the current mapped conversation without rewriting its context:
/lightrsi cleanIf the session cannot be resolved, use /lightrsi clean --session <session-id>. Review the returned plan and select only eligible task IDs:
/lightrsi clean --plan <plan-id> --select <task-id-1>,<task-id-2>
/lightrsi clean --status <plan-id>
/lightrsi clean --cancel <plan-id>/tokenpilot clean and /tp clean are aliases. When selectable tasks exist, native analysis prints lightrsi openclaw clean --require-tty --session <current-session-id>. Return to the shell that launched OpenClaw and run that exact command to open the shared selector: Up/Down moves, Space toggles, Enter submits, and q cancels. The explicit session ID binds the selector to the current conversation; no recent-session guess is used. The native command itself returns a text plan and does not take over OpenClaw's keyboard.
Explicit approval returns scheduled without changing the canonical transcript. Return to OpenClaw and send the next ordinary message to execute the plan, then query --status for its result. During execution, the canonical eviction backend archives task content and commits the rewrite. The rewrite uses pointer stubs or drops selected content according to the replacement mode; cancelling a Cleaner plan does not undo an applied rewrite. Native commands and the CLI share plans and receipts.
See Context Cleaner for task protection, accounting, and cancellation limits.
Recovery
cp ~/.openclaw/openclaw.json.tokenpilot.bak ~/.openclaw/openclaw.jsonTroubleshooting
See TokenPilot Troubleshooting for OpenClaw-specific issues.