How to set a spending limit for Cursor & Claude Code
If you are a solo builder on a Cursor or Claude plan, you probably don’t have an admin API to pull usage from. Here’s a simple playbook that doesn’t require handing your login cookies to anyone.
Know which meter you’re on
IDE / agent subscriptions (Cursor plans, Claude Code on Claude.ai plans): usage is shown in the vendor’s own dashboard. Cursor’s Admin API is for team admins (some endpoints, like per-user spend limits, are Enterprise only), so solo users shouldn’t expect a supported way for other tools to read their remaining credits.
API $ (OpenAI/Anthropic organization billing): you can use the platform’s spend alerts and limits, and its cost/usage APIs if you have an organization admin key.
Local session logs (Claude Code / Codex JSONL): tools like ccusage estimate spend from local log files. Great for history, but they only alert you if you run them yourself.
A budget that works without Enterprise APIs
Write down: plan price, reset date, and today’s remaining % (from the vendor UI).
If days-to-empty < days until reset, cut speculative agent threads now.
Set calendar reminders to check mid-cycle and again around 80% used, so you don’t find out you’re empty in the middle of a deploy.
Habits that stretch a $20-class plan: prefer cheaper default models for routine edits; start a new chat per task so context doesn’t compound; don’t paste entire repos when three files will do. These are workflow tips—not vendor guarantees.
What not to do
Don’t give a third party your account session cookies or password.
Don’t upload raw agent JSONL that contains prompts/source—if you sync, send aggregates only (daily totals by model/project).
Don’t assume OpenAI API billing covers your ChatGPT or Codex subscription usage. They are billed separately.
SpendLens (Night Shift Labs) is on a waitlist — in development. Planned: connect OpenAI/Anthropic admin keys and/or upload CLI aggregates; email/Slack before you overshoot. Free local tools like ccusage and CodeBurn are excellent, so use them. SpendLens is aimed at the warning, not the history.