clawmetry: Instructions file for Claude Code

CLAUDE.md

clawmetry CLAUDE.md is an instructions file for Claude Code from vivekchand/clawmetry. It costs 10,777 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is vivekchand/clawmetry's own configuration. It tells Claude Code how to work on clawmetry itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything clawmetry configures →

Reuse

Borrowing it

Nothing to install: this file belongs to vivekchand/clawmetry. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/vivekchand/clawmetry/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/vivekchand/clawmetry

Made for: Claude Code.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for clawmetry CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/vivekchand/clawmetry/claude-md"><img src="https://agentmods.dev/badge/instructions/vivekchand/clawmetry/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10,777 This file is loaded in full into every session.
When invoked 10,777 The same file — it is already loaded in full.
Security scan D 2 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.10777 $0.10777
Opus 5.5 $0.04311 $0.04311
Sonnet 5.5 $0.02155 $0.02155
Haiku 4.5 $0.01078 $0.01078

Measured 4d ago against content hash 08fdb0d66f6d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 4d ago.

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 · 335 lines

How it starts

The opening of the file, as written. The whole thing — 335 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 and governance layer for 32 AI agent runtimes — OpenClaw, NVIDIA NemoClaw, Goose and Qwen Code free in OSS, the other 28 (Claude Code, Codex, Cursor, Copilot, Gemini CLI, Hermes, Aider, opencode, ...) with the optional Pro plugin. Never type that number or that list anywhere new: SUPPORTED_RUNTIMES.txt is the generated single source every surface derives from (python3 scripts/sync_runtime_count.py; --check fails CI on drift). pip install clawmetry && clawmetry — that's it. Zero config, observation by default.

Never hardcode the runtime count or the runtime list anywhere new. The authoritative sources are entitlements.FREE_RUNTIMES | entitlements.PAID_RUNTIMES (the catalogue, and what every quoted number is derived from) and sync._FAMILY_ADAPTER_SPECS (what the daemon actually loads — a clawmetry-pro adapter is inert until it is named there). scripts/sync_runtime_count.py rewrites the number in prose and CI fails on drift; the same script checks the chat-channel count against entitlements.ALL_CHANNELS.

Architecture

See ARCHITECTURE.md for the full deep dive, and docs/MODULE_MAP.md (generated) for every module and blueprint. 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 or more Blueprints and the endpoints registered on them. New endpoints land in their feature's module so parallel PRs don't stomp on each other.
  • Shared helpers are migrating out of dashboard.py into helpers/; route modules reach the ones still in dashboard.py via late import dashboard as _d.
  • Zero config — auto-detects runtimes, 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.
  • Assistant execution stays on the node. Local routes/assistant.py and routes/dashboards.py use clawmetry/assistant_http.py and typed daemon RPCs. Hosted requests arrive through clawmetry/assistant_relay.py as authenticated encrypted operations. Both use one clawmetry/assistant_executor.py and clawmetry/assistant_service.py, sharing provider limits, SELECT validation, conversations and saved panels. clawmetry/assistant_receipts.py atomically commits paid/mutating results with their artifacts; retries cannot start the same paid request again. Do not add inference or a writer fallback inside Flask or the cloud container.
  • Five ingest paths (all land in DuckDB): filesystem (JSONL/logs), gateway WebSocket (JSON-RPC), optional OTLP receiver (/v1/metrics, /v1/traces, /v1/logs), runtime hooks (clawmetry hook <runtime>, the only pre-tool path), and the HTTP ingest API (/api/v1/runs/*) for a runtime with no adapter

Read the full file on GitHub · 335 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. 4d ago Changed · +54 tokens per session 08fdb0d66f6d
  2. 13d ago Changed ab42b7822196
  3. 20d ago Changed · +1 lines · +51 tokens per session 22956bfd3051
  4. 22d ago Changed · +9 lines · +250 tokens per session f2a20702d6b2
  5. 1mo ago Changed · +1 lines · +140 tokens per session 338674388e9f
  6. 1mo ago Changed · +2 lines · +88 tokens per session f36fbe067cc1
  7. 1mo ago Changed · +1 lines · +91 tokens per session ed248fd64a7a
  8. 1mo ago Changed · +1 lines · +51 tokens per session 30e470b108cd
  9. 1mo ago Changed · +10 lines · +566 tokens per session c750e39467b6
  10. 1mo ago First seen · 310 lines · 9,486 tokens per session scan D fe9180aaa8e5

Subscribe to this mod's changes

clawmetry CLAUDE.md is an instructions file published in the GitHub repository vivekchand/clawmetry (436 stars, last pushed yesterday), licensed MIT. It adds 10,777 tokens to every session, about $0.0431 per session on Opus 5.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.

Related

clawmetry CLAUDE.md compared with instructions from other repositories

clawmetry CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
clawmetry CLAUDE.mdvivekchand/clawmetryInstructions file436yesterdayMITD10,777Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode