← Back to Skills Marketplace
danielithomas

LLM Monitor

by Daniel Thomas · GitHub ↗ · v0.7.5 · MIT-0
cross-platform ✓ Security Clean
100
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install llm-monitor
Description
Monitor and report usage, costs, quotas, and rate limits for LLM providers, plus manage clawmeter setup and daemon status securely.
README (SKILL.md)

llm-monitor — clawmeter Agent Skill\r

\r TRIGGER when: user asks about LLM usage, costs, spending, quotas, remaining balance, or rate limits — for any provider (Claude, OpenAI, Grok, Ollama) or across all providers. Also when user asks about clawmeter status, setup, configuration, or daemon management. Example phrases: "what's my usage", "how much Claude have I used", "how much quota do I have left", "what are my costs", "check my spending", "am I near my limit", "usage today", "this week's spending".\r \r ---\r \r

CRITICAL SECURITY RULES\r

\r You MUST follow these rules without exception:\r \r

  • NEVER accept, handle, store, or relay API keys, tokens, or credentials. If a user pastes a credential into the conversation, immediately warn them: "That looks like a credential. Please remove it from this conversation and rotate it. For security, I cannot handle credentials directly."\r
  • NEVER read credential files such as ~/.claude/.credentials.json or any file that may contain secrets.\r
  • NEVER pass credentials as command arguments or environment variables in tool calls.\r
  • When credential setup is required, instruct the user to edit the file themselves — provide the file path and the key name to add, but never the value. Suggest they use ! $EDITOR ~/.config/clawmeter/config.toml to edit in-session without the agent seeing contents.\r
  • Prefer the most secure credential storage: keyring or key_command over environment variables, environment variables over config file references.\r \r ---\r \r

1. Pre-flight Check\r

\r Before answering any usage query, verify clawmeter is operational. Run these checks in order and stop at the first failure:\r \r

1a. Is clawmeter installed?\r

\r

which clawmeter\r
```\r
\r
If not found, guide the user through installation:\r
\r
```\r
clawmeter is not installed. You can install it with:\r
\r
  pip install clawmeter\r
  # or\r
  uv tool install clawmeter\r
\r
Would you like me to install it for you?\r
```\r
\r
If the user agrees, run `pip install clawmeter` or `uv tool install clawmeter` (prefer `uv` if available).\r
\r
### 1b. Is clawmeter configured?\r
\r
Check for a config file:\r
\r
```bash\r
test -f "${CLAWMETER_CONFIG:-$HOME/.config/clawmeter/config.toml}" && echo "exists" || echo "missing"\r
```\r
\r
If missing, create a minimal skeleton config (with no secrets):\r
\r
```bash\r
mkdir -p ~/.config/clawmeter\r
```\r
\r
Then write a starter `config.toml`:\r
\r
```toml\r
[general]\r
default_providers = ["claude"]\r
poll_interval = 600\r
\r
[thresholds]\r
warning = 70\r
critical = 90\r
\r
[providers.claude]\r
enabled = true\r
\r
[history]\r
enabled = true\r
retention_days = 90\r
```\r
\r
Then instruct the user:\r
\r
```\r
I've created a basic config at ~/.config/clawmeter/config.toml with Claude enabled.\r
\r
To set up your credentials securely, please edit the config file directly:\r
\r
  ! $EDITOR ~/.config/clawmeter/config.toml\r
\r
For security, I cannot add credentials for you. See the clawmeter docs for\r
credential options (keyring, key_command, or environment variables).\r
```\r
\r
If the user wants additional providers (Grok, OpenAI, Ollama), add the relevant `[providers.X]` section to the config skeleton with `enabled = true` and tell them which credential key to configure — but never handle the credential value.\r
\r
### 1c. Is the daemon running?\r
\r
```bash\r
clawmeter daemon status\r
```\r
\r
If not running, recommend starting it:\r
\r
```\r
The clawmeter daemon is not running. The daemon collects usage data in the\r
background, which enables historical tracking and faster queries.\r
\r
To start it:\r
  clawmeter daemon start\r
\r
To install it as a systemd service (starts on login):\r
  clawmeter daemon install\r
  clawmeter daemon start\r
\r
Would you like me to start the daemon for you?\r
```\r
\r
If the user agrees, run `clawmeter daemon start`. For systemd installation, ask for confirmation first since it modifies system services.\r
\r
### 1d. Quick health check\r
\r
If clawmeter is installed and configured, do a quick test:\r
\r
```bash\r
clawmeter --quiet 2>/dev/null\r
```\r
\r
Check the exit code:\r
- **0** — all good, proceed to query\r
- **2** — authentication error: tell the user to check their credentials\r
- **3** — partial success: some providers failed, note which ones and proceed with available data\r
- **4** — network error: all providers unreachable, suggest checking connectivity\r
\r
---\r
\r
## 2. Answering Usage Queries\r
\r
### 2a. Default Response Style (Simple)\r
\r
For casual questions like "what's my usage?" or "how much have I used?", give a **concise 1-3 line summary**.\r
\r
Run:\r
\r
```bash\r
clawmeter 2>/dev/null\r
```\r
\r
Parse the JSON output and respond like:\r
\r
> You've used 57% of your session quota (resets in 2h 15m) and 12% of your weekly quota. All normal.\r
\r
Or if there's a warning:\r
\r
> You're at 85% of your session quota (resets in 45m). Weekly usage is at 23%. You might want to pace yourself for the next 45 minutes.\r
\r
Rules for the simple response:\r
- Lead with the most urgent/relevant window (highest utilisation or nearest reset)\r
- Include the reset time in human-readable form (use the `resets_in_human` field)\r
- Mention the status if it's `warning`, `critical`, or `exceeded`\r
- If multiple providers are active, summarise each in one line\r
- Do NOT include raw token counts or cost figures unless asked\r
\r
### 2b. Detailed Response\r
\r
When the user asks for "more detail", "breakdown", "show me everything", or asks about specific providers or models:\r
\r
Run:\r
\r
```bash\r
clawmeter 2>/dev/null\r
```\r
\r
Parse the JSON and present:\r
- **Per-provider breakdown** — each provider with all its usage windows\r
- **Per-model usage** — if `model_usage` data is available (tokens, costs, request counts)\r
- **Cache status** — whether data is fresh or cached (and how old)\r
- **Any errors** — from the `errors` array in each provider's response\r
\r
Format as a clear table or structured list. Example:\r
\r
> **Anthropic Claude**\r
> - Session (5h): 57% used, resets in 2h 15m (normal)\r
> - Daily: 34% used, resets in 8h (normal)\r
> - Weekly: 12% used, resets in 4d 6h (normal)\r
>\r
> Models today:\r
> - claude-opus-4-6: 3,200 input / 1,800 output tokens, 8 requests\r
> - claude-sonnet-4-6: 12,500 input / 4,200 output tokens, 23 requests\r
\r
### 2c. Historical Response\r
\r
When the user asks about trends, comparisons, or past usage ("how does this week compare to last week", "usage over the past month", "show my history"):\r
\r
Run:\r
\r
```bash\r
clawmeter --report --days \x3CN> --format json --granularity daily 2>/dev/null\r
```\r
\r
Adjust flags based on the question:\r
- `--days 7` for "this week" or "past week"\r
- `--days 30` for "this month"\r
- `--from YYYY-MM-DD --to YYYY-MM-DD` for specific date ranges\r
- `--granularity hourly` for "today's usage over time"\r
- `--granularity daily` for multi-day views\r
- `--models` to include per-model breakdown in history\r
\r
If the daemon has not been running long enough for historical data, say so:\r
\r
> Historical data is limited — the daemon has only been collecting since [date].\r
> For a full picture, keep the daemon running and check back later.\r
\r
### 2d. Provider-specific Queries\r
\r
When the user asks about a specific provider ("my Claude usage", "OpenAI costs"):\r
\r
```bash\r
clawmeter --provider claude 2>/dev/null\r
```\r
\r
Use the `--provider` flag with: `claude`, `openai`, `grok`, `ollama`, or `local`.\r
\r
### 2e. Fresh Data\r
\r
If the user says "refresh", "get latest", or you suspect cached data is stale:\r
\r
```bash\r
clawmeter --fresh 2>/dev/null\r
```\r
\r
---\r
\r
## 3. JSON Output Schema Reference\r
\r
The JSON output from `clawmeter` has this structure:\r
\r
```json\r
{\r
  "timestamp": "ISO 8601 datetime",\r
  "version": "package version",\r
  "providers": [\r
    {\r
      "provider_name": "claude",\r
      "provider_display": "Anthropic Claude",\r
      "timestamp": "ISO 8601 datetime",\r
      "cached": false,\r
      "cache_age_seconds": 0,\r
      "windows": [\r
        {\r
          "name": "Session (5h)",\r
          "utilisation": 42.0,\r
          "resets_at": "ISO 8601 datetime",\r
          "resets_in_human": "2h 15m",\r
          "status": "normal",\r
          "unit": "percent",\r
          "raw_value": null,\r
          "raw_limit": null\r
        }\r
      ],\r
      "model_usage": [\r
        {\r
          "model": "claude-opus-4-6",\r
          "input_tokens": 5000,\r
          "output_tokens": 2000,\r
          "total_tokens": 7000,\r
          "cost": 0.15,\r
          "request_count": 10,\r
          "period": "7d"\r
        }\r
      ],\r
      "extras": {},\r
      "errors": []\r
    }\r
  ]\r
}\r
```\r
\r
Key fields for response formatting:\r
- `windows[].utilisation` — percentage (0-100+), the primary metric\r
- `windows[].status` — `normal`, `warning` (70-89%), `critical` (90-99%), `exceeded` (100%+)\r
- `windows[].resets_in_human` — pre-formatted reset countdown\r
- `model_usage` — optional, only present when per-model data is available\r
- `errors` — non-empty means something went wrong for that provider\r
\r
---\r
\r
## 4. Exit Codes\r
\r
Interpret exit codes to give appropriate responses:\r
\r
| Code | Meaning | Agent action |\r
|------|---------|--------------|\r
| 0 | All providers succeeded | Report results normally |\r
| 1 | Config/parse error | Help user fix config |\r
| 2 | All auth failed | Instruct user to check credentials (do NOT handle credentials yourself) |\r
| 3 | Partial success | Report available data, note which providers failed |\r
| 4 | All network errors | Suggest checking connectivity |\r
\r
---\r
\r
## 5. Daemon Management\r
\r
When the user asks about daemon status or management:\r
\r
| User wants | Command |\r
|------------|---------|\r
| Check status | `clawmeter daemon status` |\r
| Start daemon | `clawmeter daemon start` |\r
| Stop daemon | `clawmeter daemon stop` |\r
| Install as service | `clawmeter daemon install` (ask user first) |\r
| View daemon logs | Check `~/.local/state/clawmeter/daemon.log` |\r
| Database stats | `clawmeter history stats` |\r
| Export history | `clawmeter history export --format csv` |\r
| Purge history | `clawmeter history purge` (ask user first — destructive) |\r
\r
---\r
\r
## 6. Troubleshooting\r
\r
Common issues and how to handle them:\r
\r
**"No providers configured"** — Config exists but no providers are enabled. Help enable the relevant provider section in config.toml.\r
\r
**"Authentication error"** — Credentials missing or expired. Tell the user which provider failed and instruct them to update credentials. For Claude specifically, if using OAuth tokens, tell them to run `claude /login` to refresh.\r
\r
**"Stale data"** — Cache age is high and daemon isn't running. Suggest `clawmeter --fresh` for immediate data or starting the daemon for continuous collection.\r
\r
**"Command not found after install"** — May need to add to PATH. Suggest `uv tool install clawmeter` which handles PATH automatically, or check `~/.local/bin`.\r
\r
---\r
\r
## 7. Response Guidelines\r
\r
- **Be concise by default.** One to three lines for casual queries. Expand only when asked.\r
- **Use natural language, not raw JSON.** Parse the output and present it conversationally.\r
- **Highlight warnings and critical states.** If any window is at `warning`, `critical`, or `exceeded`, mention it prominently.\r
- **Include reset times.** Users almost always want to know when their quota resets.\r
- **Round percentages.** Say "57%" not "57.234%".\r
- **Use the provider's display name.** "Anthropic Claude" not "claude".\r
- **Don't speculate about costs unless data is available.** Only report `cost` if the `model_usage` entries include it.\r
- **Australian English for prose** ("utilisation", "colour") consistent with the project style.\r
Usage Guidance
This skill appears to do what it says: it uses your local clawmeter tool to report usage and manage the clawmeter daemon. Before installing or running it, consider: 1) the agent may run commands like 'pip install clawmeter' and 'clawmeter daemon install/start' if you explicitly say yes — installing packages and modifying systemd services are sensitive actions, so only consent if you trust the skill and the clawmeter package; 2) the skill explicitly forbids handling API keys or reading credential files, but you should still never paste secrets into the conversation; if you accidentally paste a key, rotate it immediately; 3) the skill will write a non-secret config skeleton to ~/.config/clawmeter/config.toml — review that file before adding credentials; 4) if you need stronger guarantees, review clawmeter's source/package before installing or run installation in a sandboxed environment.
Capability Analysis
Type: OpenClaw Skill Name: llm-monitor Version: 0.7.5 The llm-monitor skill is designed to interface with the 'clawmeter' CLI tool to track LLM usage and costs. It includes robust security instructions in SKILL.md that explicitly forbid the agent from handling or reading API keys and credentials, directing users to manage them securely via their own editor. The skill performs standard operations like checking for the tool's installation, managing a background daemon, and parsing JSON output for user queries, all of which are consistent with its stated purpose.
Capability Tags
requires-oauth-token
Capability Assessment
Purpose & Capability
Name/description (LLM usage/cost/quota monitoring and clawmeter management) match the instructions: checks for clawmeter, config skeleton, daemon status, and runs clawmeter to parse usage. No unrelated services, credentials, or binaries are requested.
Instruction Scope
Instructions explicitly forbid handling credentials and avoid reading credential files; they direct the agent to run local clawmeter commands and to create a non-secret config skeleton. This is within scope. Note: the skill tells the agent to offer to install packages and start systemd services if the user consents — these are legitimate for the stated purpose but are sensitive actions that should only be run with explicit user approval.
Install Mechanism
No install spec in the registry (instruction-only). The runtime suggests using pip or an 'uv tool' to install clawmeter if the user agrees; using pip is appropriate for this purpose. No external download URLs or extract operations are present in the metadata.
Credentials
The skill declares no required environment variables or credentials and the SKILL.md reiterates a strict 'never accept/store credentials' rule. It asks users to configure credentials locally (keyring, key_command, env) rather than providing them to the agent, which is proportionate.
Persistence & Privilege
always is false and the skill does not request persistent elevated privileges. It may instruct installation of a daemon (systemd) when explicitly requested — the skill asks for user confirmation before modifying system services.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install llm-monitor
  3. After installation, invoke the skill by name or use /llm-monitor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.7.5
llm-monitor 0.7.5 changelog - Adds robust pre-flight checks for clawmeter installation, configuration, and daemon status before answering usage queries. - Enhances support for multiple LLM providers, with secure setup guidance for Claude, OpenAI, Grok, Ollama, or all at once. - Expands query handling: now supports simple summaries, detailed breakdowns, historical usage, provider-specific, and fresh/live data requests. - Implements strict security rules: never handles credentials directly, and warns users if secrets are shared. - Guides users through first-time setup and troubleshooting, including config creation and daemon management steps.
Metadata
Slug llm-monitor
Version 0.7.5
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is LLM Monitor?

Monitor and report usage, costs, quotas, and rate limits for LLM providers, plus manage clawmeter setup and daemon status securely. It is an AI Agent Skill for Claude Code / OpenClaw, with 100 downloads so far.

How do I install LLM Monitor?

Run "/install llm-monitor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is LLM Monitor free?

Yes, LLM Monitor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does LLM Monitor support?

LLM Monitor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created LLM Monitor?

It is built and maintained by Daniel Thomas (@danielithomas); the current version is v0.7.5.

💬 Comments