Documents

OpenClaw Usage Report

Try it

OpenClaw usage and performance reporting. Parse session JSONL to answer how long each agent task took, which tools/skills/models were used, and how many tokens were consumed — zero dependency, local only, no cost dimension (the script reads, computes and outputs no cost fields at all; token is the primary metric). Read-only: never modifies any file. Outputs are aggregated statistics only: no conversation content, no session identifiers (session-level detail is opt-in via --include-sessions) and no credential fields. The time window is a hard boundary: with a window selected (or the default "today") every dimension aggregates in-window events only, and full history requires the explicit --all flag. Documentation, report and JSON output follow the same scope; links in the docs are human-readable references, the runtime script makes no network calls. Report text defaults to Chinese and can be adapted to the user's language; the skill imposes no language or region restriction. Use when the

What it does

OpenClaw 用量与性能查询工具:读取本地 session JSONL(), 输出任务耗时、工具耗时、模型 token/耗时、skills 使用、每日趋势。

The skill document

OpenClaw Usage Report

OpenClaw 用量与性能查询工具:读取本地 session JSONL(state/agents/*/sessions/*.jsonl), 输出任务耗时、工具耗时、模型 token/耗时、skills 使用、每日趋势。

零依赖(纯 Python 标准库)、纯本地、无外部服务、无成本维度(token 为主指标)。

触发场景

  • 「今天花了多少 token」「哪个工具最慢」「哪个 agent 用 token 最多」
  • 「每次任务花了多久」「用了哪些技能」
  • 优化应用前的用量基线分析

用法

python /xiaoyaoclaw-usage-report/scripts/usage-report.py --today    # 今日(默认全维度)
python /xiaoyaoclaw-usage-report/scripts/usage-report.py --week     # 近 7 天
python /xiaoyaoclaw-usage-report/scripts/usage-report.py --all      # 全部
python /xiaoyaoclaw-usage-report/scripts/usage-report.py --agent    # 按 agent 过滤
python /xiaoyaoclaw-usage-report/scripts/usage-report.py --by-tool  # 仅工具耗时
python /xiaoyaoclaw-usage-report/scripts/usage-report.py --skills   # 仅技能使用
python /xiaoyaoclaw-usage-report/scripts/usage-report.py --today --json   # JSON 输出

数据目录自动检测(Windows 小遥Claw:C:\Users\\AppData\Roaming\xiaoyaoclaw-desktop\runtime\openclaw\state);覆盖用 --state <路径> 或环境变量 OPENCLAW_STATE。

输出维度

  1. 总览:任务数、总 token(input+output)、总耗时
  2. 按 agent/模型:调用次数、输入/输出 token、模型总耗时/平均(近似)
  3. 按工具:次数、失败数、总耗时、平均、最慢
  4. Skills 使用:技能名、读取次数、使用 agent
  5. 任务排行:按活跃耗时(排除用户思考间隔)
  6. 每日趋势:每日输入/输出 token、调用数

统计口径(务必遵守)

  • token 真实消耗 = input + output(totalTokens 含 cacheRead 会重复计数,禁用;实测虚高 1.3x~14x+)
  • 工具耗时 = toolResult.ts − assistant(toolCall).ts(含模型决策时间)
  • 模型耗时 = 近似估算(事件顶层 ts 间隔,cap 10min;⚠️ 不能用 message.timestamp,那是批量写入时间戳;精确值在 diagnostics-otel 事件层)
  • 无成本维度:各供应商定价不同,token 是通用主指标
  • skills 仅统计被 read 加载过的(metadata 注入不计)

Cron 每日日报(可选项,用户自行设置)

工具支持 --today --json,可挂定时任务生成日报。是否启用由使用者决定:

  • OpenClaw cron:agentTurn 跑脚本 + delivery.announce 推送(示例见 README.md)
  • 或 Windows 计划任务 / Linux crontab 直接执行脚本输出到文件

限制

  • 活跃耗时为近似值(间隔 <5min 累计,可能含 heartbeat)
  • 仅支持 JSONL version 3 会话
  • 仅统计本机数据

环境要求

  • Python 3.8+(标准库,零依赖)
  • 可读 OpenClaw state 目录

姊妹项目

与 xiaoyaoclaw-workspace-initializer(家/规范)、xiaoyaoclaw-memory-distill(内容/记忆)、 xiaoyaoclaw-task-progress-tracker(状态/进度)、xiaoyaoclaw-kb-retriever(知识/检索)、 xiaoyaoclaw-workspace-auditor(健康/体检)、xiaoyaoclaw-web-clipper(输入/剪藏)、 xiaoyaoclaw-agent-orchestrator(协作/编排)组成小遥生态工具链。

Related skills

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván558 installs18 stars

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván855 installs69 stars

Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.

by fly0pants4.3k installs296 stars

Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.

by nssa.io1.0k installs47 stars

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai21 installs8 stars

More from dtsola

Browse all skills

SEO analysis and optimization skill for websites. Use when auditing a site's search visibility, fixing rankings/traffic drops, optimizing pages for Google (Baidu/Bing) and AI search (ChatGPT/Perplexity/AI Overviews). Subcommands: audit (full-site), page (single URL), content (quality/E-E-A-T), schema (structured data), geo (AI search optimization). Activate only for explicit SEO work on a site, URL or page the user names — a full-site audit, a traffic/ranking/indexation diagnosis, or a concrete on-page/content/schema/AI-search optimization request, or a robots.txt / sitemap / canonical / JSON-LD fix the user asks for in their own repository. Do NOT activate for: general questions about SEO concepts ("what is SEO?"), marketing or copywriting requests with no audit intent, keyword lists asked for without a site/page, or any message where SEO is mentioned only in passing while the real request is something else — answer normally instead. 中文:网站搜索可见性分析与优化技能。当用户想优化网站搜索排名、做 SEO 审计、 诊断流量下降/排名消

by dtsola2 installs

OpenClaw skill that beautifies GitHub READMEs: redesign a repository homepage or create project-native visual assets — pure SVG heroes, section headers, diagrams, badges, GIF motion graphics, showcase modules, or hybrid SVG-composed PNG/WebP — with built-in render-level visual verification (scripts/visual_verify.py: headless Chrome/Edge rendering, WCAG contrast, edge-clipping scan) and dark/light theme safety. Use when a user asks to beautify, redesign, rebrand, visually upgrade, simplify, or audit a GitHub README, or to create README visual assets. If whole-README work versus asset-only work is unclear, ask which scope the user wants. For hero-like assets where pure SVG and generated raster material are both viable, explain the tradeoffs and confirm the implementation before creating the asset. Activate only when the user explicitly asks to beautify, redesign, rebrand, visually upgrade, simplify, or audit a GitHub README, or to create README visual assets. Do not activate for general

by dtsola1 installs

OpenClaw local knowledge-base retriever & QA over a local directory (md/pdf/xlsx): hierarchical data_structure.md index navigation + progressive retrieval, core retrieval zero-dependency, Windows & macOS (PDF/Excel need on-demand pip packages, see skill body). Retrieval itself is read-only; the skill also ships optional maintenance scripts that WRITE files inside the knowledge base — scripts/build_index.py generates/updates data_structure.md index files, scripts/extract_pdf_text.py writes derived .txt files, and scripts/convert_pdf_to_images.py writes page PNGs for the optional OCR path — and those run only when the user asks for indexing/PDF text extraction and confirms the write. Every write target is resolved to its real path and must stay inside the knowledge-base root (symlinks cannot redirect a write outside). Reads use the same gate: each entry's real path must stay inside the root, and entries that escape it (symlinked files/folders) are skipped, never read — so the search cann

by dtsola

Drive OpenClaw with Claude Code, Codex, OpenCode, Trae, DSH etc. — command the gateway, its agents and channels, from any Agent Skills tool. Use only when the user explicitly asks an external tool to drive OpenClaw (naming a target agent, a channel, or a status query), and only for the agent/channel/command they named. Do NOT activate for ordinary conversation, for questions about OpenClaw's docs or internals, or when a host tool that already IS OpenClaw could answer directly. Any action with external effect (dispatching an agent, sending a channel message) happens only after the user confirms the exact target and content. 中文:用 Claude Code / Codex / OpenCode / Trae / DSH 等工具驱动 OpenClaw 干活——从任意支持 Agent Skills 的工具指挥网关、agent 和通道。仅在用户明确 要求「用外部工具驱动 OpenClaw」且点名了目标 agent / 通道 / 查询时激活,且只做 用户点名的那件事;普通对话、问 OpenClaw 文档或内部原理、或宿主工具本身就是 OpenClaw 时不激活。任何有外部效果的动作(派任务、发消息)都必须先让用户确认 确切目标与内容再执行。

by dtsola

OpenClaw memory distillation & organization. Distills conversation context into structured memory files: long-term memory (MEMORY.md at workspace root) + daily logs (memory/YYYY-MM-DD.md). Solves context overflow, auto-builds MEMORY.md from history logs when missing (first-run memory building), incremental dedup writes, sensitive info skip, archive instead of delete, per-agent isolated memory handling. Writes only inside the workspace: the root MEMORY.md and memory/YYYY-MM-DD.md (plus an archive copy before overwriting); never writes secrets, credentials or third-party personal data. Scheduled runs report only unless autoWrite is explicitly enabled. Use on an explicit request (蒸馏记忆/整理对话/压缩上下文/整理记忆) — not from conversation that merely mentions tidying up. 中文:OpenClaw 记忆整理工具。 将对话蒸馏为结构化记忆(根目录 MEMORY.md + memory/ 日志),解决上下文溢出; MEMORY.md 缺失时从历史日志「首次建忆」;增量去重写入防膨胀;敏感信息自动跳过; 只归档不删除;每个 agent 只处理自己的记忆。写入只发生在工作区内(根 MEMORY.md + memory/YYYY-MM-DD.md + 首次配置时创建/更新的 distill-config.json,覆盖前先留归档); 不写密钥/凭

by dtsola

OpenClaw context check / context optimization (Context Budget). Core goal = context optimization: reads the models currently enabled in this installation, reads each model's published context window from its vendor's official source, and proposes a window = 60% of the vendor spec. It writes nothing until the user confirms; then it patches only the window field and reports the result. This skill never runs automatically and creates no scheduled jobs. Use ONLY when the user explicitly asks, with one of these exact intents: 上下文检查 / 上下文优化 / 检查一下模型上下文 / 把上下文窗口配一下 / 设置上下文窗口, or in English: context window check, configure context window, context optimization. Do NOT activate on generic talk about context, memory, prompts, or token usage. 中文:按「厂商标称窗口 × 60%」设置已启用模型的上下文窗口;流程 = 检测(只读)→ 决策(用户回一个数字)→ 执行(确认后写入)。 不做:maxTokens 等其它参数、压缩阈值(保持系统默认)、未在用模型的默认配置、自动/定时运行、修改历史与审计留痕。

by dtsola