{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiby3pqyqczxshnpfl3m7yhrsp7ta2hvqt4wvxu25yv45kcfifa54m",
    "uri": "at://did:plc:2mg4c2y4wiwzddlc5tjat7oc/app.bsky.feed.post/3mg4kri4lo6s2"
  },
  "path": "/openclaw-token-dashboard?utm_source=rss",
  "publishedAt": "2026-03-02T03:15:27.000Z",
  "site": "https://nerdy.dev",
  "tags": [
    "blog",
    "ai",
    "OpenClaw",
    "Discord",
    "cron jobs",
    "JSONL",
    "token counts",
    "Node.js",
    "Astro",
    "Shopify",
    "context",
    "context traps",
    "sub-agents"
  ],
  "textContent": "First off, I call my OpenClaw assistant \"Punk Ass,\" short for \"Punk Assistant.\" It's been great so far having a punk ass for various projects. I hadn't been using my gaming machine much; now it's a work horse.\n\nBut, when you're running an AI assistant that handles Discord messages, cron jobs, and various projects; costs add up. But where exactly?\n\nI directed a simple dashboard to find out.\n\n##  How It Works #\n\nOpenClaw stores session logs as JSONL files. Each assistant response includes token counts and costs. I had a Node.js script written that extracts this data, cross-references it with Discord thread metadata embedded in each conversation, and aggregates everything by thread, day, model, and session type.\n\nThe output is a single static JSON file that powers an Astro dashboard. No backend needed, just parse, deploy, and refresh when you want updated data.\n\n##  What I Track #\n\nI track a few things that help me make keep costs low:\n\n  * **Cost per Discord thread**\nWhich conversations are burning tokens?\n  * **Daily spend trends**\nAre costs stable or spiking?\n  * **Token breakdown**\nInput vs output vs cache hits\n  * **Session types**\nDiscord vs cron jobs vs direct chat\n\n\n\n##  What I Learned #\n\nThe data was immediately actionable. Two threads accounted for 60% of the total spend: a Shopify web store project ($73) and the `#general` channel ($70).\n\nThe store project made sense, I've been async art directing it alot. It's looking **sweet**. But `#general`? That's just a catch-all channel accumulating context from random conversations. Expensive by accident.\n\n##  The Fix #\n\nNow I know: long-running threads in Discord are context traps. Each message carries the full conversation history. The solutions:\n\n  * Start fresh threads for new topics instead of continuing in the same one\n  * Have OpenClaw delegate to sub-agents for self-contained tasks as they don't carry the parent context\n  * Treat `#general` as a lobby, not a workspace\n\n\n\nThe dashboard cost less than a dollar to make. But now, knowing where tokens go changes how I work with OpenClaw, I'll earn all that buck back quick; I can stop guessing and start optimizing.",
  "title": "My OpenClaw Token Dashboard"
}