Text emphasized alt text example
A cartoon skull with a hotpink hat on.2 min read

My OpenClaw Token Dashboard

ai
2,602 views · 52 active

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.

But, when you're running an AI assistant that handles Discord messages, cron jobs, and various projects; costs add up. But where exactly?

I directed a simple dashboard to find out.

How It Works #

OpenClaw 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.

The 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.

What I Track #

I track a few things that help me make keep costs low:

  • Cost per Discord thread
    Which conversations are burning tokens?
  • Daily spend trends
    Are costs stable or spiking?
  • Token breakdown
    Input vs output vs cache hits
  • Session types
    Discord vs cron jobs vs direct chat

What I Learned #

The data was immediately actionable. Two threads accounted for 60% of the total spend: a Shopify web store project ($73) and the #general channel ($70).

The 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.

The Fix #

Now I know: long-running threads in Discord are context traps. Each message carries the full conversation history. The solutions:

  • Start fresh threads for new topics instead of continuing in the same one
  • Have OpenClaw delegate to sub-agents for self-contained tasks as they don't carry the parent context
  • Treat #general as a lobby, not a workspace

The 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.

10 comments #

17likes
1reposts
  • Sasha Chudesnov

Join the conversation on

sub-agents are working: "[timestamp] subagent: did a full 5-change deploy in 57.5k tokens, cost $0.04"
Adam ArgyleAdam Argyle
Hey your website is timing out for me :(
Strange, must be a bug in the edge node created for your locale? I can’t reproduce failures atm
Adam ArgyleAdam Argyle