Install
openclaw skills install costhqTrack agent session costs, file changes, and git commits with CostHQ. Enforces budget limits, tracks local models, and provides Enterprise SOC2 audit trails via a web dashboard. v3.3.0 - Enterprise SOC2 Audit Logging and Local Models.
openclaw skills install costhqTrack agent session costs, file changes, and git commits. Enforces budget limits, tracks local models (Ollama, vLLM), and provides detailed session analytics with a full web dashboard and tamper-evident SOC2 audit logging for Enterprise users.
Latest: v3.3.0 - Added Enterprise SOC2 Audit Trails and Local Models (compute-time costing).
📦 npm • ⭐ GitHub • 📝 Changelog
# 1. Install the CLI globally from npm
npm install -g costhq
# 2. Install the OpenClaw skill
clawhub install costhq
After installing, the cs command is available globally. The OpenClaw agent will automatically use it to track sessions.
Requirements: Node.js 18+ and C/C++ build tools (needed to compile the embedded SQLite module).
OS Install build tools Ubuntu/Debian sudo apt-get install -y build-essential python3macOS xcode-select --installWindows npm install -g windows-build-toolsor install Visual Studio Build ToolsAlpine apk add build-base python3Data is stored locally at
~/.costhq/sessions.db(or~/.CostHQ).
cs dashboard to review session data, set up local models, or verify the audit trail (Enterprise).# Agent mode (always use --json for structured output):
cs start "task description" --json --close-stale
# Resume if a session was left open (e.g. after a crash):
cs start "task description" --json --resume
# Standard cloud model (cost auto-calculated):
cs log-ai -p anthropic -m claude-sonnet-4 --prompt-tokens 8000 --completion-tokens 2000 --json
# Local model with compute duration (NEW in v3.3.0):
# Use --duration in seconds (120) or string (2m30s). Cost is based on registered $/hr rate.
cs log-ai -p ollama -m llama3 --tokens 4500 --duration 2m30s --local --json
# With all fields:
cs log-ai -p openai -m gpt-4o --prompt-tokens 5000 --completion-tokens 1500 -c 0.04 --agent "Research Agent" --json
Agent Name: Use --agent "Agent Name" to track which agent performed the work.
Local Models: You can track self-hosted models (Ollama, llama.cpp, vLLM) by registering a GPU hourly rate in the dashboard. Use --duration and --local when logging.
cs status --json
cs end -n "completion notes" --json
Ending the session automatically logs an audit event (Enterprise) and scans git for files/commits.
cs dashboard
The dashboard shows:
cs show --json --files --commits
cs stats --json
cs export --format json --limit 10
cs note "Tests passing, moving to cleanup" --json
Agents should always use --json on every command for structured, parseable output.
cs start "Fix authentication bug" --json --close-stalecs note "analyzing auth flow" --jsoncs log-ai -p anthropic -m claude-sonnet-4 --prompt-tokens 800 --completion-tokens 200 --agent "Bug Fixer" --jsoncs log-ai -p ollama -m mistral --tokens 1000 --duration 45s --local --jsoncs end -n "Fixed the auth bug" --jsoncs pricing set my-model 5.00 15.00.cs dashboard under Local Models.cs status --json before expensive operations.--json on every command — agents must use structured output.--close-stale on cs start to clear crashed sessions.