OpenGauge: Open-source tool for tracking LLM agent costs locally

What OpenGauge does
OpenGauge is an open-source monitoring tool that tracks API usage and costs for LLM agents like those built with OpenClaw. It runs locally on your machine, storing all data in a SQLite database without sending information to external services.
Key features from the source
- Proxy mode: Routes API calls through OpenGauge for automatic logging. Command:
npx opengauge watch ANTHROPIC_BASE_URL=http://localhost:4000 claude - Cost statistics: Shows detailed breakdowns with commands like
npx opengauge stats --period=7dthat display per-model costs, daily trends, token counts, and most expensive sessions - Circuit breaker: Detects and stops runaway loops where agents make repeated identical calls
- Budget limits: Can be set per session, daily, or monthly to prevent unexpected charges
- Multi-provider support: Works with Anthropic, OpenAI, Gemini, and local models through Ollama
- OpenClaw plugin: Specific integration for OpenClaw agents with simple installation:
openclaw plugins install /openclaw-pluginfollowed byopenclaw gateway restart
How it addresses common problems
The source author reported issues with:
- Lack of visibility into per-session costs (only seeing total usage in provider dashboards)
- Runaway loops where an agent made the same call 30+ times before being stopped
- Unexpected billing alerts due to uncontrolled usage
OpenGauge solves these by providing session-level cost tracking, similarity detection for repeated prompts, and configurable budget limits.
Getting started
For general use: npx opengauge (no installation needed)
For OpenClaw-specific tracking: npx opengauge stats --source=openclaw or npx opengauge stats --source=openclaw --period=7d
The tool can also function as a proxy for other development tools like Claude Code and Cursor.
📖 Read the full source: r/openclaw
👀 See Also

Open-sourced Claude Code prompts reverse-engineered using Claude
A developer used Claude to rewrite all 26 prompts from Claude Code's source after studying the TypeScript codebase during a brief public availability window. The MIT-licensed collection includes system, tool, agent, memory, coordinator, and utility prompts.

ClawPort: Open Source Orchestration for AI Agent Workflows with Self-Healing Cron
ClawPort is an open source orchestration layer for AI agent workflows that auto-configures cron pipelines, self-heals on failures, and lets you test agents directly before they run on schedule.

Demo for AI Agent Micropayments Using x402 and Solana
The x402-hello demo illustrates AI agents autonomously handling micropayments using USDC on the Solana blockchain.

Comparing Multi-Agent AI Systems: Anthropic's Harness vs Agyn's Engineering Org Model
Anthropic published a harness design for long-running application development, while Agyn's multi-agent system for team-based autonomous software engineering was open-sourced last month. Both systems reject monolithic agents in favor of role separation, structured handoffs, and review loops.