Guides · Updated October 19, 2026
How to limit Cursor agent usage costs
Cursor’s agent can run through your included usage surprisingly fast, especially on expensive third-party models or in long chats. Cursor gives you one real money control, a monthly limit on paid usage, plus a hook system you can use for finer limits. Here is what each one does, and what it doesn’t.
How Cursor charges for agent usage
Cursor currently has two families of plans, and the controls differ, so check which one you are on (your billing dashboard says):
- The X Subscription (the current plans, shared with Grok): Cursor and Grok draw from one weekly included pool. Third-party models in Cursor, such as Claude or GPT, are not included: they are billed at API list prices from the first request, paid from your prepaid credit. Anything beyond the pool is additional usage.
- Legacy Cursor plans (Pro, Pro+, Ultra, older Teams seats): each plan includes a monthly amount of usage. Past that, on-demand usage is billed if it is enabled.
Either way, the agent itself has no idea what it is spending. A long agent chat re-sends its growing context on every step, and a loop (the same failing command, the same file read) repeats that cost each time.
Set the monthly spend limit
This is the control that actually stops Cursor from charging you more. From Cursor’s spend limits help page:
| Plan | Where | What it caps |
|---|---|---|
| The X Subscription, individual | Billing dashboard → Additional usage credits → Monthly additional usage limit → Edit | Paid additional usage you consume each month. Buying credit (manually or with Auto Top-up) doesn’t count toward it and doesn’t raise it. |
| The X Subscription, Teams | Same setting, admins only | One limit for the whole team, fixed or per seat |
| Legacy individual plans | Dashboard → Spending (on-demand usage must be enabled to see it) | Monthly on-demand spend |
| Legacy Teams | Spending tab; turn on Only Admins Can Edit Usage Settings so members can’t raise it | Team-wide on-demand spend. When it is reached, everyone using on-demand usage loses AI features. |
| Enterprise | Spending, Members and Groups tabs, or the Admin API | Team, group and per-member limits (the highest applicable one applies) |
When a limit is reached, paid usage stops for that user until the next period or until the limit is raised; included usage keeps working. Two caveats from Cursor’s docs: enforcement isn’t instant, so usage can briefly go over, and on The X Subscription the limit pauses additional usage even if prepaid credit remains. If you never want to pay beyond your plan, the simplest option on a legacy plan is to leave on-demand usage off.
Spend less per session
- Watch the model. On The X Subscription, picking Claude or GPT in Cursor bills API list price from the first request. Use them deliberately, not as the default for routine edits.
- Start new chats. A chat that has been going for hours re-sends a large context on every agent step. A fresh chat with a two-line summary is usually cheaper than continuing.
- Stop loops early. If the agent runs the same command or edit three times, click Stop and give it the missing information instead of letting it retry.
- Check usage regularly. Your Cursor dashboard shows usage and spend for the current period; looking once a day catches a bad week while it is still cheap.
What the spend limit can’t do
The spend limit is monthly and account-wide. It won’t stop one runaway chat at $5, won’t notice that the agent has run npm test forty times with the same result, and does nothing for the included usage you burn before paid usage begins. For that you need something that runs on every agent step.
Cursor has that: hooks. A preToolUse hook in ~/.cursor/hooks.json runs before every agent tool call and can return {"permission": "deny"} to block it (exit code 2 also blocks). Cursor also caps how many automatic follow-ups a stop hook can trigger (loop_limit, default 5), so a hook can’t keep the agent going forever on its own.
Loop detection and caps with LoopGuard (early Cursor support)
LoopGuard is an open-source (MIT) CLI that installs a preToolUse and a stop hook for Cursor (and the equivalent hooks for Claude Code and Codex CLI if you use them too):
npm i -g loopguard-cli # puts `loopguard` on your PATH loopguard init --agent cursor # adds hooks to ~/.cursor/hooks.json (backed up first) loopguard config set loop.maxRepeats 4 # identical tool calls allowed in the window (default 5) loopguard config set sessionCapUsd 10 # estimated $ per chat (default 25) loopguard config set dailyCapUsd 40 # estimated $ per local day, across all guarded agents (default 100) loopguard report --agent cursor --by session # what your recent Cursor chats cost, estimated
Restart Cursor (or reload the window) so it picks up the hooks. With them installed:
- Once the agent makes the same tool call 4 times within 10 minutes with the setting above, and nothing changed in between (same files in the git working tree, same output from Cursor’s
postToolUsehook), that call is denied with a message telling the agent to stop rerunning it, write down what it knows, and find the root cause first. - Past the session or daily cap, or after a $10 jump within 5 minutes, every tool call is denied, so the agent can’t run commands or edit files any further (it can still reply in text). Cursor’s hooks have no documented “end the chat” field, so repeated denial is how LoopGuard stops it.
loopguard pause 15lifts enforcement for 15 minutes;loopguard uninstall --agent cursor --restoreputs your originalhooks.jsonback.
Be clear about what is tested
LoopGuard’s Cursor support is early. It has been tested in a live cursor-agent session (version 2026.10.19, Composer 2.5): Cursor ran LoopGuard’s hooks from ~/.cursor/hooks.json, reported each turn’s tokens to the stop hook, and with a $0.05 session cap the first tool call after the cap was crossed was rejected. One gap: headless runs (cursor-agent -p) don’t report token counts to any hook, so caps can’t see their spend; loop detection still works there. The Cursor editor itself hasn’t been tested live yet. Treat LoopGuard as a second line of defense and keep your monthly spend limit set. More specifically:
- Dollar figures for Cursor are estimates, and they update once per turn. Since LoopGuard 0.1.2, at the end of each agent turn Cursor tells the
stophook how many tokens the turn used (input, output, cache reads and writes), and LoopGuard prices them at the model’s list price. A cap therefore applies from the next tool call after the turn that crossed it. LoopGuard also reads Cursor’s local chat database (state.vscdb), where many responses carry no token counts and are estimated from text length, and uses whichever source shows more spend for each chat. Cursor’s own billing is the source of truth. Unrecognized model names use a fallback rate; override them in~/.loopguard/pricing.json. - Loop detection doesn’t depend on cost data, so it is the more dependable part for Cursor today.
- Subagents aren’t counted. Cursor doesn’t report a subagent’s (Task tool) token usage to hooks, so it isn’t in the session total.
- Using Claude Code too? Cursor also runs hooks from
~/.claude/settings.json. If LoopGuard (0.1.2 or later) is installed for both, its Claude Code hook steps aside inside Cursor, so a blocked call gets one message, not two. - Cloud agents aren’t covered. Cloud agents only load project hooks (
.cursor/hooks.jsonin the repo), not~/.cursor/hooks.json; this only guards the agent running on your machine. - LoopGuard fails open: if it hits an internal error, Cursor keeps working and the error goes to
~/.loopguard/errors.log. If something looks wrong, please open an issue.
Related
- How to stop runaway Claude Code, Codex and Cursor agent loops
- How to track AI coding agent token costs per session
- How to set a spending limit for Claude Code
- How to cap OpenAI Codex CLI spend
- Claude Code usage limit reached: why it happens and how to monitor it
- How to set a hard budget for AI coding agents in CI
- Claude Code stuck in a loop: how to break it and stop it repeating the same command
- Codex usage limit reached: 5-hour and weekly limits explained
- Cursor agent stuck in a loop: how to stop it, roll back, and keep it from repeating
- Why Claude Code uses so many tokens, and how to use fewer
- How to set a budget limit for Aider
- GitHub Copilot agent mode stuck in a loop: how to stop it and keep it from repeating
- Cline stuck in a loop: how to stop it, roll back, and cap what it spends
- Gemini CLI usage limits: daily quotas, the June 2026 change, and keeping costs in check
- Codex stuck in a loop: how to stop it, undo it, and keep it from repeating