Master the four operations of context engineering — Write, Select, Compress, Isolate. Manage token budgets, compaction strategies, and context partitioning to keep AI sessions sharp and efficient.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Context Engineering
Four operations control everything about how context flows through an AI coding session. Master them and you control the quality of every response.
## The Four Operations
### 1. Write — Persist Info Outside Context
Move information out of the context window into durable storage so it survives compaction and session boundaries.
**Where to write:**
| Target | When | Example |
|--------|------|---------|
| CLAUDE.md | Permanent project rules | "Always use pnpm, never npm" |
| NOTES.md / scratchpad | Working state for current task | Architecture decisions, open questions |
| `.claude/memory/` | Learnings and patterns | `[LEARN]` rules from corrections |
| External files | Data too large for context | Test plans, migration checklists |
**Pattern — Scratchpad workflow:**
```text
1. Start complex task → create NOTES.md with goals and constraints
2. After research → write findings to NOTES.md
3. After compaction → NOTES.md survives, context does not
4. Resume → read NOTES.md to recover full state
```
### 2. Select — Retrieve Relevant Info
Pull the right information into context at the right time. Precision matters more than volume.
…
The line at the top of this page pins the label git:20260926.d6ee15f, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_limctnksg2utqdg4
GET https://markdownregistry.com/api/v1/resolve?ref=rohitg00/pro-workflow/context-engineering
GET https://markdownregistry.com/api/v1/blob/ee4284622a6157bd56cadfe2d78debde3b739a69ec1296fac1a9442c57581555
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
rohitg00/pro-workflow · skills/agent-teams/SKILL.md · Coordinate multiple Claude Code sessions as a team — lead + teammates with shared task lists, mailbox messaging, and…
rohitg00/pro-workflow · skills/auto-setup/SKILL.md · Auto-configure quality gates, hooks, and settings for a new project. Detects project type and sets up appropriate…
rohitg00/pro-workflow · skills/batch-orchestration/SKILL.md · Decompose large-scale changes into independent units and spawn parallel agents in isolated worktrees. Use for…
rohitg00/pro-workflow · skills/bug-capture/SKILL.md · Capture a user-reported defect as a durable GitHub issue written in the project's own domain language. Explores the…
rohitg00/pro-workflow · skills/compact-guard/SKILL.md · Smart context compaction with state preservation. Saves critical files, task progress, and working state before…
rohitg00/pro-workflow · skills/context-optimizer/SKILL.md · Optimize token usage and context management. Use when sessions feel slow, context is degraded, or you're running out of…
rohitg00/pro-workflow · skills/cost-tracker/SKILL.md · Track session costs, set budget alerts, and optimize token spend. Use to check costs mid-session or set spending limits.
rohitg00/pro-workflow · skills/design-engineering/SKILL.md · Apply interface craft when building or reviewing UI - motion, easing, timing, springs, component feel, and visual…
rohitg00/pro-workflow · skills/deslop/SKILL.md · Remove AI-generated code slop, unnecessary comments, and over-engineering from the current branch diff. Cleans up…
rohitg00/pro-workflow · skills/domain-modeling/SKILL.md · Build the project's shared language and bounded contexts before writing code, so names stay consistent and the agent…
rohitg00/pro-workflow · skills/improve-architecture/SKILL.md · Audit an area of the codebase and propose the smallest structural moves that improve it - untangle boundaries, kill…
addyosmani/agent-skills · skills/context-engineering/SKILL.md · Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching…
mvschwarz/openrig · packages/daemon/specs/agents/shared/skills/process/context-engineering/SKILL.md · Use when designing, reviewing, or debugging how an agent's context window gets filled, pruned, or shared — choosing…
mvschwarz/openrig · skills/_canonical/process/context-engineering/SKILL.md · Use when designing, reviewing, or debugging how an agent's context window gets filled, pruned, or shared — choosing…
a5c-ai/babysitter · library/methodologies/gsd/skills/context-engineering/SKILL.md · Context window monitoring and budget management. Keeps orchestrator at 15-30% context usage while subagents get full…
shashankswe2020-ux/whoop-mcp · .github/skills/context-engineering/SKILL.md · Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching…
habitat-thinking/ai-literacy-superpowers · ai-literacy-superpowers/skills/context-engineering/SKILL.md · This skill should be used when the user asks about "writing conventions", "codebase context", "HARNESS.md context…