Where Am I Burning Tokens?

v1.1.0

Reads only ~/.openclaw/agents/main/sessions/sessions.json to show exactly where OpenClaw tokens and estimated cost are going by session type. Read-only diagn...

2· 135·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for whooshinglander/whereamiburningtokens.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Where Am I Burning Tokens?" (whooshinglander/whereamiburningtokens) from ClawHub.
Skill page: https://clawhub.ai/whooshinglander/whereamiburningtokens
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install whereamiburningtokens

ClawHub CLI

Package manager switcher

npx clawhub@latest install whereamiburningtokens
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description claim to read ~/.openclaw/agents/main/sessions/sessions.json and report token/cost breakdown — the SKILL.md, README, and package.json are consistent with that. No unrelated env vars, binaries, or install steps are requested.
Instruction Scope
SKILL.md limits actions to reading and parsing the single sessions.json path and producing a summary. However, there is an optional 'improvement log' feature that will create/append ~/.openclaw/workspace/memory/token-diet-log.md if the user explicitly asks — this is a write operation and contradicts the otherwise 'read-only' claim. The skill does not instruct the agent to read other local files unless the user explicitly requests the optional log.
Install Mechanism
Instruction-only skill with no install spec and no code files to execute; lowest-risk install surface. package.json and README are informational only.
Credentials
No environment variables, credentials, or external config paths are requested. The requested file path (sessions.json) is directly relevant to the stated purpose.
Persistence & Privilege
always is false and the skill is user-invocable. Autonomous invocation is allowed by default for skills on the platform (not a specific red flag here). The only persistence behavior is the optional log file write, performed only on explicit user request.
Assessment
This skill is internally consistent with its stated purpose: it reads ~/.openclaw/agents/main/sessions/sessions.json and summarizes tokens/costs. Two practical precautions before installing or invoking it: (1) be aware the skill advertises 'read-only' but offers an optional write (it will create/append ~/.openclaw/workspace/memory/token-diet-log.md) if you explicitly ask to track improvements — don't request that unless you want a file written. (2) As with any instruction-only skill, its runtime behavior depends on the agent implementation; ensure your agent runtime enforces file/network access policies you trust (the skill claims it won't exfiltrate data, but the platform executing the instructions controls actual IO/network). If you want extra assurance, inspect the actual sessions.json contents to confirm it does not contain secrets you wouldn't want read, and only enable the skill when comfortable with it having read access to that single path.

Like a lobster shell, security has layers — review code before you run it.

latestvk974vkgpkvq8pmfa0c3rme3ej984bk4k
135downloads
2stars
2versions
Updated 3w ago
v1.1.0
MIT-0

whereamiburningtokens

Reads only ~/.openclaw/agents/main/sessions/sessions.json and shows a token + cost breakdown by session category.

Safety boundary

  • Read-only skill
  • Reads only ~/.openclaw/agents/main/sessions/sessions.json
  • Does not read any other local files unless the user explicitly asks for the optional improvement log
  • Does not modify, delete, or execute anything
  • Does not send local data anywhere

Data source

~/.openclaw/agents/main/sessions/sessions.json

Each session entry has:

  • totalTokens, inputTokens, outputTokens, cacheRead, cacheWrite
  • estimatedCostUsd
  • model, modelProvider
  • startedAt, updatedAt (Unix ms timestamps)

Session keys: agent:main:<category>:<optional-id>

Categories (3rd segment of key):

  • main — interactive chat
  • cron — heartbeats + scheduled tasks
  • subagent — spawned sub-agents
  • paperclip — Paperclip logging (if installed)
  • anything else — plugins, integrations

Time windows

Detect from user's phrasing:

  • "this week" / default → last 7 days
  • "today" → last 24 hours
  • "this month" → last 30 days
  • "all time" / "all-time" → no filter

Filter by updatedAt >= cutoff_ms.

Steps

  1. Read and parse sessions.json. If missing, say so and stop.

  2. Filter by time window based on user's phrasing.

  3. Group by category (3rd : segment of key). Sum totalTokens and estimatedCostUsd.

  4. Sort by tokens descending. Calculate % of total for both tokens and cost.

  5. Flag anomalies:

    • ⚠️ SINKHOLE: category >40% tokens but <15% cost (cheap model, high volume — likely a logging/cron drain)
    • ⚠️ EXPENSIVE: non-main category >35% cost but <15% tokens (expensive model, few calls — check model config)
  6. Output the table and 1-2 insight lines.

Output format

🔥 WHERE AM I BURNING TOKENS? (last 7 days)
66 sessions | 2.8M tokens | $100.65 est.

Category        Sess    Tokens    Tok%     Cost   Cost%
──────────────────────────────────────────────────────────
paperclip         26      997k   36.1%  $  5.79    5.8%  ⚠️ SINKHOLE
subagent          22      795k   28.8%  $  9.49    9.4%
cron              16      692k   25.1%  $ 48.61   48.3%  ⚠️ EXPENSIVE
main               1      274k   10.0%  $ 36.76   36.5%

💡 paperclip is eating 36% of tokens on a cheap model.
   High volume, low cost = lots of context for little output. Consider disabling.
💡 cron costs 48% of spend. Verify heartbeat model is Haiku or a local model, not Sonnet.

Format token counts: 1.2M / 692k / 344. Keep table tight, no padding.

Improvement log (optional)

Only if the user explicitly asks to log an improvement or track savings:

  • Read/create ~/.openclaw/workspace/memory/token-diet-log.md
  • Append entry: date, what changed, token % before/after, cost before/after
  • Show running total saved

Format:

## Token Diet Log
| Date | Change | Tokens Before | Tokens After | Cost Saved/wk |
|---|---|---|---|---|
| 2026-04-05 | Disabled Paperclip | 68% | 36% | ~$5.79 |

Notes

  • estimatedCostUsd is OpenClaw's estimate, not exact billing
  • main being expensive is expected (interactive Sonnet sessions), don't flag it
  • Sessions.json is cumulative, grows over time, no automatic reset
  • Do not read individual session .jsonl files, sessions.json has everything needed
  • Do not expand beyond the declared files above unless the user explicitly asks for the optional log

Comments

Loading comments...