DEV Community

Clogmeter
Clogmeter

Posted on Originally published at clogmeter.vercel.app

Cursor rules token limit: 500 lines, four rule types, and what you pay every request

Cursor project rules are included in the model context when they apply, so every always-on rule is a permanent tax on the window. Cursor's docs give a practical size limit — keep each rule under about 500 lines — and four frontmatter types that decide when you actually pay.

Originally published on clogmeter.vercel.app.

Cursor project rules live in .cursor/rules as .mdc files. When a rule is applied, its contents are included at the start of the model context. That is useful, and it is also how a large Always Apply rule can quietly cost you tokens on every chat, including ones that have nothing to do with it.

The numbers and behaviour below follow Cursor's rules documentation. Exact behaviour can change between versions, so check the current docs before relying on a detail.

Four rule types (frontmatter decides)

Three frontmatter fields control the type: alwaysApply, description, and globs.

Rule type Frontmatter When it costs tokens
Always Apply alwaysApply: true Every chat; globs and description are ignored
Apply to Specific Files globs set, alwaysApply false When a matching file is in context
Apply Intelligently description only When the agent decides the rule is relevant
Apply Manually none of the three Only when you @-mention the rule

AGENTS.md is a simpler always-on alternative without frontmatter. It is useful for short, shared guidance, but it pays the same always-on cost as Always Apply rules.

The ~500-line best practice

Cursor's rules docs recommend keeping rules under 500 lines, splitting large rules into focused ones, and referencing files with @path instead of pasting their contents. Referenced file contents are not inlined into the prompt; the agent reads them with tools when needed. A long template pasted into a rule therefore costs tokens on every apply, while @service-template.ts does not until the agent opens it.

What that means for your budget

  • Always Apply is the expensive default. A 2,000-token always-on rule runs on every chat, whether the topic needs it or not.
  • Globs and descriptions buy specificity. A rule that only loads for src/api/**, or when the agent judges it relevant, stays out of unrelated sessions.
  • Manual rules are free until mentioned. Rare checklists belong behind an @-mention, not in Always Apply.
  • Over-500-line rules are a smell. Split them, or move long examples into files you reference with @path.

A short trim checklist

  1. Prefer glob, description, or manual over Always Apply for bulky guidance.
  2. Split rules over ~500 lines into focused .mdc files.
  3. Reference files with @path instead of pasting templates or long snippets.
  4. Weigh always-on rules first: paste Always Apply rules and AGENTS.md, then decide what can drop a level.

If a rule is not loading at all, the usual causes are a plain .md in .cursor/rules/ (Cursor expects .mdc with frontmatter) or a type that never matches the current context. That is a separate problem from cost, covered in Why Cursor is ignoring your rules.

How to measure the bill

To count a single .mdc file against common context windows, use the free Cursor rules token counter. To weigh a whole rules folder alongside AGENTS.md or CLAUDE.md, flag exact and near-duplicate rules and always/never conflicts, and export a trimmed copy, open the Clogmeter inspector. Both run in the browser; nothing is uploaded.


If you want to see where your own Cursor rules, AGENTS.md or CLAUDE.md spend tokens, we built a free browser-only checker that also flags duplicates and always/never conflicts: Clogmeter.

Top comments (0)