Skip to content

Configuration Integration ​

Config Files by Host ​

From source:

HostConfig LocationPurpose
OpenClawPlugin entry in ~/.openclaw/openclaw.jsonTokenPilot registered as a plugin within OpenClaw configuration
Codex CLI~/.codex/tokenpilot.json (runtime config) + ~/.codex/hooks.json (hook registration)tokenpilot.json stores provider config and runtime settings. hooks.json registers hooks (SessionStart, PreToolUse, PostToolUse). Host's config.toml modified to reroute provider base_url to local proxy
Claude Code~/.claude/tokenpilot.json (runtime config) + ~/.claude/settings.json (gateway routing) + ~/.claude/.claude.json (MCP registration)tokenpilot.json stores runtime config. settings.json updated for gateway routing. .claude.json registers tokenpilot_memory_fault_recover MCP server
pi~/.pi/agent/tokenpilot.json (+ extension loader at ~/.pi/agent/extensions/tokenpilot/index.js)tokenpilot.json stores runtime config. The loader is the only file install writes; no pi-owned config file is modified
OpenCode~/.config/opencode/tokenpilot.json (runtime config) + ~/.config/opencode/opencode.json (recovery MCP registration) + plugins/tokenpilot.js (loader)tokenpilot.json stores runtime config. opencode.json gains exactly one mcp.tokenpilot_memory_fault_recover entry, after a backup
DeepSeek HarnessSelected Harness profile's cordis.patch.ymltokenpilot-dsh settings: master switch, durable stateDir, task-state estimator, eviction, and compaction ordering; see configuration guide

Environment Variables ​

From source:

AdapterEnvironment VariableDefault Path
OpenClawLIGHTRSI_OPENCLAW_HOME~/.openclaw/
OpenClawOPENCLAW_CONFIG_PATH~/.openclaw/openclaw.json
CodexCODEX_CONFIG_PATH~/.codex/config.toml
CodexCODEX_HOOKS_CONFIG_PATH~/.codex/hooks.json
CodexTOKENPILOT_CODEX_CONFIG~/.codex/tokenpilot.json
Claude CodeCLAUDE_CODE_SETTINGS_PATH~/.claude/settings.json
Claude CodeCLAUDE_CODE_MCP_CONFIG_PATH~/.claude/.claude.json
Claude CodeTOKENPILOT_CLAUDE_CODE_CONFIG~/.claude/tokenpilot.json
piPI_CODING_AGENT_DIR~/.pi/agent/
piTOKENPILOT_PI_CONFIG~/.pi/agent/tokenpilot.json
OpenCodeTOKENPILOT_OPENCODE_CONFIG_DIR~/.config/opencode/
OpenCodeTOKENPILOT_OPENCODE_CONFIG~/.config/opencode/tokenpilot.json

Backup Strategy ​

Before modifying existing host config files, the OpenClaw, Codex, and Claude Code installers create .tokenpilot.bak backups. This applies to Codex (~/.codex/config.toml) and Claude Code (~/.claude/settings.json, ~/.claude/.claude.json). The pi installer modifies no pi-owned file; the OpenCode installer writes a timestamped backup before adding its single MCP entry, and leaves a non-plain-JSON opencode.json or an opencode.jsonc untouched.

Released under the MIT License.