Rules / Context budget

context-cost

Over 5,000 tokens load every session from this file.

note by default Context budget Inline suppression allowed

Source: Claude Code docs: How Claude remembers your project (code.claude.com), read 14 October 2026.

On GitHub: the rule doc and the tests.

All rules73

What it catches#

Over 5,000 tokens load every session from this file.

A file that loads at the start of every session (a root CLAUDE.md, .claude/rules/*.md without paths, .cursorrules, .github/copilot-instructions.md and similar) with more than about 5,000 tokens in it. It is a note, not a warning: the file may be worth it. The point is that the cost is paid in every conversation, including ones that never touch the subject. The message says what to do: move topic-specific parts into files that load only when needed, such as path-scoped .claude/rules/ files, skills or linked docs.

Why it matters#

Everything in an every-session file is paid for in every conversation, and long instruction files are followed less reliably.

Bad example#

# CLAUDE.md

## API reference
<full endpoint-by-endpoint description of the REST API, 6,000 tokens>

Every session starts 6,000 tokens shorter, and the docs on which this rule rests say long instruction files are followed less reliably.

Good example#

# CLAUDE.md

The REST API is described in [docs/api.md](docs/api.md); read it before changing a handler.

How to fix#

Keep rules in the every-session file and move reference material behind a link, so the agent reads it when it needs it. Path-scoped rules (.claude/rules/ with paths, Cursor globs, Copilot applyTo) load only for matching files.

Suppress or configure#

For one finding, put a comment on the line above it. The reason after -- is optional but worth writing:

<!-- asitis-disable-next-line context-cost -- why this one is fine -->

For a whole file:

<!-- asitis-disable-file context-cost -- why this file is an exception -->

For every file, turn it off or change its severity in .asitisrc.json:

{ "rules": { "context-cost": "off" } }

A .asitisrc.json overrides entry limits a change to some paths, and a baseline (asitis lint --format json --write-baseline) accepts today's findings so only new ones fail the build.

Source#

Claude Code docs: How Claude remembers your project, read on 14 October 2026.

Run the rule

This page is generated from the plugin's rule registry. Edit it on GitHub. False positive? Open an issue with the line it fired on.