← Back to list

Stop Dumping Project Rules into Your LLM Context Window

Why always-on .cursor/rules are making your AI agents expensive and confused—and how to fix it with on-demand context.

Revanth Pobala · 2026-05-16 17:58 · 0 claps · 2.2 min read
#large-language-models #artificial-intelligence #software-engineering #prompt-engineering #technology
Open on Medium ↗
Wiki topics: LLM · Large Language Models AGT · AI Agents AI · AI · General

Stop Dumping Project Rules into Your LLM Context Window

Why always-on .cursor/rules are making your AI agents expensive and confused—and how to fix it with on-demand context.

As teams scale their use of AI coding agents, providing the right context becomes a significant challenge. To ensure agents behave safely and follow project standards, teams increasingly copy project guidance into .cursor/rules (or similar mechanisms) and mark it as "always-on".

While this brute-force approach works well for small rule sets, it quickly falls apart at scale. Enter Rules Context MCP — a retrieval and delivery layer for agent guidance that serves project rules to LLM agents on demand through the Model Context Protocol (MCP).

Here is a look at why the current approach is breaking down, and how moving rules retrieval behind MCP offers a scalable solution

The Problem with Always-On Context

Currently, the default pattern is to load every project rule, skill, playbook, and workflow policy into every developer chat’s context window.

The result is both expensive and noisy:

  • Repeated Token Cost: Every chat pays for rules that may not apply to the current task.
  • Diluted Attention: Relevant guidance competes with entirely unrelated rules in the model’s context window, degrading performance.
  • Stale Context: Copied rules can easily become outdated, partial, or out of sync with the actual source documentation.

The Solution: Move Retrieval and Synthesis Behind MCP

Rules Context MCP solves this by acting as a delivery layer for all agent guidance — including rules, skills, playbooks, knowledge notes, review checklists, and workflow policies. (Note: It is not a replacement for the source documentation itself, but rather a smart delivery mechanism).

Instead of loading every rule into every prompt, the caller LLM simply asks for task-specific guidance. For example, a prompt might look like:

Create a plan for building an enterprise Spring Boot API in this repo, including project structure, dependencies, configuration, testing, security, and observability.

How It Works

  1. Task-Specific Retrieval: The MCP server indexes the guidance source, retrieves the matching documents based on the task, and returns only what the task needs.
  2. Synthesized Guidance: By default, it returns synthesized guidance to keep the context clean and focused. When exact wording matters, it can return the matching source documents or chunks verbatim.
  3. Dedicated MCP-side LLM: The heavy lifting of synthesis is done by an MCP-side LLM called by the server. This allows you to configure specific model choices, credentials, latency budgets, and cost budgets just for rule retrieval.

The Result

By decoupling the knowledge retrieval from the main agent loop, the expensive frontier caller model no longer needs to carry the entire guidance corpus in its working memory.

Rules Context MCP reduces repeated prompt tokens while drastically improving consistency, traceability, and workflow correctness. As we build more complex AI agent workflows, moving from “always-on” to “on-demand” context isn’t just an optimization — it’s a necessity.


메타데이터
post_id
06f52d6beba4
slug
stop-dumping-project-rules-into-your-llm-context-window-06f52d6beba4
url
https://medium.com/@revanthpobala/stop-dumping-project-rules-into-your-llm-context-window-06f52d6beba4
canonical_url
https://medium.com/@revanthpobala/stop-dumping-project-rules-into-your-llm-context-window-06f52d6beba4
author_url
https://medium.com/@revanthpobala
status
ok
fetched_at
2026-06-09 15:37:30