Get it for macOS

Understand what your threads cost in tokens and time, so you can cut what isn't worth it. Each thread's header shows a sparkline of its token use that opens a summary of which of your messages used the most tokens and time. Once a thread's context passes a size you set, a meter above the composer offers to compact it, and the sidebar counts those threads. A Tokenomics page charts tokens by hour or day, shows where turn time went, and ranks threads by use. Requires bb 0.43 or later, and counts Claude Code subagents only for threads that ran on the same machine as bb.


Overview

View source

What you get

A sparkline and token total in each thread's header. Click it for the thread's summary: tokens over time, minutes per turn, and the three turns that used the most. Hover a spike to see which of your messages caused it.

A context meter above the composer once a thread's context passes 300K tokens. It turns red past 550K. Every model call reads the whole context again, so at 500K a turn of 40 calls costs 20M tokens. Compact asks bb to compact the thread. The sidebar counts these threads in amber and red, so you can find them without opening each one.

A Tokenomics page in the sidebar. It charts tokens per hour over the past day or three days, or per day over the past week, split into new input, cache reads, and output. Where turn time goes splits turns into the model's time, tools, and waiting on you, and names the slowest shell commands. The thread list ranks threads by tokens, with each one's context size, a sparkline, and a dot per turn showing its length.

For scripts and agents

bb tokenomics threads lists each thread's tokens, turns, context, turn times, and slowest shell commands, sorted by tokens, time, or context. bb tokenomics commands lists the shell commands that took the most time across all threads. Add --json to either, so an agent can find expensive threads without reading their transcripts.

How it counts

bb deletes a thread's older usage events once it has a few hundred newer ones, so Tokenomics copies each event into its own database as it arrives. Turns bb deleted before you installed it can't be recovered, and the page says when a period starts before recording began.

Claude Code subagents report no usage to bb. Tokenomics reads their transcripts on the machine bb runs on and adds their tokens to the thread that ran them.

Settings

Change the meter's thresholds with bb plugin config tokenomics set contextWarningAt 300K and bb plugin config tokenomics set contextErrorAt 550K.

Where it's going

The goal is to weigh each thread's cost against the business value of the work it did. Tokenomics covers the cost today. It doesn't record what a thread produced, so the weighing is up to you.

Requirements

  • Works with any provider that reports token usage to bb.
  • Counts tokens, not dollars. No cost estimates or quota view.
  • Counts subagent tokens only for Claude Code threads that ran on the same machine as bb.
  • No account or outside service.

More from Daniel Bachhuber

Automation PaletteRun any bb automation from the quick palette, without opening the Automations page. Each row names the automation and its project, so typing either name finds it, and selecting it starts the run as its schedule would. Every project's automations are listed in every window, and a paused automation keeps its row. Requires bb 0.42 or later and the bb CLI on the machine running the bb server.2Diff ViewedUse a Viewed checkbox on each file to keep track of what you've read in a long diff, synced with GitHub on the thread's pull request. Checking a file collapses and dims it, and the toolbar counts how far you have got, such as 3/6 viewed. A mark clears itself when the file's diff changes, so a rebase or a new hunk puts the file back in front of you. An Only unviewed filter hides the files you have read. Requires bb 0.41 or later, and GitHub sync needs the gh CLI signed in.19Impromptu UIGenerate interfaces for what you need to process or act on, instead of walls of text in chat. An agent's results, such as issues to triage or a Dependabot pull request to merge, appear as rows above the composer, one per item. Each row opens a side panel with the details, a draft you can edit, and buttons that post it, start a thread, run a command once you confirm it, or open a link. For design choices, a film strip shows screenshots of the original and each alternative, and Send feedback returns your pick and notes to the thread. The agent reads back what you did and carries on from there. Requires bb 0.43 or later, and needs no account or external service.NewMarkdown EditorEdit a markdown file in the tab you were already reading it in, and save it with Cmd+S. Preview renders the file the way bb renders a chat message, including the images it points at, and Raw gives you the source in an editable pane, with unsaved text carrying between the two. Selecting text in Preview offers an Add to chat button that quotes it into the composer under the file's path. A pencil on markdown files in the changes panel opens the one you are reading a diff of. Every save checks the file's hash first, so an edit an agent made while you were typing gives you a choice between reloading and overwriting instead of a silent clobber. Works on files in a project workspace, on a host, or in a thread's storage. Requires bb 0.43 or later, and needs no account or external service.10

More in Token Usage & Limits 26

Understand or control token, context-window, and provider-quota use.

View all