agent-usagelisted
Install: claude install-skill unmercenary-timebomb913/agent-usage
# agent-usage — AI Coding Agent Usage Query
Query your AI coding agent usage data directly in conversation. Supports Claude Code, Codex CLI, OpenClaw, and OpenCode.
## When to Use
Activate when the user asks about:
- Cost / spending / billing / how much did I spend
- Token usage / consumption / input / output tokens
- Model comparison / which model costs most
- Session history / recent sessions / session details
- API call counts
- Usage trends over time
- Any question involving "usage", "cost", "tokens", "spend", "sessions" related to AI coding tools
## How It Works
This skill has two backends. Always detect which one to use first.
### Step 1: Detect Backend
Run the detection script to check if the agent-usage server is running:
```bash
bash SKILL_DIR/scripts/detect.sh
```
- Output `API` → use **API mode** (Step 2a)
- Output `LOCAL` → use **Local mode** (Step 2b)
Where `SKILL_DIR` is the directory containing this SKILL.md file.
### Step 2a: API Mode (preferred)
Use `query-api.sh` to call the agent-usage REST API. This is faster and has accurate pricing data.
```bash
bash SKILL_DIR/scripts/query-api.sh <command> [options]
```
Commands:
| Command | Description | Key Options |
|---------|-------------|-------------|
| `stats` | Summary: total cost, tokens, sessions, prompts, API calls | `--from`, `--to`, `--source` |
| `cost-by-model` | Cost breakdown per model | `--from`, `--to`, `--source` |
| `cost-over-time` | Cost trend over time | `--from`, `--to`, `--granul