Quick Start
A minimal path from clone to a verified running session. You will have LightRSI installed with TokenPilot active in under 5 minutes.
1. Clone and Build
git clone https://github.com/zjunlp/LightRSI.git
cd LightRSI
corepack enable
pnpm install
pnpm build
pnpm lightrsi:build
pnpm lightrsi:installThe last command installs the lightrsi CLI entrypoint at ~/.local/bin/lightrsi. Make sure ~/.local/bin is on your PATH.
2. Pick Your Host
Choose your agent host and run the matching install command:
pnpm component:install:tokenpilot:openclawnpm --prefix components/tokenpilot/adapters/codex run build
npm --prefix components/tokenpilot/adapters/codex run install:codexnpm --prefix components/tokenpilot/adapters/claude-code run build
npm --prefix components/tokenpilot/adapters/claude-code run install:claude-codeEach install command:
- Updates the host's configuration files
- Enables the TokenPilot plugin
- Sets the default
normalruntime mode - Registers required hooks or MCP servers
- Creates backups of modified files as
.tokenpilot.bak
3. Start a Session
Open or restart your host, then start a new session.
Use a lightrsi/<model> model like lightrsi/gpt-5.4-mini
Run: /lightrsi statusStart Codex normally, approve TokenPilot hooks if prompted
Open a new session so SessionStart can start the proxyStart Claude Code normally
Open a new session so SessionStart can start the gateway4. Verify It Works
Run the doctor command to confirm everything is healthy:
/lightrsi doctor
# Or outside OpenClaw:
lightrsi openclaw doctorlightrsi codex doctorlightrsi claude-code doctorExpected output:
plugin entry enabledconfig enabledmode normalstabilizer enabledreduction enabledproxy healthy: yes
5. See Your Savings
After a few turns, check your report:
/lightrsi reportlightrsi codex reportlightrsi claude-code reportIf you see token and cost metrics instead of "No TokenPilot session stats yet", TokenPilot is actively managing your context.
6. Visual Inspector
Open the built-in visual inspector to see your session in real time:
lightrsi visualThis opens a browser view showing stable-prefix, reduction, and eviction snapshots.
What's Next
- Install Your First Plugin — detailed install walkthrough
- Runtime Modes — choose conservative, normal, or aggressive
- CLI Reference — all commands and flags