Skip to lesson
Exit
Building AI-Native Workflows1 / 2

2 min lesson

Mind the context window: the 50-65% rule

Think through this situation. "A long agent run is at 85% of the context window and the edits are getting worse. What's the best move?" Give the practical answer in plain words.

Step 1 of 2

Mind the context window: the 50-65% rulethe most quantified craft rule

More context usually means better edits, but every token adds latency and money to every call in the loop, so decide a context budget per workflow before production. The window itself is the hard edge of that budget, and output quality drops steeply as it fills, so work to these thresholds.

  • Quality is noticeably worse by 70-80% full and badly worse before 90%.
  • The working guidance converges on staying under roughly 60-65%.
  • Several heavy users start a fresh agent at about 50%.

The bottom-right fullness indicator shows how full the window is and what fills it, where the system prompt should stay small and the conversation should dominate, so a window already 50% full before you send a prompt is a warning sign that you have loaded too many tools or plugins.

The compaction trap

Exceed the limit and Cursor compacts: it compresses prior context. The trap is that a compacted run can behave like it never had that context at all, while you still pay for all the tokens.

Don't ride the window to the edge. Start a fresh agent for any logically new feature, and when a long run nears full, ask the agent to summarize what it's done and hand that small summary to a new agent. The codebase and commits, not the chat back-and-forth, are the real source of truth.

Learn more

Full explanation

@-Mention beats letting Cursor hunt

mention beats letting Cursor hunt

A vague prompt like "what color is the badge?" forces the agent to search the whole app. @-mentioning the exact file guarantees it lands in context instead of relying on semantic search: the model reads that file, finds the definition and returns the right hex code. Night-and-day efficiency and accuracy.

@ isn't limited to files: link docs, and reference a past chat to inherit its summary without carrying all of that context forward. Cursor summarizes the prior transcript.

The anti-pattern: "make the app better" on the biggest modelvague + expensive = a compounding cost loop

The canonical thing not to do is a vague prompt on the most expensive model. With no clear context the agent makes blind, random edits, burns tokens, then burns more reading and fixing the bad code it just wrote, a compounding cycle. Vague prompts cost more and lower quality; specific, file-referenced prompts cost less and produce better output.

Bad prompt

"Make the app better," sent to a frontier reasoning model.

No surface, no change, no constraints.

Blind edits → read/fix → more tokens, on repeat.

Good prompt

"Under the shop page, add an in-stock filter next to the existing tag and sort controls."

"Preserve the URL query params and update tests if needed."

Names the surface, the exact change and the constraints.

Say it like this

"I'd start from the failing test and the two files it exercises, @-mention them so they're guaranteed in context, attach the team's rules file for conventions and add type defs only where the edit crosses an interface. I keep the window under ~60-65%. If quality is still short, I add context one artifact at a time and re-run the eval set, rather than dumping the package up front and triggering compaction."