context-engineering

A guide to managing the information an AI coding agent receives, keeps, removes, or shares during a task.

In plain words
What is it for?
Use it when designing or debugging startup context, on-demand instructions, shared context, summarization, compaction, or the size of always-loaded files.
Why use it?
It helps address agents that lose constraints, repeat themselves, drift from the task, or load too much information at once.

Skill for Claude CodeCodex

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 skills/mvschwarz/openrig/context-engineering
Any agent
npx skills add mvschwarz/openrig --skill context-engineering
Clone the repo
git clone --depth 1 https://github.com/mvschwarz/openrig

Made for: Claude Code, Codex.

Per session 142 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,358 The whole file, excluding the scripts and references it only reads on demand.
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.00142 $0.07358
Opus 5 $0.00071 $0.03679
Sonnet 5 $0.00028 $0.01472
Haiku 4.5 $0.00014 $0.00736

Measured 2d ago against content hash ef0522380604, 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 2d ago.

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.

packages/daemon/specs/agents/shared/skills/process/context-engineering/SKILL.md · 480 lines

How it starts

The opening of the file, as written. The whole thing — 480 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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).

Why it superseded prompt engineering. A chatbot answers one question with whatever fits in one turn. An agent runs in a loop, accumulating tool results, file contents, and history across dozens or hundreds of steps. The improvements stop coming from rewording instructions and start coming from rewiring — what the agent retrieves, in what order, and what gets evicted when the window fills (Anthropic, ibid.). Philipp Schmid's formulation of the practical consequence: "Agent failures aren't only model failures; they are context failures." Most of the time when a capable model does something dumb, the context it was given made the dumb thing likely (Schmid, The New Skill in AI is Context Engineering).

Read the full file on GitHub · 480 lines

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. 2d ago First seen · 480 lines · 142 tokens per session scan A ef0522380604

Subscribe to this mod's changes

context-engineering is a skill published in the GitHub repository mvschwarz/openrig (64 stars, last pushed 2d ago), licensed Apache-2.0. It adds 142 tokens to every session and 7,358 once invoked, about $0.0007 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-30.

Related

Other skills, from other repositories

autoprompt

Explicit-only useful-first orchestration. Invoke only when the user names autoprompt - typed as /autoprompt or in plain language such as "act in autoprompt mode" - to turn a mission into one executable roadmap, build dependency-safe lanes, and verify the result with independent reviewers. Do not infer invocation from…

Spielewoy/autoprompt-skill · 85 tokens

autoprompt

Explicit-only useful-first orchestration. Invoke /autoprompt to turn a mission into one executable roadmap, build dependency-safe lanes, and verify the result with independent reviewers. Never infer invocation from ordinary requests. Never resume from leftover artifacts without an explicit resume instruction.

Spielewoy/autoprompt-skill · 56 tokens

autoprompt

Explicit-only useful-first orchestration. Invoke /autoprompt to turn a mission into one executable roadmap, build dependency-safe lanes, and verify the result with independent reviewers. Never infer invocation from ordinary requests. Never resume from leftover artifacts without an explicit resume instruction.

Spielewoy/autoprompt-skill · 56 tokens

ap-feature-coordinator

L1 feature coordinator - drives approved ROADMAP.md lanes through their required build/review/verification gates and owns the run-wide feature frontier.

Spielewoy/autoprompt-skill · 33 tokens

ap-implementer

L3 executor - G4 IMPLEMENT. Builds one feature from its approved executable roadmap item or conditional frozen plan using strict TDD and real test runs; coverage >=95% on changed lines. Reports PLAN-CONFLICT rather than improvising.

Spielewoy/autoprompt-skill · 52 tokens

ap-researcher

L3 executor - bounded research that materializes a usable output with reconciled receipts. Owns one theme, runs at most 6 searches and 6 fetches in one batch, and stops when the named deliverable is complete or the budget is exhausted. Does not spawn.

Spielewoy/autoprompt-skill · 61 tokens