Audit-grade token and cost ledger for OpenClaw. Use when you need to (1) record every model call’s usage (input/output/cache read/cache write/cost) into SQLi...
Security Analysis
medium confidenceThe skill is internally coherent for building a local SQLite ledger from OpenClaw session JSONL files and does not request external credentials or perform obvious exfiltration, but there are a few implementation/friction issues and privacy considerations to review before running it as a daemon.
Name/description match the code and instructions: the scripts read OpenClaw session JSONL files and populate ~/.openclaw/ledger.db, provide queries and daily reports, and can be installed as a LaunchAgent. The requested resources (local files under ~/.openclaw and ability to write ~/Library/LaunchAgents) are consistent with the stated purpose. One inconsistency: SKILL.md and render_plist.py expect a LaunchAgent template file named com.openclaw.token-ledger-watcher.plist in the scripts directory, but that file is not present in the skill manifest — this will break the install instructions as provided.
SKILL.md instructs only local operations (one-shot scan, render plist, launchctl load/unload, sqlite queries). The watcher script reads ~/.openclaw/agents/main/sessions/*.jsonl and writes ledger.db and a checkpoint file — this is in-scope for a ledger. Important privacy note: session JSONL likely contains message content and other sensitive data; the skill stores usage_raw and other metadata in the DB. The instructions also assume the skill scripts live at ~/.openclaw/workspace/skills/token-ledger/scripts/, which may not match how the user installs the skill; and the missing plist template file is an operational gap.
No install specification or remote downloads; this is instruction-and-script only and runs with the system Python. No packages are pulled from external hosts and no archives are extracted, so the install surface is low-risk. The only persistence mechanism is an optional macOS LaunchAgent, which the user installs locally via the provided plist.
The skill requests no environment variables, no credentials, and accesses only files under the user's home directory (~/.openclaw and ~/Library/LaunchAgents). Those permissions are proportionate to the stated goal of auditing local OpenClaw session usage.
The skill does not set always:true and does not request elevated system privileges. However the recommended flow includes installing a user LaunchAgent on macOS, which grants the skill a persistent, automatic background process (user-level). Users should be conscious that the daemon will continuously read session JSONL files and write to ledger.db and a checkpoint file until they unload the LaunchAgent.
Guidance
This skill appears to do what it says: it watches your local OpenClaw session JSONL files and writes usage rows into ~/.openclaw/ledger.db, then provides queries and deterministic reports. Before installing or running it as a daemon: (1) Review the ledger_watcher.py code yourself (it will read session JSONL and store usage_raw — this may include message content); (2) Note the manifest is missing the expected com.openclaw.token-ledger-watcher.plist template referenced by render_plist.py and SKILL.md — you will need that file or must adapt the render step to your environment; (3) Test with the one-shot (--once) mode first to verify file paths and behavior; (4) If you intend to enable the LaunchAgent, understand it will run continuously as your user and read session files — only install it if you trust the code and accept the privacy tradeoff; (5) There are no network calls or external credentials requested by the included scripts, which reduces exfiltration risk, but always inspect any scripts before granting persistent execution. If you want higher assurance, ask the skill author for the missing plist file, or run the scripts in a sandboxed account first.
Latest Release
v0.1.0
Initial public release: SQLite token+cost ledger with watcher + safe query/report scripts.
More by @JonathanJing
Published by @JonathanJing on ClawHub