A good prompt isn’t enough anymore. What separates mediocre results from exceptional ones with AI is rarely the phrasing of the question — it’s the quality and structure of the context that precedes it. Context engineering is the art of building that context systematically.
Origin
Andrej Karpathy, OpenAI co-founder and former Tesla AI director, stated in 2024: “The hottest new programming language is English.” In 2025, he went further and popularized the term “context engineering” to distinguish professional practice from simple “prompt engineering.”
Oussama Ammar picked up and amplified the concept in a 2026 podcast: “The job of the future isn’t called ‘prompt engineer.’ It’s called ‘context engineer.’”
The Theory
Context before the question
An LLM processes all the text it receives — not just the final question. The context provided before the question largely determines response quality: the role assigned to the AI, examples, constraints, reference data, expected format, conversation history.
Information theory applied to AI
Claude Shannon (1948): the value of a signal depends on the signal-to-noise ratio of its environment. Good context = maximum signal-to-noise ratio for the model. Too much irrelevant information drowns the signal. Too little information forces the model to fill gaps with its own biases.
RAG: the empirical proof
Lewis et al. (Meta AI, 2020) formalized Retrieval-Augmented Generation: injecting relevant documents into an LLM’s context dramatically improves performance, often more than increasing model size. Context quality trumps raw power.
CLAUDE.md as a concrete example
Teams working professionally with Claude Code use a CLAUDE.md file: project context, code conventions, business rules, examples. This file is context engineering — it transforms a generic assistant into a project-specific expert.
In Practice
The levels of context engineering:
- Role context: “You are a French tax law expert, you answer in bullet points, you cite your sources”
- Data context: document injections, knowledge bases, histories (RAG)
- Constraint context: output format, length, style, what to avoid
- Example context: few-shot learning — showing expected input/output examples
- Task context: the precise question, formulated after everything else
A context engineer builds “pipes”: workflows that automatically assemble these context layers before each AI interaction. It’s no longer ad hoc prompting — it’s information architecture.
Nuances and Limits
Context engineering can become counterproductive if context is too long or verbose — LLM attention isn’t uniform across the entire context window. Crucial information should be at the beginning or end, not buried in the middle.
There’s also a risk of over-engineering: sometimes a simple prompt is enough. Context engineering is relevant for complex, repeated tasks — not for one-off questions.
Sources: Lewis et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Meta AI · Karpathy, A. (2024). Twitter/X · Shannon, C. (1948). A Mathematical Theory of Communication · Ammar, O. (2026). Podcast