context-engineering

A set of rules for managing the limited text an AI agent can consider at once. It covers concise prompts, loading information only when needed, and saving important notes during long tasks.

In plain words
What is it for?
Use it to design agent instructions, choose which files or references to load, summarize progress, and preserve decisions between work sessions.
Why use it?
It helps prevent important details from being crowded out as a task grows or the conversation becomes compressed.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/sijeeshmiziha/visionagent/context-engineering
Clone the repo
git clone --depth 1 https://github.com/sijeeshmiziha/visionagent

Made for: Cursor.

Per session 377 This file is loaded in full into every session.
When invoked 377 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00377 $0.00377
Opus 5 $0.00188 $0.00188
Sonnet 5 $0.00075 $0.00075
Haiku 4.5 $0.00038 $0.00038

Measured yesterday against content hash 85fed357344e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

context-engineering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/context-engineering.mdc · 33 lines

What it actually says

Context Engineering for Agents

Context Is Finite

  • Treat the context window as a scarce resource with diminishing returns; every token consumes attention budget.
  • Aim for the smallest high-signal set of tokens that maximizes the chance of the desired outcome.

System Prompts

  • Right altitude: Specific enough to guide behavior, flexible enough for heuristics. Avoid brittle if-else logic in prompts or vague, high-level hand-waving.
  • Organize prompts with clear sections (e.g. XML tags or Markdown headers like ## Tool guidance, ## Output description). Keep them minimal but sufficient.

Just-in-Time Context

  • Prefer lightweight references (file paths, stored queries) and load data on demand via tools instead of pre-loading everything.
  • Use progressive disclosure: let the agent discover and load only what it needs for the current step.

Compaction and Long Horizons

  • When context nears limits: summarize and compress; clear old tool call results; preserve architectural decisions and unresolved issues.
  • Use structured note-taking: agents write persistent notes (e.g. NOTES.md, progress files) outside the context window for cross-session memory.

Sub-Agent Architectures

  • Use focused sub-agents with clean context windows for deep work (e.g. research, code cleanup).
  • Sub-agents should return condensed summaries (on the order of 1–2k tokens) to the lead agent; keep detailed context isolated.
  • For orchestration, delegation, scaling effort, and production patterns, see the multi-agent-systems rule.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 33 lines · 377 tokens per session scan A 85fed357344e

Subscribe to this mod's changes

context-engineering is a cursor rule published in the GitHub repository sijeeshmiziha/visionagent (2 stars, last pushed 5mo ago), licensed MIT. It adds 377 tokens to every session, about $0.0019 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other cursor rules, from other repositories

digital-death-plan

Plan what happens to your digital life when you die — accounts, photos, passwords, money, and social profiles — so someone you trust can actually find, access, memorialize, or close them without a legal nightmare. Use when someone says 'what happens to my accounts when I die', 'digital legacy', 'help my family access…

mohitagw15856/pm-claude-skills · 116 tokens

mechanic-quote-decoder

Read a garage quote or invoice like someone who can't be padded — which line items connect to your actual symptom, which are while-we're-in-there additions, the questions that make soft lines disappear, when a second opinion pays for itself, and the scripts for declining work without souring the relationship. Use when…

mohitagw15856/pm-claude-skills · 129 tokens

used-car-decoder

Decode a used-car listing before you drive an hour to see it — what the seller's phrasing is hiding, the history-check items that matter, a test-drive and inspection checklist ordered by cost-of-miss, the questions that make evasive sellers visible, and the walk-away signs ranked 🔴🟡🟢. Use when someone says 'is this…

mohitagw15856/pm-claude-skills · 129 tokens

life-premortem

Write the failure story of your year, relationship, move, or big life bet in advance — imagine it's a year later and it went wrong, tell that story vividly, then mine it for the real risks and the cheap things that would have prevented them. Use when someone says 'I'm about to make a big life change', 'what could go…

mohitagw15856/pm-claude-skills · 121 tokens

agent-hiring-panel

Hire an AI agent the way you'd hire an employee — a role spec with success criteria, a structured work-sample interview run on your real tasks, reference checks (what do actual users report), probation KPIs, and termination criteria written before day one. Use when choosing between AI agents/tools/copilots for a job…

mohitagw15856/pm-claude-skills · 102 tokens

api-for-yourself

Publish 'how to work with me' as a literal API spec — endpoints (what to ask me for and what you'll get back), rate limits (meeting and interrupt tolerance), error codes (what happens when you surprise me Friday 5pm), auth (how to earn trust), and a changelog. Use when onboarding to a new team, when a new manager or…

mohitagw15856/pm-claude-skills · 112 tokens