Skip to content

Quick Start ​

A path from clone to a verified running session. Choose OpenClaw, Codex, Claude Code, DeepSeek Harness, pi, or OpenCode at each host-specific step below.

1. Prepare the Repository ​

bash
git clone https://github.com/zjunlp/LightRSI.git
cd LightRSI
corepack enable
pnpm install

The host-specific commands below build and install the selected integration. DeepSeek Harness also requires a working Harness checkout and Node.js matching the adapter requirements.

2. Pick Your Host ​

Choose your agent host and run the matching install command:

bash
pnpm component:install:tokenpilot:openclaw
bash
corepack pnpm cleaner:install:codex
bash
corepack pnpm cleaner:install:claude-code
bash
# From the LightRSI repository
corepack pnpm --filter @lightrsi/deepseek-harness-adapter build
corepack pnpm --filter @lightrsi/deepseek-harness-adapter pack --pack-destination ./artifacts

# Then, from your DeepSeek Harness checkout
node --import tsx/esm apps/cli/src/bin.ts plugin --profile web add /absolute/path/to/lightrsi-deepseek-harness-adapter-<version>.tgz
bash
npm --prefix components/adapters/pi run build
npm --prefix components/adapters/pi run install:pi
bash
npm --prefix components/adapters/opencode run build
npm --prefix components/adapters/opencode run install:opencode

OpenClaw, Codex, Claude Code, pi, and OpenCode installers configure their host integrations. See Install Your First Plugin for the changes each installer makes.

For OpenClaw, the release installer builds one archive containing the plugin and the shared lightrsi CLI, installs both, and attempts to restart the gateway. On Linux and WSL the command is installed in ~/.local/bin by default; ensure that directory is on your PATH:

bash
export PATH="$HOME/.local/bin:$PATH"

If you set LIGHTRSI_BIN_DIR, add that directory instead. The installer also supports the Windows launchers used by the final package. Codex and Claude Code's cleaner:install:* commands build and install the shared CLI through their own host installers.

DeepSeek Harness installs the tokenpilot-dsh Cordis plugin into the selected profile. Replace the archive path with the generated .tgz and web with your profile. The plugin is disabled by default: supply a persistent stateDir and estimator and eviction settings, then enable it as described in Configure and Enable.

3. Start a Session ​

Open or restart your host, then start a new session.

text
Use a lightrsi/<model> model like lightrsi/gpt-5.4-mini
Run: /lightrsi status
text
Start Codex normally, approve TokenPilot hooks if prompted
Open a new session so SessionStart can start the proxy
text
Start Claude Code normally
Open a new session so SessionStart can start the gateway
text
Load the profile containing the configured and enabled tokenpilot-dsh plugin
Open a Harness session
Run: /tokenpilot-status
text
Start pi, or run /reload in a running session, so the extension loads
text
Restart OpenCode so the plugin and the MCP server load

4. Verify It Works ​

Use the verification command for your host:

bash
/lightrsi doctor
# Or outside OpenClaw:
lightrsi openclaw doctor
bash
lightrsi codex doctor
bash
lightrsi claude-code doctor
text
/tokenpilot-status
bash
lightrsi pi doctor
bash
lightrsi opencode doctor

For OpenClaw, Codex, Claude Code, pi, and OpenCode, check the relevant status fields:

  • plugin entry enabled
  • config enabled
  • mode normal
  • stabilizer enabled
  • reduction enabled

Only OpenClaw, Codex, and Claude Code also report proxy healthy: yes; pi and OpenCode run no proxy or gateway.

For DeepSeek Harness, inspect estimator activity, scheduling, application, and deferrals. The command is read-only and does not create a model turn. See status field meanings; an enabled plugin does not imply an eviction has already occurred.

5. Inspect Runtime Results ​

After a few turns, inspect your host's report or status:

bash
/lightrsi report
bash
lightrsi codex report
bash
lightrsi claude-code report
text
/tokenpilot-status
bash
lightrsi pi report
bash
lightrsi opencode report

For the shared CLI reports, token and cost metrics replace "No TokenPilot session stats yet" once session statistics are available. DeepSeek Harness exposes estimator, scheduled, applied, and deferred state through its native status command; it does not use lightrsi report.

6. Visual Inspector ​

For OpenClaw, Codex, Claude Code, pi, and OpenCode, open the built-in visual inspector:

bash
lightrsi visual

This opens a browser view showing stable-prefix, reduction, and eviction snapshots.

DeepSeek Harness uses /tokenpilot-status for the documented session status workflow; this shared Visual command does not apply to it.

What's Next ​

Released under the MIT License.