← Back to Skills Marketplace
jonathanjing

Token Ledger (SQLite)

by Jonathan Jing · GitHub ↗ · v0.1.0
cross-platform ⚠ suspicious
342
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install token-ledger
Description
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...
Usage 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.
Capability Analysis
Type: OpenClaw Skill Name: token-ledger Version: 0.1.0 The token-ledger skill implements a usage tracking system that monitors OpenClaw session logs and stores data in a local SQLite database. It is classified as suspicious because it includes instructions in SKILL.md for the agent to establish system persistence on macOS via a LaunchAgent (com.openclaw.token-ledger-watcher.plist) and a background daemon (ledger_watcher.py). While these high-risk capabilities—persistence and monitoring of sensitive session data—are aligned with the stated purpose of an audit-grade ledger, they represent a significant system modification that warrants caution. No evidence of malicious intent, such as data exfiltration or unauthorized remote access, was found in the code logic.
Capability Assessment
Purpose & Capability
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.
Instruction Scope
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.
Install Mechanism
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.
Credentials
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.
Persistence & Privilege
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install token-ledger
  3. After installation, invoke the skill by name or use /token-ledger
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
Initial public release: SQLite token+cost ledger with watcher + safe query/report scripts.
Metadata
Slug token-ledger
Version 0.1.0
License
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Token Ledger (SQLite)?

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... It is an AI Agent Skill for Claude Code / OpenClaw, with 342 downloads so far.

How do I install Token Ledger (SQLite)?

Run "/install token-ledger" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Token Ledger (SQLite) free?

Yes, Token Ledger (SQLite) is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Token Ledger (SQLite) support?

Token Ledger (SQLite) is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Token Ledger (SQLite)?

It is built and maintained by Jonathan Jing (@jonathanjing); the current version is v0.1.0.

💬 Comments