360 Secure SkillHub
360 安全技能中心

Clawprobe

这是OpenClaw代理的实时可观测性CLI工具,核心功能包括查询代理健康快照、API成本明细、会话token时序、上下文利用率、优化建议及压缩事件,还提供实时刷新仪表盘。典型场景:会话启动前自检、高成本任务前评估、程序自监控。输入为CLI命令,输出支持结构化JSON(供程序调用)和人类可读界面,可依提示优化。

liuhao6741
liuhao6741
热度 64.68
最近更新 2026-05-11 17:33:20
分类:开发依赖:代码执行 / 第三方 API应用场景:DevOps / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add clawprobe
Metadata
name
clawprobe
description
Monitor OpenClaw agent health, token usage, API cost, and context window in real time. Use when you need to check your own status, inspect context utilization, estimate API costs, review compaction events, or get optimization suggestions. Provides structured JSON output for programmatic self-monitoring.
metadata
{"openclaw":{"emoji":"🦀","homepage":"https://github.com/seekcontext/ClawProbe"}}

clawprobe

Real-time observability for OpenClaw agents. Check health, token usage, API cost, context window, and optimization suggestions — all from the CLI.

Install

npm install -g clawprobe
clawprobe start

Core commands

Command What it does
clawprobe status --json Full health snapshot (session, model, context %, cost, alerts)
clawprobe cost --week --json API cost breakdown for the past week
clawprobe session --json Current session token timeline, turn by turn
clawprobe context --json Context window utilization and truncation warnings
clawprobe suggest --json Active optimization alerts with ruleId and action
clawprobe compacts --json List recent compaction events and lost content
clawprobe top Live auto-refreshing dashboard (human use)

Recommended self-check workflow

Run at session start or before any expensive task:

STATUS=$(clawprobe status --json)
UTIL=$(echo $STATUS | node -e "process.stdin.resume();let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>console.log(JSON.parse(d).utilizationPct))")
echo "Context: $UTIL%"

Or in a single call:

clawprobe status --json

Key fields to act on:

  • utilizationPct ≥ 85 → compact soon or start a fresh session
  • suggestions[].ruleId === "tools-truncation" → TOOLS.md is being cut off
  • suggestions[].ruleId === "cost-spike" → today's spend is unusually high
  • daemonRunning: false → run clawprobe start to enable monitoring

Handling suggestions programmatically

# List active suggestions
clawprobe suggest --json

# Dismiss a noisy rule
clawprobe suggest --dismiss memory-bloat --json
# → { "ok": true, "dismissed": "memory-bloat" }

Schema introspection

When you need to know exact field names for any command:

clawprobe schema status    # full field spec for status --json
clawprobe schema cost      # full field spec for cost --json
clawprobe schema           # list all available schemas

Error format

All errors under --json are structured — never colored text:

{ "ok": false, "error": "no_active_session", "message": "No active session found" }

Exit code is always 1 on error.

Cost note

Cost figures are estimates based on public model pricing. Verify exact amounts with your model provider's billing dashboard.