Context Engineering
Context engineering is the discipline of deciding exactly what information enters a model's context window, in what order and at what cost.
/ quick answer
Prompt engineering writes instructions; context engineering manages the whole payload — system rules, retrieved knowledge, tool schemas, conversation history and tool output. The core moves are: retrieve instead of dumping, summarise before re-injecting, cache stable prefixes, and cut anything that hasn't changed a decision. Most agent quality and cost problems are context problems.
/ frequently asked
What is Context Engineering?
Prompt engineering writes instructions; context engineering manages the whole payload — system rules, retrieved knowledge, tool schemas, conversation history and tool output. The core moves are: retrieve instead of dumping, summarise before re-injecting, cache stable prefixes, and cut anything that hasn't changed a decision. Most agent quality and cost problems are context problems.
What is an example of Context Engineering?
Replacing a 30k-token document dump with 6 retrieved chunks improved answer accuracy and cut cost per call by 85%.
Why does Context Engineering matter?
Context engineering is the discipline of deciding exactly what information enters a model's context window, in what order and at what cost.
What should I learn after Context Engineering?
Open the related workflows and prompts further down this page: they show how this idea is applied in a real task, step by step.
/ continue exploring
Related concepts
The vocabulary this page depends on.
- →AI Software Engineering
AI software engineering is the practice of building software where agents write most of the code and humans own architecture, review and verification.
- →MCP Resources
MCP resources are addressable read-only context — files, records, docs — that a client can pull into the model instead of calling a tool.
- →MCP (Model Context Protocol)
Open protocol that lets LLMs connect to tools, data sources and apps through a standard interface.
- →Context Window
The maximum amount of text (in tokens) an LLM can consider in a single call.
Related workflows
Turn this into a repeatable process.
- →Cut Agent Costs by 60% Without Losing Quality
A measurable cost-reduction pass for any agent already in production.
- →Run a Coding Agent on a Real Codebase Safely
Give an agent write access without letting it wreck main.
- →How to Create a Website with AI
Go from idea to a live, custom-domain website in one afternoon using AI builders.
- →How to Build an AI Content System
A repeatable pipeline that turns one input into publish-ready content across every channel.
Related tool stacks
The tools that run it in production.
- →Coding Agent Stack
Run coding agents with executable feedback and reviewable diffs.
- →AI Observability Stack
Traces, cost, evals and quality drift for AI systems in production.
- →AI Research & Knowledge Stack
Default toolset for analysts, founders and creators doing deep research with AI.
Related prompts
Reusable prompts for this job.
- →Coding Agent Task Spec Prompt
Writes the task brief that keeps a coding agent inside scope.
Comparisons & alternatives
Pick between the options.
- →RAG vs Long Context Windows
Is RAG obsolete now that context windows are 1M+ tokens? Not quite — here's when each wins.
- →ChatGPT vs Claude
Two leading conversational AI assistants compared across reasoning, writing, coding, and pricing.
- →Lovable vs Bolt
Two AI app builders compared on speed, backend, deployment, and production readiness.
- →OpenAI API vs Anthropic API
Choosing between the two leading LLM API providers for production apps.