Skip to content

psinghmanager/g4-Claw-counter

Repository files navigation

Claw Counter — Claude AI Token & Cost Tracker

Track every token Claude uses. See exactly what it costs. Zero AI tokens consumed.

A free, lightweight Windows desktop widget that monitors your Claude Code and Claude Desktop token usage in real-time. Shows per-model costs based on Anthropic's API pricing — even if you're on a subscription plan, see how generous Claude is being.

Built for developers, power users, and teams who want visibility into their Claude AI usage.

screenshot


Why Claw Counter?

  • You use Claude Code or Claude Desktop daily but have no idea how many tokens each conversation burns
  • You want to know the dollar cost of your AI usage — today, this week, this month
  • You want a passive, always-visible tracker that doesn't interrupt your workflow
  • You're curious how much your Claude subscription would cost at API rates

Features

  • Always-on-top overlay widget — sits at bottom-right, above taskbar
  • Real-time token tracking — input, output, cache tokens by session and model
  • Cost calculation — today's cost displayed on the widget, with detailed breakdowns
  • Cost dashboard — Today / Yesterday / 7 Days / 30 Days cost cards
  • Multi-model support — Claude Opus, Sonnet, Haiku tracked separately
  • Session tracking — see usage per Claude Code session
  • Daily breakdown table — cost per day per model for the last 30 days
  • Detailed dashboard — 4 tabs: By Session, By Model, Recent Requests, Costs
  • Auto-detects Claude — finds ~/.claude directory automatically
  • Draggable widget — reposition anywhere, right-click context menu
  • Reset all data — clear history anytime
  • Single .exe — no installation needed, just download and run
  • Zero dependencies — pure Python stdlib, no pip packages needed at runtime
  • Privacy-first — all data stays local, nothing sent anywhere
  • Zero token cost — reads local session files, never calls the Claude API

How It Works

Claude Code / Desktop
        |
        v
  ~/.claude/projects/*/*.jsonl   <-- session files with usage data
        |
        v
  Claw Counter (file watcher)    <-- monitors files every 2 seconds
        |
        v
  SQLite DB + Overlay Widget     <-- aggregates & displays
  1. Claude Code and Claude Desktop store conversation data as JSONL files in ~/.claude/projects/
  2. Each assistant response includes a usage field with token counts
  3. Claw Counter watches these files, extracts usage data, and calculates costs
  4. Displays everything in a compact overlay widget + detailed dashboard

No proxy. No API calls. No token consumption. Just file monitoring.


Pricing Rates Used

Based on Anthropic's official API pricing:

Model Input Output Cache Write Cache Read
Claude Opus 4 $15.00/MTok $75.00/MTok $18.75/MTok $1.50/MTok
Claude Sonnet 4 $3.00/MTok $15.00/MTok $3.75/MTok $0.30/MTok
Claude Haiku 3.5 $0.80/MTok $4.00/MTok $1.00/MTok $0.08/MTok

Note: Subscription users (Claude Pro/Team/Enterprise) don't pay per-token. These rates show what your usage would cost at API prices — useful for understanding the value you're getting.


Installation

Option A: Download the executable (recommended)

  1. Go to Releases
  2. Download ClaudeTokenCounter.exe (12 MB)
  3. Double-click to run — the widget appears at the bottom-right of your screen
  4. No installation required. No admin rights needed.

Option B: Run from source

git clone https://github.com/psinghmanager/g4-Claw-counter.git
cd g4-Claw-counter
python main.py

Or use pythonw main.py to run without a console window.

Option C: Build the executable yourself

git clone https://github.com/psinghmanager/g4-Claw-counter.git
cd g4-Claw-counter
pip install pyinstaller
build.bat

The exe will be in dist/ClaudeTokenCounter.exe.


Usage

Action What Happens
Launch Widget appears at bottom-right showing tokens + today's cost
Click widget Opens detailed dashboard with 4 tabs
Right-click widget Context menu: Detailed View, Reset All Data, Quit
Drag widget Reposition anywhere on screen
Costs tab See Today / Yesterday / 7 Days / 30 Days cost breakdown

Data Storage

Running as Data location
Exe %LOCALAPPDATA%\ClaudeTokenCounter\
Source Same directory as the script

All data stays 100% local on your machine. Nothing is transmitted anywhere.


Requirements

  • OS: Windows 10 / 11
  • Python: 3.10+ (only if running from source)
  • Claude: Claude Code CLI or Claude Desktop must be installed

Tech Stack

  • Python 3 (stdlib only — no external packages at runtime)
  • tkinter for the GUI
  • SQLite for data storage
  • PyInstaller for exe packaging

Contributing

Pull requests welcome! Some ideas:

  • macOS / Linux support
  • System tray icon
  • Export usage data as CSV
  • Custom date range picker in Costs tab
  • Dark/light theme toggle
  • Token budget alerts

Keywords

Claude token counter, Claude Code usage tracker, Claude Desktop token monitor, Anthropic API cost calculator, Claude AI cost tracker, Claude token usage widget, Claude Code token counter, AI token monitor Windows, Claude API pricing tracker, Claude usage dashboard


License

MIT — free for personal and commercial use.


Built with Claude Opus 4.6 | Report issues

About

G4 Claw Counter — Windows desktop widget tracking AI token usage & costs across Claude Code, Claude Desktop, OpenAI Codex, and more. Zero AI tokens consumed. Shows today's cost, multi-provider support, user-editable pricing.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors