vivekchand/clawmetry 项目提供了一种名为 “Clawmetry” 的工具,用于监控和治理多个 AI 代理运行时。在 AI 领域,开发者常常需要运行和监控多种 AI 代理,比如 Claude Code、Cursor、OpenAI Codex、GitHub Copilot 等。尽管每种代理都有其独特优势,但统一管理和监控这些代理的运行时信息(如实时 Token 成本、会话、工具调用等)却是一个相当大的挑战。此外,还要考虑不同代理之间的异步通信和数据流管理。Clawmetry 通过提供零配置的可观测性和治理功能,显著简化了这一任务,填补了现有工具的空白。
首先,用户请求将被传递给 Clawonomy 服务,这里负责接入和解析不同类型的 AI 代理。随后,Clawmetry 服务对解析后的数据进行处理,并将处理后的信息推送至 Meteronator 服务,后者负责实时计算 Token 成本,并监测代理运行时的健康状况。
graph TD
A[用户请求] --> B("Clawonomy 服务")
B --> C("解析与接入代理")
C --> D("Clawmetry 服务")
D --> E("数据处理和聚合")
E --> F("Meteronator 服务")
F --> G[实时成本监控]
F --> H[状态同步]
An agent can make a hundred tool calls without making progress. ClawMetry
reads the session files your coding agents already write, and puts the timeline,
the tool calls and whatever token and cost data the runtime exposes into one
view — so you can tell a long run that is working from one that is stuck.
Works with 32 AI agent runtimes — Claude Code, OpenAI Codex, Hermes, OpenClaw & 28 more. One dashboard for your whole agent fleet. (the full list, generated from the catalogue.)
One command. Zero config. Auto-detects everything.
pip install clawmetry && clawmetry
Opens at http://localhost:8900. Zero config: it finds the agent runtimes
you already have, reads them read-only, and changes nothing about how they run.
Before you install
What it does
Reads the session files and logs your agents already write. No SDK, no code change, no instrumentation in your app.
What you see
Session timeline, tool-by-tool replay, token and cost breakdown, and trajectory signals (looping, repeated failures) — per runtime.
What’s free
pip install clawmetry reads OpenClaw, NVIDIA NemoClaw, Goose and Qwen Code with no account, no key and no network call. The other 28 — Claude Code, Codex, Cursor and the rest — are read by the closed-source clawmetry-pro companion, which arrives with the 7-day trial or a plan — see docs/ENTITLEMENTS.md for the exact split.
How to start
pip install clawmetry && clawmetry, then open localhost:8900. No agents on this machine yet? clawmetry --sample opens on three labelled synthetic sessions.
What leaves your machine
No session data, unless you run clawmetry connect. Two things do run by default, both opt-out and neither carrying session content: an anonymous install ping and a PyPI version check. Every destination is inventoried in docs/EGRESS.md, rebuilt from a wire capture rather than from reading comments.
Two limits worth knowing before you judge the output: runtimes expose very
different data (some publish no cost at all — the matrix
says which, per runtime), and observing an action is not the same as being able
to block it (which controls are real, per runtime).
Every runtime gets the same dashboard. Run several at once and the header
switcher re-scopes every tab to one of them.
Built your own agent on an SDK instead? The interceptor tracks its LLM calls
too. See docs/SDK_TRACKING.md.
Building with a humanoid robot? The free, open-source
Asimov 1 connector imports Menlo SDK recordings and provides
an optional observation collector and application tracing. This support is
experimental. Physical hardware qualification is pending.
Jumper observation is also built into the same open-source
package. Its application telemetry, task decisions and incidents appear in the
shared Physical AI view. Mizu’s separate scene and skills demo imports this
built-in adapter; it is not another observer plugin to install.
What you get
Sessions & transcripts: what each agent did, turn by turn, with replay
Cost & tokens: per runtime, model, session and day, with anomaly flags
Flow: live diagram of messages moving through channels, models and tools
Brain: the reasoning and tool-call event stream as it happens
Context blowout: window utilization sized per provider, compaction vs forced overflow, plus a per-runtime map of what we can’t see (how)
Memory & skills: the files and skills each runtime actually loaded
Health & logs: disk, memory, error rates, rate limits, live log stream
Approvals: pause risky tool calls before they run and approve from your phone (how)
Context blowout, and what watching costs
Two questions worth answering before you trust any agent-comparison tool.
How does it handle context-window blowout across runtimes?
A utilization percentage is only as honest as what it divides by. ClawMetry
sizes the window per provider from a table you can read and
PR, covering Anthropic, OpenAI, Google, xAI,
DeepSeek, Kimi, Qwen, Mistral, Llama and GLM. It does not measure all 32
runtimes with one vendor’s ruler. That matters: a 300K GPT-5 turn scored
against Anthropic’s 200K reads “>100%, blown” when it is really at 75% of
GPT-5’s 400K. The same ruler hides a genuinely overflowed 130K DeepSeek turn
as a comfortable 65%.
Every window ships with its provenance: model_table, explicit_marker,
observed_floor, or an honest default when we don’t know the model. A
gauge built on a guess never renders with the same authority as one built on
a lookup.
ClawMetry can only see compaction events on some runtimes. So
GET /api/context-coverage reports, per runtime, whether a zero means
“ran clean” or “we’re blind”. A 0 that actually means blind says so.
Full detail
What does the instrumentation cost?
Path
Added to your agent
Default?
Session-file tailing (all 32 runtimes)
0. Separate process, no ClawMetry code in your agent
on
HTTP interceptor (CLAWMETRY_INTERCEPT=1)
+0.44 ms per LLM call, or 0.009% of a 5s call
off
Pre-tool hook gate (warm cache)
+44 ms per gated tool call, over a 36 ms interpreter floor
off
Enforcement proxy
+9.7 ms per LLM call
off
Daemon host cost: 2,762 events/sec ingest, 710 bytes/event on disk
(67.7 MB per 100k events), and ~12% of one core sustained on a busy
install. That last number is over our own stated 5-10% budget, so it is
published as a bug to chase rather than left off the page.
Measured on an Apple M2 Pro with benchmarks/overhead.py. The harness runs
each condition in a separate process, alternates their order, and refuses
to print a number when the rounds disagree on its sign. Run it on your own
machine in a minute:
Every path is measured, including the hook gates and the enforcement proxy,
and the harness runs on Linux, macOS and Windows in CI. Two results worth
knowing: the proxy costs about seven times more on Windows than on Linux, and
the daemon currently sustains about 12% of one core, over our own 5-10%
budget. The raw JSON, the method, and what is still unmeasured are in
docs/OVERHEAD.md.
Pricing
Plan
What it covers
Price
Free
OpenClaw + NVIDIA NemoClaw + Goose + Qwen Code, full dashboard, local only
$0
Starter
Every other runtime above, fleet view, cloud sync
$9 per node / month
Pro
Starter + control and evaluation: approvals, tool-risk policies, evals, anomaly detection, cost optimizer, OTel export, tamper-evident audit log
$19 per node / month
Annual plans, Enterprise and the current numbers live at
clawmetry.com/pricing. Self-hosted license
keys work without the cloud (clawmetry license). The exact free/paid split is
in docs/ENTITLEMENTS.md.
Your data stays on your machine
ClawMetry reads local session files and logs. No session data leaves your box
unless you run clawmetry connect — no prompts, replies, tool arguments, file
contents or log lines. When you do connect, the snapshot is end-to-end encrypted
with a key that never leaves your machine, and decrypted in your browser. If a
node has no key, the upload is skipped rather than sent in the clear, and no
server response can turn that off.
Two things do run by default before you connect, both opt-out and neither
carrying session data: an anonymous install ping and a version check against
PyPI. A default install also looks up your public IP once for a startup banner
line. Every destination, what it carries and how to switch it off is listed in
docs/EGRESS.md; self-hosted, repointed and air-gapped installs
make no discretionary outbound calls at all.
The decryption happens in your browser, in code we serve you. That used to be
a promise; it is now something you can check. Every line that touches your key
lives in one readable file, clawmetry/static/js/cm-e2e.js,
which ships inside the wheel and is served verbatim, pinned with a Subresource
Integrity hash. To confirm the browser runs what we published:
What that does not prove: we serve the page that loads the file, so we could
serve a different page. Integrity hashes protect you from a compromised CDN,
not from the vendor. What you gain is that any substitution has to be
deliberate, visible in the page source, and different from an artifact on PyPI
that anyone can fetch. Self-hosting or staying local-only removes the
dependency entirely.
Install
pip install clawmetry # then: clawmetry
Or the one-liner: curl -sSL https://raw.githubusercontent.com/vivekchand/clawmetry/main/install.sh | bash
Needs Python 3.8+ on macOS, Linux or Windows, and at least one agent runtime on
the same machine. Docker instructions: docs/DOCKER.md.
Or let the agent set it up for you. The agent-kill-switch
skill teaches Claude Code, Codex, Cursor, Gemini CLI, Copilot or OpenCode to
install ClawMetry, report what the agents on the machine are doing and spending,
stop one session on request, and hold risky tool calls for approval:
The anonymous install and desktop-open pings, and how to turn them off
Screenshots
Every number below is from one real machine, read-only, with nothing seeded.
It tells you when something is wrong, not just what happened.
Two anomaly banners at the top: spend running 7x the daily average, and a
4.2x cost spike. Below them, 324 of 667 recent sessions carrying a waste
signal, itemised by cause.
It shows you where the money went, in every window.
$252.47 today, $513.15 this week, $1,312.92 this month, each with the tokens
behind it and how much of it your subscription already covers. Below that,
about $1,128/mo itemised as recoverable and $17,256/mo already saved by
cache reuse.
It draws how a message becomes an answer.
The live flow diagram: you, the channel it arrived on, the gateway, the model
answering right now, and every tool it reached for. Nodes light up as work
moves through them.
Every agent on the machine, in one table.
What it runs, what it costs in the last 24 hours and over its lifetime, when
it was last seen, who owns it, and whether a subscription is covering the
bill. 14 agents here, 3 sessions working, 13 quiet.
It shows where a turn’s time and money went, tool by tool.
One turn of a real session: 11 tools in 11.2 minutes for $1.16. Every Bash
call and model call gets its own bar on the timeline, so the command that ran
for 4.1 minutes and the one that ran for 226ms are told apart at a glance.
It grades the work, not just the spend.
An A this week: 54 tasks came back clean, 2 rough ones cost $48.57, and the
runs with too little activity to judge are left out of the grade instead of
being counted as wins. Each rough run links to its trace.
It shows why the context window keeps filling up.
715K of a 1M-token window on the latest turn, an 83.3% peak, 4 compactions
that all fired proactively rather than on an overflow, and the utilisation of
every turn behind it.
Detection runs without you configuring anything.
The built-in detectors are on from install: agent went quiet, telemetry feed
stopped, cost spike, token burst, errors climbing, error spike, budget
threshold, threat signature matched, security tool finding, security posture
changed. Your own rules are optional on top.
Holding a risky call is opt-in, and ships off.
Recursive deletes, force pushes, sudo, secrets, package installs and outbound
calls each get a rule you can turn on. Until you do, ClawMetry watches and
changes nothing. Once one is on, matching calls wait here (or on your phone)
for an approve or a deny.
评论