Skip to main content
CostHQ ships as an OpenClaw skill, so the agent tracks itself — every task gets a session, every AI call gets logged, and every cost gets recorded without a single manual command.

Quick Install

1

Install the CostHQ CLI

2

Install the skill via ClawHub

3

Start a new OpenClaw session

That’s it. Start a new OpenClaw session and tracking begins automatically.
If you don’t have ClawHub, copy the skill directly from the global npm package:

What the Skill Does Automatically

Once installed, the OpenClaw agent runs these steps on your behalf — no configuration needed:
  1. Runs cs start "task name" at the beginning of each task
  2. Logs API usage with cs log-ai after each AI call
  3. Checks costs with cs status --json during long tasks
  4. Runs cs end when the task completes

Example Agent Transcript

Here’s what a tracked OpenClaw session looks like in practice, using a real payment-bug fix as an example:

After 50 Agent Runs

Run cs stats at any time to see aggregated totals across all sessions:

Key Flags for Agents

Failsafe: When cs Is Not Installed

The skill checks whether cs is available before attempting to track. If CostHQ isn’t installed, the agent skips tracking and continues with its primary task — your work is never blocked:
On Windows, use where cs instead of which cs. All cs commands work identically on Windows, macOS, and Linux.