FlowClaw
Scanned@windseeker1111
npx machina-cli add skill @windseeker1111/flowclaw --openclawFlowClaw — LLM Usage Monitor & Load Balancer
Track usage. Balance routing. Never waste a credit.
Unified dashboard + auto-routing for all your LLM subscriptions. Uses Earliest Deadline First scheduling — accounts resetting soonest are prioritized so unused credits aren't wasted.
Supported Providers
| Provider | Auth | Data Source |
|---|---|---|
| Anthropic Claude Max | OAuth (unlimited accounts) | api.anthropic.com/api/oauth/usage |
| Google Gemini CLI | OAuth via OpenClaw | cloudcode-pa.googleapis.com |
| Google Antigravity | codexbar | codexbar usage API |
| OpenAI Codex | OAuth via OpenClaw | chatgpt.com/backend-api/wham/usage |
| GitHub Copilot | OAuth via OpenClaw | api.github.com/copilot_internal/user |
| Ollama | Local (auto-detected) | localhost:11434/api/tags |
Commands
# 📊 Usage Monitoring
flowclaw status [--fresh] [--json] # Full provider dashboard
flowclaw monitor [--json] [--cached] # Clean usage report (no scoring)
# 🧠 Load Balancing
flowclaw score [--json] # Scored ranking of all accounts
flowclaw optimize [--dry-run] # Reorder OpenClaw model priority
flowclaw auto # Optimize silently (for cron jobs)
# 🛠 Utilities
flowclaw test # Run scoring engine unit tests
flowclaw history [N] # Routing decision history
Setup
Anthropic (Claude Max) — unlimited accounts
claude login
bash {baseDir}/scripts/save-account.sh
# Repeat for each account
Google Gemini CLI
openclaw models auth login --provider google-gemini-cli
Google Antigravity
openclaw models auth login --provider google-antigravity
brew install --cask steipete/tap/codexbar # Required for usage metrics
OpenAI Codex
openclaw models auth login --provider openai-codex
GitHub Copilot
openclaw models auth login-github-copilot
Ollama
brew install ollama && ollama pull qwen3:235b
# Auto-detected — no config needed
Cron Automation
# Optimize routing every 30 minutes
*/30 * * * * bash ~/clawd/skills/flowclaw/scripts/flowclaw.sh auto
Scoring Algorithm
score = urgency(0.30) + availability(0.25) + proximity(0.15) + weekly_headroom(0.20) + tier(0.10)
| Factor | Formula | Measures |
|---|---|---|
| Urgency | remaining / hours_to_reset | Credits wasting per hour |
| Availability | √(remaining) | Dampened capacity |
| Proximity | 1 - (hours / window) | Deadline pressure |
| Weekly headroom | (100 - weekly%) / 100 | 7-day capacity reserve |
| Tier bonus | Free=+0.8, Sub=0, Local=-0.3 | Cost preference |
Perishable inventory: Both 5h session and 7d weekly windows expire. When ≤6h to weekly reset, penalty is removed — burn remaining credits. Family-aware: Only swaps within same capability class (Opus↔Opus, not Opus↔Gemini).
Overview
FlowClaw provides a unified dashboard and auto-routing across major LLM subscriptions, tracking usage and routing requests to the right accounts. It uses Earliest Deadline First scheduling to prioritize credits that reset soonest, reducing waste and preventing stuck agents. Supported providers include Claude Max, Gemini, Antigravity, Codex, Copilot, and Ollama.
How This Skill Works
FlowClaw aggregates per-provider usage from their data sources, surfaces a single view, computes an account score using a multi-factor formula, and then reorders accounts to optimize routing. It uses EDF scheduling to prioritize accounts whose credits reset soonest, ensuring efficient credit use and minimizing idle time for agents.
When to Use It
- Managing multiple provider accounts to maximize credits and prevent wasted usage
- Prioritizing accounts nearing reset to avoid expiring credits
- Automatically re-ordering model priorities for cron-driven workloads
- Generating a clean, consolidated usage report for governance and auditing
- Reviewing routing decisions using a history log to improve future decisions
Quick Start
- Step 1: Authenticate providers (claude login; openclaw models auth login --provider <provider> for Gemini, Antigravity, OpenAI Codex, Copilot)
- Step 2: Run flowclaw status to view the unified dashboard and flowclaw monitor for reports
- Step 3: Enable automatic routing with cron: */30 * * * * bash ~/clawd/skills/flowclaw/scripts/flowclaw.sh auto
Best Practices
- Enable Earliest Deadline First scheduling to prioritize soon-to-reset credits
- Regularly run flowclaw status to monitor a unified, cross-provider dashboard
- Use flowclaw score to pre-rank accounts before routing decisions
- Automate routing with flowclaw auto in cron every 30 minutes
- Keep provider logins up to date (Claude Max, Gemini, Antigravity, Codex, Copilot) and rely on Ollama's auto-detection
Example Use Cases
- Balance usage across Claude Max and Gemini CLI to prevent unused credits at weekly resets
- Route requests to the least-loaded Copilot and Codex accounts to reduce latency and cost
- Auto-detect Ollama usage and credentials for seamless local model routing
- Audit routing decisions with the history log for compliance
- Schedule regular flowclaw auto runs to maintain optimal routing for critical tasks