[Plugin] Token Usage — Live Claude Code token tracking in your Obsidian sidebar

Disclaimer

Is this plugin open source? Yes
Is this plugin completely free? Yes
Is this plugin vibe-coded beyond the author’s ability to comprehend how it works? No
Community Directory: Token Usage


Hey everyone,

I’ve been using Claude Code daily for months and wanted to see my token consumption without leaving Obsidian or opening a separate dashboard. There was no plugin for that, so I built one.

The problem I solved

Claude Pro subscribers don’t have an organization API key, so you can’t pull usage data directly from Anthropic. Third-party dashboards exist, but they’re just another tab on another screen — exactly what I didn’t want.

How it works

Claude Code stores all session data as local JSONL files on your machine. Every message contains the model, timestamp, session ID, and token counts. Token Usage reads those files directly — no API key, no external requests, no data leaving your device.

What it shows

Directly in your sidebar, in real time:

  • Last Action — model, input, output and cache tokens for your most recent command
  • This Session — running total for the current Claude Code session
  • Today — all sessions combined
  • 7 Days — color-coded bar chart (green = low, red = high)
  • 30 Days — monthly overview

Install

Settings → Community Plugins → Browse → search for “Token Usage”

Or: GitHub - beolatn/TokenUsage: Live token usage tracking for Claude Code inside Obsidian · GitHub

One honest note

The concept, design and use case came from me. The actual code was written with Claude Code assistance — felt right to be transparent about that in a plugin that tracks Claude Code usage.

This is my first Obsidian plugin. Happy to hear feedback, bug reports or feature ideas.

Here’s what it actually looks like in use — both the sidebar panel and the official plugin page.

The sidebar:

The 7-day bar chart shows intensity over time (green = low, red = high). The numbers you see here are real — this is my actual usage from an active week of working with Claude Code. Cache tokens dominate at scale, which I wouldn’t have known without this view.

The plugin directory:

Health: Excellent, Review: Satisfactory — live in the community directory since July 31st.

Happy to answer questions. And if you find bugs or want to request features, this thread is the right place.

Update — a lot has changed since v1.0.2

The initial release was a minimal sidebar: last action, session, today, 7-day chart. That’s it. Here’s what’s been added since.


5-hour session window
A rolling window matching Claude Code’s own rate-limit period. Shows Input, Output, C.Write, and C.Read as separate rows. The footer counts down to the next reset.

C.Write and C.Read — split display
Cache tokens are now two distinct rows throughout the sidebar, because they have very different cost implications. C.Write (purple) costs ~1.25× regular input. C.Read (amber) costs ~0.10× — ten times cheaper than reprocessing. The ratio between them is the Reuse Factor: how efficiently you’re reusing the same context across requests.

Model distribution
A stacked bar under the 7-day chart shows which model family you actually used — Haiku, Sonnet, Opus, Fable — colored consistently across the whole panel.

Dashboard
The chart icon generates a self-contained HTML file and opens it in your browser. 30-day summary cards, daily stacked bar chart by model, model distribution donut, request size histogram, top sessions table, and a cache efficiency section with C.Write vs C.Read over time.

Report
The document icon writes a Markdown snapshot directly into your vault — last action, session, today, 7-day and 30-day summaries, cache efficiency ratio. Configurable path in Settings.

Logo and visual polish
The plain text header is replaced by a proper logo — gradient text with a small bar chart icon. Cleaner and immediately recognizable.

Built-in Help panel
The “?” button toggles a full glossary without leaving Obsidian — tokens, C.Write, C.Read, Reuse Factor, 5h countdown, model colors, cost reference. A link at the bottom opens the full documentation page.

Help website
The glossary links to a dedicated documentation page — available in English and German, with automatic language detection based on your browser settings.


Current version is v1.4.1, available through the Community Plugin Directory — updates run automatically.


One more thing: this is still my first Obsidian plugin, and I genuinely wasn’t sure anyone would use it. The feedback and questions from this community since the initial post have shaped almost every feature listed above. So — thank you. If something is still missing or broken, the GitHub issues page is open and I read everything.