Open Source

Token optimization for
OpenClaw agents

A visual control layer for OpenClaw token utilization. Surface what your agents are actually using, spot what's costing you, and tune configuration without editing files by hand.

Get Started → View on GitHub
git clone https://github.com/Marc4211/optimoclaw.git

The cost black box

Multi-agent systems are powerful, but they're also opaque. When you're running a fleet of OpenClaw agents, every heartbeat, every model call, every context window is burning tokens. The costs compound fast, and the only way to understand what's happening is to dig through config files and CLI output.

You shouldn't need to be a config file expert to understand what your agents are costing you.

OptimoClaw gives you a live dashboard that surfaces token usage, model routing, cache efficiency, and tuning controls, all in one place. See what's actually running, what it costs, and adjust it with visual controls instead of manual file edits.

Features

Everything you need to optimize

Gain visibility and control over your OpenClaw agent fleet.

Token Optimizer

Displays model routing assignments across agents with token usage metrics and pricing. Adjust default model, heartbeat frequency, compaction threshold, session context, memory scope, and subagent concurrency, all through visual controls.

🎛

Performance Tuning

Fine-tune heartbeat frequency, subagent concurrency, and search batch limits with sliders and toggles. Evaluate cost vs. performance trade-offs in real time before committing changes.

📊

Session Insights

Context utilization and cache efficiency charts with actionable analysis. OptimoClaw tells you what to adjust, confirms when no levers exist, or validates that your current config is already optimal.

🔍

Agent Analyzer

Per-agent detail views showing which model they're actually running, heartbeat config, active sessions, context utilization, and cache efficiency. See what each agent is really doing.

🌐

Multi-Gateway Support

Connect multiple OpenClaw instances and switch between them without restarting. Each gateway remembers its connection details, manage a production fleet and a local dev instance from the same interface.

Dashboard

See it in action

Four panels, each focused on a different aspect of your agent fleet's token economy.

Token Optimizer panel showing model routing and config levers

Token Optimizer

Agent-specific model routing with per-agent token counts and rate card pricing. OptimoClaw verifies that config changes are actually applied, unlike OpenClaw agents, which can routinely read from stale workspace markdown and report settings that aren't in effect. Includes predefined presets for quick optimization across cost, quality, or responsiveness.

Performance Tuning panel with sliders and controls

Performance Tuning

Heartbeat frequency, subagent concurrency, and batch controls with real-time cost estimates.

Session Insights panel with charts and analysis

Session Insights

Context utilization and cache efficiency charts with actionable optimization recommendations.

Agent Analyzer panel with per-agent detail view

Agent Analyzer

Per-agent runtime models, heartbeat config, active sessions, and performance metrics.

Architecture

How it works

OptimoClaw sits alongside your OpenClaw instance, reading live data through two channels and writing config changes back through the CLI.

┌──────────────────────────┐ OptimoClaw Dashboard Next.js + React └─────────┬────────┬─────────┘ WebSocket CLI exec ┌─────────┴────────┴─────────┐ OpenClaw Gateway Agent status • Model info Config • Usage metrics └────────────────────────────┘

Two data channels

Real-time data and batch queries work together to give you a complete picture.

  • WebSocket: live agent status, model availability, and session events streamed in real time
  • CLI integration: runs openclaw config get and openclaw status --usage --json for structured metrics
  • Config writes: changes applied via openclaw config set, with automatic gateway restart and agent workspace sync

Design decision

OptimoClaw uses token counts and published pricing rates instead of billing API integration. This avoids requiring admin credentials and lets you start optimizing immediately. No billing setup needed.

Quickstart

Up and running in 3 steps

OptimoClaw runs alongside your OpenClaw instance. Install OptimoClaw on the same machine running your OpenClaw gateway.

Clone and install

Pull the repo and install dependencies. Requires Node.js 18.17 or later.

git clone https://github.com/Marc4211/optimoclaw.git cd optimoclaw npm install

Start the dashboard

Run in development mode for local use.

npx next dev -p 3070

Open and optimize

Navigate to localhost:3070 in your browser. Select add gateway to begin streaming data from your gateway.

What's Next

Where OptimoClaw is going

The current version of OptimoClaw answers a narrow question: what is your setup doing, and what can you tune for optimized token performance? That's useful. But it's not the whole problem.

Right now we have no good way to know whether an agent is actually performing well. Token counts and cache ratios tell you about infrastructure. They don't tell you whether an agent handled a task effectively, called the right tools, needed fewer corrections over time, or is quietly getting worse.

Getting there requires things that don't fully exist yet: task-level telemetry, outcome signals, a way to rate agent effectiveness that doesn't rely on the agent rating itself. Some of that has to come from OpenClaw. Some of it would need to be built on top.

That's the direction OptimoClaw is pointing. Not just a tuning dashboard, but a performance layer for agents that treats effectiveness as a first-class metric alongside cost.

Claude Skill

Optimize without the dashboard

The OptimoClaw skill brings token optimization directly into your Claude agent. It reads your live OpenClaw config and usage data, calculates costs across model providers, and recommends specific changes with transparent trade-offs. No dashboard required.

🧠

OptimoClaw Skill

Works with or without the OptimoClaw dashboard

View on ClawHub