# Context Engineering

Use when designing, reviewing, or debugging how an agent's context window gets filled...

- Repository: https://github.com/mvschwarz/openrig (8541 stars)
- Category: Design
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add mvschwarz/openrig --skill context-engineering -g -a claude-code -y`
Codex: `npx skills add mvschwarz/openrig --skill context-engineering -g -a codex -y`
Cursor: `npx skills add mvschwarz/openrig --skill context-engineering -g -a cursor -y`
Gemini CLI: `npx skills add mvschwarz/openrig --skill context-engineering -g -a gemini-cli -y`

## Description

Use when designing, reviewing, or debugging how an agent's context window gets filled, pruned, or shared, choosing what loads at boot versus on demand, sizing an install or an always-loaded file, fixing an agent that drifts, repeats itself, or forgets constraints mid-task, planning compaction or summarization, deciding single-agent versus subagents, engineering handoffs between agents, or picking a tool loadout. NOT for rewording a prompt's tone, choosing which model to pin, or debugging business logic, those are adjacent moments this skill does not serve. Historical 2024, 2025 snapshot; not normative for present-day frontier models, see the Status section.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Traditional Context Engineering, 2024, 2025 Snapshot

## Status: provisional historical research snapshot

This skill is a provisional historical research snapshot of context-engineering practice as
published in 2024, 2025. It is NOT normative. Do not apply it prescriptively to current frontier
models without re-verification. On any conflict, OpenRig current skills, explicit user rulings,
and directly measured OpenRig practice PREVAIL over this document. Treat these areas as
particularly suspect pending re-verification: compaction/summarization guidance, minimal-upfront
versus broad orientation, just-in-time lookup assumptions, fixed context ceilings, and
single-agent versus multi-agent advice.

Curated distillation of the best publicly available expertise on context engineering for coding
agents, drawn from primary sources at Anthropic, OpenAI, and leading practitioners (Manus,
Cognition, Chroma, LangChain, Drew Breunig, and others). Load on the moments the description
names; it is deliberately not part of any base walk.

---

## 1. The mental model: what context engineering is

**Definition.** Context engineering is "the set of strategies for curating and maintaining the
optimal set of tokens (information) during LLM inference", everything that lands in the window:
system instructions, tool definitions, retrieved data, message history, and tool outputs, not
just the prompt text (Anthropic, *Effective context engineering for AI agents*). Andrej
Karpathy's framing, popularized via LangChain: "the delicate art and science of filling the
context window with just the right information for the next step", the LLM is a CPU and the
context window is its RAM, and your job is deciding what gets loaded into RAM at each step
(LangChain, *Context Engineering for Agents*).

The rest: https://github.com/mvschwarz/openrig/blob/HEAD/packages/daemon/specs/agents/shared/skills/process/context-engineering/SKILL.md
