Get more from your Claude subscription.

Rate limits, context health, and token usage — always visible in your macOS menu bar.

Download Free — macOS 13+ Open source · MIT License · No account required

Every feature is free and open source. If AI Battery saves you time, consider sponsoring or buying the App Store version when it launches.

Your rate limits, context usage, and token spend — made visible.

Claude Code is a powerful tool, but it doesn't surface much about how you're using it. AI Battery adds the dashboard, context meter, and token breakdown that make every session more productive.

See rate limits in real time

Know where you stand before you start a task. Countdowns, percentages, and time-to-limit predictions help you pace your work and plan around resets.

Monitor context as you work

Watch context fullness grow across sessions so you can compact or start fresh at the right time — before quality slips or auto-compaction kicks in.

Understand your token usage

Millions of tokens flow through your sessions. With per-model breakdowns, per-project tracking, and cost estimates, you can see exactly where your budget goes.

Track rate limits, context health, and token usage in one click.

Rate limit countdowns, context window fullness, per-model token breakdowns, and per-project cost — in a native macOS menu bar popover.

Rate Limits

See your 5-hour burst and 7-day sustained usage at a glance. Utilization percentages, live reset countdowns, time-to-limit predictions, and copyable estimates. Green celebration when limits reset.

Context Health

Track your 5 most recent sessions with live context fullness — up to 1M tokens for Claude 4.x models. Collapsible sections, copyable session IDs, relative timestamps, and smart warnings when conversations get too long.

Token Usage

Per-model breakdown: input, output, cache read, and cache write — including subagent usage. Click any value to copy it. Persistent token ledger survives Claude Code rebuilds. Always-on API-equivalent cost shows the value your subscription delivers.

Insights

Unified activity charts with hover tooltips across 24 hours, 7 days, and 12 months. Time-windowed cost breakdowns, cumulative stats, trend arrows, throttle tracking, and your all-time busiest day.

Per-Project Usage

See which projects use the most tokens and cost. Sort by tokens, cost, or name. Search across projects, expand to see your top 10, and copy any row with one click.

Smart Alerts

Get notified on Anthropic outages and when your usage crosses a threshold you set. Star-shaped glow system shows severity at a glance — from subtle glow to starburst rays when throttled.

Multi-Account

Support for 3 Claude accounts with one-click switching. Perfect for separate personal and work orgs — each with its own limits and stats.

Your context window is a budget. Spend it wisely.

Claude Code sessions carry their prior messages, file reads, and tool output as context. As that context grows, each turn has more history to process. Anthropic documents auto-compaction once context exceeds 95% capacity, which replaces earlier detail with a summary instead of the full session history.

Why this matters

  • Larger context usually means more tokens per turn and more history for Claude to process.
  • After auto-compaction, earlier detail is represented by a summary rather than the full original context.
  • Starting fresh or compacting earlier keeps sessions more focused and easier to manage.
  • Under 60% — AI Battery treats this as comfortable headroom.
  • 60–80% — AI Battery uses this as an early warning to compact or start fresh.
  • Over 80% — AI Battery treats this as a strong warning, even though Anthropic documents auto-compaction later.
AI Battery context health view showing session context window fullness

See where your tokens go. Project by project.

AI Battery reads the working directory from each Claude Code session log and groups token usage by project. You get a ranked breakdown showing which codebases consume the most tokens and their API-equivalent cost — so you can make informed decisions about how you spend your time.

Why this matters

  • Know which projects are token-heavy before you hit a rate limit. Shift work to lighter repos when you're running low.
  • Compare API-equivalent costs across projects to see which ones deliver the most value for your subscription.
  • Sort by tokens, cost, or name. Expand to see all projects or filter by name when you have many repos.
AI Battery per-project token usage breakdown showing ranked projects by tokens and API-equivalent cost

Know your patterns. Not just your totals.

AI Battery tracks your Claude Code usage across three time windows — 24 hours, 7 days, and 12 months — so you can spot trends before they become problems. See when you're most active, how usage compares to yesterday, and whether you're on track to hit a limit.

What you'll see

  • Interactive area charts with hover tooltips showing exact values, timestamps, and throttle events for each data point.
  • Trend arrows with week-over-week and month-over-month comparisons, plus your busiest day and peak hour.
  • API-equivalent cost breakdown per model and time window — see what your subscription saves you compared to pay-per-token rates.
AI Battery activity chart showing 24-hour token usage trends, throttle tracking, and API-equivalent cost

Your token totals should never go backwards.

Claude Code tracks tokens in a local cache file (~/.claude/stats-cache.json) by scanning your session logs. But that cache gets rebuilt periodically — and when old logs are pruned or archived, the rebuild includes fewer files. Your totals drop, even though your actual usage hasn't changed. A user who accumulated 5 million tokens might suddenly see 3 million after a cache rebuild.

How AI Battery calculates tokens

  • AI Battery reads two local sources: Claude Code's stats cache for historical aggregates, and your raw JSONL session logs for live data. It never sends token data anywhere.
  • Per-model breakdown shows input, output, cache read, and cache write tokens — click any value to copy it. Models are sorted by usage, active first.
  • Optional API cost estimates show what your usage would cost at pay-per-token rates, so you can see whether your subscription tier is worth it.

The persistent ledger

AI Battery maintains a high-water-mark ledger at ~/Library/Application Support/AIBattery/token-ledger.json. On every refresh, it compares the current token counts against the stored maximums and keeps whichever is higher. Totals only ever stay the same or increase — they never drop due to a cache rebuild. It's automatic, per-account, and takes up a few KB.

Local Data Your data stays on your machine
Zero Tracking No analytics, no telemetry
716 Tests Across 46 test files
MIT License Free and open source
246 Downloads on GitHub
19 Stars on GitHub

Frequently asked questions

Is AI Battery free?

Yes. AI Battery is free, open source, and MIT-licensed. Every feature is included — no paywalls, no premium tier. An App Store version is coming for convenience (auto-updates, signed & notarized), and you can also support development via GitHub Sponsors.

Does it send my data anywhere?

No. AI Battery reads Claude Code's local log files for token counts and context health — never your message content. It makes minimal network requests to Anthropic's API (rate limits), status page (outage alerts), and GitHub (update checks). There's no analytics, no telemetry, and no third-party tracking.

What macOS versions are supported?

macOS 13 (Ventura) and later. AI Battery is a native Swift app built with SwiftUI, so it runs efficiently on both Apple Silicon and Intel Macs.

How does it track rate limits?

AI Battery makes a minimal API call to read your rate limit headers from Anthropic's unified endpoint. It shows your 5-hour burst and 7-day sustained usage with utilization percentages, reset countdowns, and time-to-limit predictions. Token counts and context health come from Claude Code's local JSONL session logs. Read the full guide →

What is context health?

Every Claude Code session has a large context window that fills up with messages, file reads, and tool results. AI Battery shows how full each session's context is, so you know when to compact or start fresh before the session gets heavy. See how it works →

Does it work with Claude Code on all plans?

Yes — Pro, Max 5×, and Max 20× plans are all supported. AI Battery detects your plan tier and adjusts rate limit calculations accordingly. Compare plans →

How do Claude Code rate limits work?

Claude Code enforces two rate limit windows: a 5-hour burst limit and a 7-day sustained limit. When you hit either limit, Claude pauses your session until the window resets. AI Battery tracks both in real time — showing utilization percentages, reset countdowns, and time-to-limit predictions so you can pace your work and avoid getting blocked mid-task. Read the full guide →

What happens when Claude Code's context window fills up?

Every Claude Code session has a large context window. As it fills with messages, file reads, tool calls, and responses, each turn gets heavier. Anthropic documents auto-compaction once context exceeds 95% capacity, which replaces earlier detail with a summary. AI Battery monitors context fullness so you can compact or start fresh earlier. Read the full guide →

Can I see how many tokens Claude Code uses per session?

Yes. AI Battery shows a per-model breakdown of input tokens, output tokens, cache read tokens, and cache write tokens — click any value to copy it. Token totals persist across Claude Code rebuilds via a local ledger. You can also toggle API cost estimates to see what your usage would cost at pay-per-token rates. See all features →

Can I see which projects use the most tokens?

Yes. AI Battery reads the working directory from each Claude Code session and groups token usage by project. You get a ranked breakdown showing which codebases consume the most tokens and their API-equivalent cost. Sort by tokens, cost, or name, and expand to see all projects. See project tracking →

Can I use AI Battery with multiple Claude accounts?

Yes. AI Battery supports up to 3 Claude accounts with one-click switching — perfect for separate personal and work orgs. Each account gets its own rate limits, token stats, and persistent ledger. See settings guide →

Does AI Battery work with Claude Desktop or the API?

AI Battery is specifically designed for Claude Code (the CLI tool). It reads Claude Code's local JSONL conversation logs to extract usage data. It does not currently support Claude Desktop, the web interface, or direct API usage — though API support may come in a future update.

How do I install AI Battery?

The easiest way is via Homebrew: run brew tap KyleNesium/tap && brew install --cask aibattery. You can also use the one-line curl installer or download the DMG directly from GitHub Releases. AI Battery requires macOS 13 (Ventura) or later and runs natively on both Apple Silicon and Intel Macs.

Download free from GitHub

Open source, MIT-licensed, every feature included. No account required.

brew tap KyleNesium/tap && brew install --cask aibattery

Requires macOS 13+ and Claude Code. If it saves you time, consider sponsoring the project or buying the App Store version when it launches.