Skip to content

titeya/dms-claudecode

Repository files navigation

Claude Code Usage

A DMS (Dank Material Shell) plugin that monitors your Claude Code subscription usage directly from the taskbar.

Screenshot

Features

  • Taskbar pill with circular progress ring showing 5-hour rate limit utilization
  • Detailed popout with:
    • 5-hour and 7-day rate window utilization with countdown timers
    • Token consumption breakdown (today, calendar week, calendar month)
    • Estimated API cost per period (today, calendar week, calendar month) with automatic pricing from LiteLLM
    • Weekly activity bar chart (Monday–Sunday) with interactive hover tooltips (token count + cost)
    • Per-model token usage for the current calendar week with dynamic model family detection
    • All-time session and message statistics
  • Automatic subscription detection via the Anthropic OAuth API
  • Dynamic model pricing — new Anthropic model families are detected automatically, no code changes needed
  • Currency support — costs displayed in EUR for French locale, USD otherwise (exchange rate from ECB via Frankfurter)
  • Configurable refresh interval (2 to 15 minutes)
  • Localization support (English and French)

Requirements

Installation

From the DMS Plugin Registry

dms plugins install claudeCodeUsage

Or browse the plugin list in DMS Settings (Mod + , > Plugins).

Manual

Clone this repository into your DMS plugins directory:

git clone https://github.com/titeya/dms-claudecode \
  ~/.config/DankMaterialShell/plugins/claudeCodeUsage

Then restart DMS.

Configuration

Open DMS Settings (Mod + , > Plugins > Claude Code Usage) to adjust the refresh interval.

How It Works

The plugin runs a lightweight bash script at the configured interval that:

  1. Reads your OAuth token from ~/.claude/.credentials.json
  2. Queries the Anthropic usage API for current rate limit status
  3. Parses local JSONL session files for token consumption statistics
  4. Fetches model pricing from LiteLLM and USD/EUR exchange rate from ECB (cached daily in ~/.claude/pricing-cache.json)

API usage responses are cached for 2 minutes (~/.claude/usage-cache.json) to avoid rate limiting, with stale fallback on errors.

All data stays local. Network requests are limited to the official Anthropic API (usage), GitHub (LiteLLM pricing, once/day), and Frankfurter (exchange rate, once/day).

License

MIT

About

DMS plugin to monitor Claude Code subscription usage in the taskbar

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors