I use Claude Code every day. It's become part of how I work. I open a terminal, type claude, describe what I need, and it writes code, runs commands, fixes bugs. It's genuinely useful.

But there's a problem I kept running into: I had no idea what any of it cost. I'd run prompts throughout the day, and at the end of the month I'd look at my bill and have no clue which session ate through my budget. Or I'd hit my rate limit wall right in the middle of something important and have to just stop.

As a student, that's not great. Every dollar counts. So I built meter.

What it does

Meter is a CLI wrapper that sits transparently between you and Claude Code. You keep typing claude exactly like before. Meter adds cost awareness on top:

It estimates the cost of each prompt before it runs, shows a live status bar while the agent works, and warns you when you're approaching your budget or rate limit. Everything shows up right inside Claude Code's own statusline, so there's no extra window or UI to deal with.

◆ meter  claude-opus  ~$0.38  heavy  │  68% 5hr window  reset in 2h 14m

How the estimation works

I didn't want meter to be expensive to run (that would kind of defeat the purpose). So the estimation pipeline has three layers. The first two are free: one does keyword scoring and repo size analysis, the other checks your history for similar past tasks using trigram matching. Only if those two can't agree does it fire off a quick call to Haiku for a one-word complexity classification. That call costs about $0.0001.

Over time, as your history builds up, the second layer gets better and the third one fires less and less. It learns from your real patterns.

How I built it

The whole thing is written in TypeScript and published on npm as meter-ai. There are two main integration points with Claude Code:

For interactive sessions, meter hooks into Claude Code's native hook system. There's a UserPromptSubmit hook that runs the estimation pipeline every time you submit a prompt, and a statusline integration that displays the result in Claude Code's bottom bar.

For one-shot commands like claude "fix the bug", meter wraps the process in a PTY and shows a live status bar with real-time cost tracking.

All data stays local. History goes into a SQLite database at ~/.meter/history.db, config lives in a JSON file, and there's no telemetry or cloud dependency.

For API users vs. plan subscribers

If you're paying per token, meter tracks actual dollar cost and warns you at budget thresholds. When you hit 80% of your per-task budget, it offers to switch you to a cheaper model automatically.

If you're on a plan like Claude Max or Pro, meter tracks your 5-hour usage window percentage instead. It warns you before you hit the rate limit wall so you don't get cut off mid-task.

Getting started

npm install -g meter-ai
meter init

That's it. meter init detects your shell, finds the real claude binary, sets up a transparent shim, installs estimation hooks into Claude Code, and writes your config. From that point on, every claude invocation runs through meter automatically.

Why I'm sharing this

I built meter because I needed it. I think a lot of people in the same situation, students and solo developers who use these tools daily but need to be mindful of what they spend, could use it too. It's open source, it's free, and it takes about 30 seconds to set up.

If you want to check it out, the code is on GitHub.