clawmetry CLAUDE.md

clawmetry CLAUDE.md is an instructions file for coding agents from vivekchand/clawmetry. It costs 6,000 tokens per session, scanned D, original, MIT.

A repository guide for ClawMetry, an open-source dashboard that monitors OpenClaw AI agents in real time. It covers the Flask application, route modules, automatic workspace detection, and its observation and control behavior.

In plain words
What is it for?
Use it when adding dashboard routes, working with sessions or usage data, inspecting OpenClaw activity, or preparing a release.
Why use it?
It explains the project's shipping process and architecture so changes fit the existing Flask dashboard and deployment workflow.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/vivekchand/clawmetry/claude-md
Clone the repo
git clone --depth 1 https://github.com/vivekchand/clawmetry

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for clawmetry CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/vivekchand/clawmetry/claude-md.svg)](https://agentmods.dev/instructions/vivekchand/clawmetry/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/vivekchand/clawmetry/claude-md"><img src="https://agentmods.dev/badge/instructions/vivekchand/clawmetry/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 6,000 This file is loaded in full into every session.
When invoked 6,000 The same file — it is already loaded in full.
Security scan D 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.06000 $0.06000
Opus 5 $0.03000 $0.03000
Sonnet 5 $0.01200 $0.01200
Haiku 4.5 $0.00600 $0.00600

Measured today against content hash 1c4232bd09ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade D, and why

clawmetry CLAUDE.md scanned grade D with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Tells the agent never to refusehighAnti-refusal

Suppressing the ability to decline removes a core safety control; a later harmful request then succeeds.

**Capability is answered per session, from one place.** `process_control.runtime_control_support(runtime, session_id, cwd)` is the single verdict the Guard tab, the daemon and the actuator all read; never re-derive it. T

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- **Never delete a hook you did not write** — `~/.claude/settings.json` has other writers (GitLens's `gk ai hook install claude-code --force`, `numbat`, the user) and ClawMetry itself writes it from three places. Every r
CLAUDE.md · 214 lines

How it starts

The opening of the file, as written. The whole thing — 214 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md — ClawMetry

Read FLYWHEEL.md first. It is how you ship a change end to end here (code → PR → green CI → [RELEASE] → PyPI → cloud → verified live) and the non-negotiable "done" bar. This file is the architecture reference; FLYWHEEL.md is the shipping loop.

What is this?

ClawMetry is an open-source, real-time observability dashboard for OpenClaw AI agents. pip install clawmetry && clawmetry — that's it. Zero config, observation by default.

Architecture

See ARCHITECTURE.md for the full deep dive. TL;DR:

  • Flask app with embedded HTML/CSS/JS frontend (no build step, no npm)
  • Per-feature route modules under routes/routes/sessions.py, routes/usage.py, etc. — each owns one Blueprint and the endpoints registered on it. New endpoints land in their feature's module so parallel PRs don't stomp on each other.
  • Shared helpers stay in dashboard.py for now and are accessed from route modules via late import dashboard as _d. (Helpers will migrate to helpers/ over time.)
  • Zero config — auto-detects OpenClaw workspace, gateway, sessions, logs
  • Observation by default, control when asked — see "Control plane" below. Reads never require permission; writes are always user-initiated or policy-declared
  • DuckDB-first — the sync daemon ingests filesystem/gateway/OTLP into a local DuckDB store (clawmetry/local_store.py; the daemon owns the writer lock). Request handlers read from DuckDB via routes/local_query.py, not raw files — reading raw JSONL/logs inside a handler works locally but returns empty in cloud (the container has no ~/.openclaw). Optional history.py adds a separate SQLite time-series.
  • Three ingest sources (all land in DuckDB): filesystem (JSONL/logs), gateway WebSocket (JSON-RPC), optional OTLP receiver

Key Files

Core

File Lines Purpose
dashboard.py ~17,300 Flask app, blueprint registration, shared helpers (live frontend now lives in static/ + templates/)
history.py ~555 Optional time-series collector (SQLite, polls gateway every 60s)

Read the full file on GitHub · 214 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +2 lines · +506 tokens per session scan B → D 1c4232bd09ef
  2. 4d ago First seen · 212 lines · 5,494 tokens per session scan B 8d3a6e0a48f7

Subscribe to this mod's changes

clawmetry CLAUDE.md is an instructions file published in the GitHub repository vivekchand/clawmetry (404 stars, last pushed today), licensed MIT. It adds 6,000 tokens to every session, about $0.0300 per session on Opus 5. A static security scan graded it D with 2 findings (tells the agent never to refuse, reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.