# StackBudget Calculator
**What will this repo cost to run, and how cheap could it get?**
StackBudget is a Claude Code skill. Point it at any codebase (the folder you're in, a local path, or
any GitHub repo, public or private) and it returns an interactive calculator of the monthly
**running** cost: hosting, database, email, analytics, LLM tokens, queues, storage, servers and
tracing. Every service has a **Migrate to** picker, so you can see what the bill becomes on
Cloudflare instead of Vercel, self-hosted Postgres instead of Neon, a cheaper model, and so on.
It reads the code, never changes it: no commits, no pushes, no PRs, no `.env` secrets.
```
/stack-budget reloop-labs/reloop
```
> Example: [`examples/reloop-budget.html`](examples/reloop-budget.html), the report for
> [reloop-labs/reloop](https://github.com/reloop-labs/reloop) (open-source Resend alternative,
> 227 packages, 10 paid services). At 5,000 users and 1M emails a month the managed stack is
> about **$359/mo**; "Pick cheapest stack" brings it to about **$96/mo**.
> [Preview it in the browser](https://htmlpreview.github.io/?https://github.com/shreyvijayvargiya/stackbudget-calculator/blob/main/examples/reloop-budget.html)
> or download the file and open it.
## Install
```bash
git clone --depth 1 https://github.com/shreyvijayvargiya/stackbudget-calculator /tmp/stackbudget \
&& mkdir -p ~/.claude/skills \
&& cp -r /tmp/stackbudget/skills/stack-budget ~/.claude/skills/ \
&& rm -rf /tmp/stackbudget
```
Requirements: `python3`, `git`, and `node` (for the text summary). For private repos, install the
GitHub CLI and run `gh auth login` once.
Optional terminal command:
```bash
chmod +x ~/.claude/skills/stack-budget/bin/stack-budget
ln -s ~/.claude/skills/stack-budget/bin/stack-budget /usr/local/bin/stack-budget
stack-budget vercel/commerce
```
## Use
In Claude Code:
| Command | Scans |
|---|---|
| `/stack-budget` | the current folder |
| `/stack-budget ../my-app` | a local path |
| `/stack-budget owner/repo` | a GitHub repo (shallow clone to a temp folder, deleted afterwards) |
| `/stack-budget https://github.com/owner/repo` | same, from a URL |
Or just ask: *"what would it cost to run this repo at 50k users?"*
The report is saved to `~/stack-budgets/<owner-repo>-budget.html` and opened in your browser.
Claude also prints a short summary: the current bill and the cheapest stack at three traffic
levels, and the moves that save the most.
## What you get
- **A bill tied to your code.** Each line names the packages that cause it
(`next`, `posthog-js`, `bullmq`, `@aws-sdk/client-s3`…), split into frontend and backend.
- **Usage inputs that matter for this repo only**: visitors, users, daily active %, emails sent
and received, AI generations, storage. Launch, Growth and Scale presets to start from.
- **A migration planner.** Pick a target per service and compare *Current* vs *After migration*,
with savings per month, per year and per active user. **Pick cheapest stack** chooses the lowest
option per row and skips free tiers your usage would break.
- **Honest trade-offs.** Self-hosted choices add server capacity to the backend line, so savings
are net. Warnings flag free-tier caps, dropped analytics events, and mail deliverability you'd
own yourself.
- **USD and INR** (editable rate), **Light / Dark / Auto** theme, works on a phone.
- **One HTML file.** React loads from a CDN; everything else is inside. Share it, host it,
attach it to an issue.
## What it knows how to price
| Service | Current options it detects | Migration targets |
|---|---|---|
| Frontend hosting | Vercel Pro | Cloudflare Workers Paid, Cloudflare Workers Free |
| Product analytics | PostHog Cloud | PostHog with a free-tier billing cap, Umami self-hosted |
| LLM tokens | any model (your $/1M tokens) | a budget model, bring-your-own-key |
| Email sending | Amazon SES, Resend | Resend, SES, self-hosted MTA (Postal, Haraka) |
| Postgres | Neon, Supabase | Supabase Free/Pro, self-hosted Postgres |
| Redis / queues | Upstash | Upstash Free, Upstash Fixed, self-hosted Redis/Valkey |
| Object storage | AWS S3, Cloudflare R2 | R2, S3 |
| Tracing / logs | OpenTelemetry | Grafana Cloud Free/Pro, self-hosted (SigNoz, Jaeger) |
| Backend servers | Express, Fastify, Hono, Elysia, NestJS, Django, FastAPI, Flask, Rails, Go, Rust… | your VPS rate |
Anything else it finds (Stripe, Clerk, Sentry, Algolia, Twilio, Liveblocks, MongoDB…) becomes a
row with a monthly figure you can type in. Manifests it reads: `package.json` (including Bun and
pnpm workspace catalogs), `requirements*.txt`, `pyproject.toml`, `Pipfile`, `go.mod`,
`Cargo.toml`, `Gemfile`, `composer.json`, plus deploy files (`vercel.json`, `wrangler.toml`,
`netlify.toml`, Dockerfiles, compose files) and the key names in example env files.
Prices were checked on **16 October 2026**; sources are listed in
[`references/pricing.md`](skills/stack-budget/references/pricing.md). Your server rate, LLM rates
and exchange rate are inputs, not vendor prices.
## How it works
1. **Scan** (`scripts/scan_repo.py`): parses every manifest and deploy file, then maps packages to
paid services with [`scripts/rules.json`](skills/stack-budget/scripts/rules.json).
2. **Review**: Claude checks the scan against how the repo is actually deployed (README, production
compose files, CI deploy jobs, the env vars the code reads), removes dev-only false positives and
adds services the rules missed.
3. **Build** (`scripts/build_report.py`): merges the result into the React template with the shared
cost engine (`assets/engine.js`) and prints a text summary.
## Extend it
- **New detection:** add a rule to `scripts/rules.json` (package names, with `*` for prefixes).
- **New vendor or migration target:** add a provider to `P` in `assets/engine.js` and its id to the
category's options list.
- **Refresh prices:** update the numbers and `RATES_CHECKED` in `assets/engine.js`, or ask Claude
to "refresh the stack-budget prices".
Pull requests with new rules and providers are welcome.
## Privacy
The skill only reads. Remote repos are shallow-cloned to a temp folder and deleted after the
report is built. It never opens real `.env` files, only the key names in `.env.example`-style
files. Reports are written outside the repo; if you choose a path inside it, the file is added to
`.git/info/exclude` so it can't be committed by accident.
---
Built by [Shrey](https://x.com/treyvijay) at [Karyam](https://karyam.xyz).