Skip to content

TokenPilot Installation

TokenPilot is installed as part of installing your first plugin. This page covers TokenPilot-specific details.

Prerequisites

Before installing TokenPilot, complete Install LightMem2.

Install Commands

bash
pnpm component:install:tokenpilot:openclaw
bash
npm --prefix components/adapters/codex run build
npm --prefix components/adapters/codex run install:codex
bash
npm --prefix components/adapters/claude-code run build
npm --prefix components/adapters/claude-code run install:claude-code

What the Installer Does

  1. Builds the adapter for your host
  2. Updates host configuration files with TokenPilot settings
  3. Enables the plugin (sets enabled: true)
  4. Sets default mode to normal
  5. Registers hooks/MCP/proxy needed for runtime operation
  6. Creates backups of modified files as .tokenpilot.bak

Verify Installation

Run the doctor command for your host:

bash
lightmem2 openclaw doctor
lightmem2 codex doctor
lightmem2 claude-code doctor

All three should report:

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

For Codex and Claude Code, also check:

  • proxy healthy: yes

Install with Custom Paths

If your host files are not in the default locations, set environment variables before running the install command. See Install Your First Plugin for the full list.

Failed Install?

Check Troubleshooting for common install problems. If install fails, your original config files are safe — the installer backs up everything before making changes.

Quick recovery

bash
# Restore from backups
cp ~/.openclaw/openclaw.json.tokenpilot.bak ~/.openclaw/openclaw.json
cp ~/.claude/settings.json.tokenpilot.bak ~/.claude/settings.json
# etc.

Next

Released under the MIT License.