2
3 Comments

How I'm budgeting Claude Code costs using YNAB's principles

Like many other devs over the past couple months, I got hooked on Claude Code. I'm having a lot of fun using it to build neat little apps and tools, but noticed my usage costs starting to add up. I'd been blindly running prompt after prompt without considering how many tokens I was burning through. Pretty soon I was looking at bills over $100 from just a few sessions!

I started to feel irresponsible and wanted to be smarter about this. I take pride in efficiently managing my personal spending outside of coding, so why was I struggling to manage my Claude usage? Then I remembered that I, like many others, manage my personal finance accounts with budgeting apps, such as You Need A Budget (YNAB).

YNAB, but for Claude Code tokens

YNAB follows a core rule: "Give Every Dollar a Job" — instead of looking at past expenses, you assign money you currently have to categories, prioritizing what needs to be paid before the next paycheck.

I wanted to bring these ideas to Claude Code, so I built a CLI called Tokenyst. Tokenyst allows me to budget my Claude balance by assigning funds to specific tasks in whatever project I'm working on before I run any prompts.

How it Works

You create tasks with budgets

tkst -t "Issue-243" -b 2
# Create a budget of $2.00 for "Issue-243"  

then run Claude Code. After each prompt, Tokenyst automatically parses your transcript, calculates the cost, and deducts it from the active task.

# [Claude Code prompt]
# ⎿  Stop says: +$0.861 (turn) | Budget: $0.86 / $2.00 (43%)

# [Claude Code prompt]
# ⎿  Stop says: +$0.344 (turn) | Budget: $1.21 / $2.00 (60%)

At the end of the session (via /exit), you get a summary showing tokens used, cost, and how much budget remains. Budget tracking data is stored locally in ~/.tokenyst/ on your machine (no cloud required).

If you use Claude Code and find yourself wondering about costs, I'd love your feedback.

GitHub is https://github.com/jher7/tokenyst

posted to Icon for group Developers
Developers
on May 11, 2026
  1. 1

    Love the proactive budget framing. The thing I'd pair with it is a tiny live burn-rate indicator so you notice a session going sideways before /exit. That's the menu-bar problem I built TokenBar for: https://tokenbar.site/

  2. 1

    Love the YNAB vibe here. I’ve been missing a way to sanity-check my Claude Code spend before I get lost in a coding rabbit hole, so a little upfront budgeting sounds handy. One thing I’d find super useful is an easy flag to export usage logs, just so I can throw them into my own tracking setup. Keeping everything local is a nice touch, too.

  3. 1

    This is a sharper idea than just “Claude Code cost tracking.” The YNAB framing makes it feel like proactive token budgeting instead of another usage dashboard. That distinction matters because most dev cost tools show regret after the spend already happened, while Tokenyst gives the budget a job before the prompt runs.

    The local-first angle is also strong. For developers using Claude Code on real projects, keeping task budgets and transcript parsing local makes the product feel safer and more natural than a cloud dashboard.

    One thing I’d watch is the Tokenyst name. It explains tokens, but it may keep the product locked to one narrow AI-cost use case. If this grows into a broader AI engineering cost-control layer across agents, prompts, tasks, and projects, a stronger infra-style brand like Exirra.com would give it more room to expand.

Trending on Indie Hackers
AI runs 70% of my distribution. The exact stack. User Avatar 187 comments I'm a solo founder. It took me 9 months and at least 3 stack rewrites to ship my SaaS. User Avatar 153 comments I used $30,983 of AI tokens last month in Claude code on $200/mo plan User Avatar 74 comments 30 days ago I posted here with $0 revenue. Here's what actually happened next. User Avatar 45 comments my reddit post got 600K+ views. here's exactly what i did User Avatar 43 comments I turned someone’s tweet into an app idea and it has made ~$3000 so far in 4 months. User Avatar 35 comments