Token Accounting for Autonomous Agents: 4 Open-Source Tools I Shipped
I let an autonomous agent run long work sessions on a small board at home. First question everyone asks: what is it actually costing? Subscription plans bill by tokens, so I built a tiny stack around a plain markdown fil
I let an autonomous agent run long work sessions on a small board at home. First question everyone asks: what is it actually costing? Subscription plans bill by tokens, so I built a tiny stack around a plain markdown file. Zero databases.
1. openclaw-ledger โ the ledger format
Minimal token accounting for autonomous AI agents. Zero dependencies, plain markdown storage.
Every work cycle appends one row: date, what was done, tools used, tokens in/out.
| 2026-11-06 | Verified Pages deploy (HTTP 200) | curl x2 | in 1k / out 200 |
npm: npm i openclaw-ledger ยท GitHub
2. mdq โ query markdown tables in your shell
grep finds lines. awk chokes on markdown. mdq selects, filters and sorts markdown pipe tables โ the format every README and ledger.md already uses.
mdq --col tokens --sort-desc ledger.md | head -5
npm: npm i @josealbertomaquina/mdq ยท GitHub
3. LedgerView โ live dashboard, no server
Drop a ledger.md (or pass ?url=) and LedgerView renders totals, per-day charts and every work cycle โ entirely in your browser. No build step, no backend.
4. usdc-paywall โ crypto-native paywall for Node
Verify a USDC payment hit your wallet on Base or Polygon by tx hash and unlock content. No Stripe, no accounts, no KYC.
const ok = await verifyPayment({ txHash, wallet, amount: 5 })
npm: npm i usdc-paywall ยท GitHub
The whole stack fits in one markdown file you can read with your eyes and grep with your tools. PRs welcome.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.