OpenClaw Tally
Reframes AI usage from token-counting to task-completion economics. Instead of "how many tokens?", answer "how much to get X done, and was it worth it?"
🛠️ Installation
1. Ask OpenClaw (Recommended)
Tell OpenClaw:
"Install the openclaw-tally skill." The agent will handle the installation and configuration automatically.
2. Manual Installation (CLI)
If you prefer the terminal, run:
CODEBLOCK0
Security & Privacy Declaration
- - Hook: This skill registers a
message-post hook and processes every message. - Local only: All processing is purely local. No data is sent to any external server.
- Message content: The task detector reads message text to identify task boundaries (start/complete/fail signals) using regex pattern matching. No message text is stored — only metadata (token count, model, session_id, complexity score) is persisted to the database.
- Sandboxed storage: SQLite database defaults to
~/.openclaw/tally/tally.db. A custom path can be provided for testing. - Native dependency: Requires
better-sqlite3 (native Node.js addon). Installation runs npm install which triggers a native build step. - Permissions: No network access. No exec permissions. Filesystem limited to
~/.openclaw/tally/.
What It Does
- - Detects tasks automatically from message streams (Layer 1: Task Detector)
- Attributes costs across sessions, sub-agents, and cron triggers (Layer 2: Task Ledger)
- Computes TES (Task Efficiency Score) per task, model, and cron (Layer 3: Analytics Engine)
Commands
- -
/tasks list — Show recent tasks with status, cost, and TES - INLINECODE6 — Summary statistics for a time period
- INLINECODE7 — This week's task summary
- INLINECODE8 — Show task detail
- INLINECODE9 — Model efficiency report
- INLINECODE10 — Cron efficiency and health check
Complexity Levels
- - L1 (Reflex): Single-turn, text-only, no tools
- L2 (Routine): Multi-turn or 1–3 tool calls
- L3 (Mission): Multiple tools + file I/O + external APIs
- L4 (Campaign): Sub-agents + cron + cross-session
TES (Task Efficiency Score)
CODEBLOCK1
- - > 2.0 🟢 Excellent
- 1.0–2.0 🟡 Good
- 0.5–1.0 🟠 Below average
- < 0.5 🔴 Poor
- 0.0 ⚫ Failed
Usage
When the skill is installed, it automatically hooks into message-post. Use the /tasks commands above to query analytics. All data is stored locally in ~/.openclaw/tally/tally.db.
See PRD.md for the full product specification.
OpenClaw Tally
将AI的使用从token计数重构为任务完成经济学。不再问用了多少token?,而是回答完成X任务需要多少成本,是否值得?
🛠️ 安装
1. 询问OpenClaw(推荐)
告诉OpenClaw:
安装openclaw-tally技能。 代理将自动处理安装和配置。
2. 手动安装(CLI)
如果你更喜欢终端操作,运行:
bash
clawhub install openclaw-tally
安全与隐私声明
- - 钩子:此技能注册了一个message-post钩子,并处理每条消息。
- 仅本地:所有处理完全在本地进行。不会向任何外部服务器发送数据。
- 消息内容:任务检测器通过正则表达式模式匹配读取消息文本,以识别任务边界(开始/完成/失败信号)。不存储任何消息文本——仅将元数据(token数量、模型、会话ID、复杂度评分)持久化到数据库。
- 沙盒存储:SQLite数据库默认路径为~/.openclaw/tally/tally.db。可为测试提供自定义路径。
- 原生依赖:需要better-sqlite3(原生Node.js插件)。安装时运行npm install,会触发原生构建步骤。
- 权限:无网络访问权限。无执行权限。文件系统限制在~/.openclaw/tally/目录内。
功能说明
- - 自动检测任务:从消息流中检测任务(第一层:任务检测器)
- 归因成本:跨会话、子代理和定时触发器归因成本(第二层:任务分类账)
- 计算TES(任务效率评分):按任务、模型和定时触发器计算(第三层:分析引擎)
命令
- - /tasks list — 显示最近任务及其状态、成本和TES
- /tasks stats — 指定时间段的汇总统计
- /tasks this-week — 本周任务摘要
- /tasks show — 显示任务详情
- /tasks report --dimension model — 模型效率报告
- /tasks cron-health — 定时任务效率与健康检查
复杂度等级
- - L1(反射型):单轮对话,纯文本,无工具
- L2(常规型):多轮对话或1-3次工具调用
- L3(任务型):多个工具 + 文件I/O + 外部API
- L4(战役型):子代理 + 定时任务 + 跨会话
TES(任务效率评分)
TES = 质量评分 / (标准化成本 × 复杂度权重)
- - > 2.0 🟢 优秀
- 1.0–2.0 🟡 良好
- 0.5–1.0 🟠 低于平均水平
- < 0.5 🔴 较差
- 0.0 ⚫ 失败
使用说明
安装技能后,它会自动挂载到message-post钩子。使用上述/tasks命令查询分析数据。所有数据本地存储在~/.openclaw/tally/tally.db中。
完整产品规格请参见PRD.md。