Beyond Prompts: The Rise of Context Engineering


Most people still think good AI output is all about “writing the perfect prompt.” But here’s the truth: as models get bigger and tasks get more complex, prompt engineering alone won’t cut it.

Enter context engineering—the skill that separates hobbyists from builders. It’s about designing the entire environment an AI works inside, not just the words you type in. When done right, it turns generic LLMs into reliable copilots, business tools, and even autonomous agents.

In this issue, we’ll break down:

  • What context engineering is (and how it’s different from prompts)
  • Why it matters for reliability, scale, and cost savings
  • A 9-layer structure you can start using today
  • Real-world examples where context makes or breaks performance

Let’s dive in.

What is Context Engineering?

Context engineering is the practice of deliberately designing, curating, and managing the context window—the set of information an AI model uses to generate responses or perform tasks. Unlike a single prompt, it involves orchestrating:

  • Conversation history
  • External data (documents, APIs, knowledge retrieval)
  • User-specific details
  • Tools and memory systems

It ensures the AI has the right information, in the right format, at the right time.

Key strategies include: - Write: Save notes or summaries for future use. - Select: Rank and retrieve relevant data via RAG. - Compress: Summarize long inputs to fit within token limits. - Isolate: Focus only on what’s needed for the current step.

As Andrej Karpathy puts it, this is “the delicate art and science of filling the context window with just the right information for the next step.”

What is Context Engineering For? (Purpose and Benefits)

Context engineering is used to make AI systems more reliable, efficient, and effective in real-world applications where simple prompts fall short. Its primary purposes include: - Handling Complexity: For tasks involving long histories or diverse data sources, like chatbots maintaining conversation state, AI agents analyzing documents (e.g., insurance claims), or multi-turn problem-solving. - Improving Performance: Reduces errors like hallucinations (AI fabricating info) by providing grounded, relevant context; optimizes for token limits to avoid overload; and enables dynamic adaptation (e.g., pulling in real-time data via RAG). - Enabling Advanced AI: Essential for building “agentic” systems—AI that acts autonomously, like scheduling assistants that reference calendars and user preferences—or production apps where consistency is key.

Benefits highlighted in discussions: Cost savings (e.g., via prompt caching for reusable context), better scalability for enterprise use, and turning generic LLMs into specialized tools. For instance, in a Reddit thread on meta-prompts, users note it helps “mine” user intents to create personalized, intention-rich outputs, making AI feel more intuitive.

What is the Difference Between Context Engineering and Prompt Engineering?

This is a top point of confusion, as the two are related but distinct: - Prompt Engineering: Focuses on crafting precise, standalone instructions or queries for an AI in a single interaction. It’s about wording (e.g., “Act as a expert and explain X step-by-step”) to elicit desired outputs, often using techniques like few-shot examples or chain-of-thought reasoning. It’s tactical and prompt-centric. - Context Engineering: Broader and more systemic; it’s about curating the entire environment around the prompt, including non-instructional elements like data, history, and tools. It treats the prompt as just one part of a larger “context window” and emphasizes ongoing management (e.g., compressing or updating context across sessions). As Tobias Lütke noted on X, it “describes the core skill better: the art of providing all the context for the task to be plausibly solvable by the LLM.”

In short: Prompt engineering is like writing a good question; context engineering is like setting up the whole classroom with resources for the AI to learn and respond effectively. Many sources, like Anthropic’s guides, position context engineering as an evolution for production-scale AI, where prompt engineering alone isn’t enough for complex, stateful systems.

If these spark more questions or you’d like answers to others from the list (e.g., “How do I get started?” or examples), let me know—I can expand or pull in specifics!

How to Structure Prompts for Context Engineering

To move from theory to practice, you need a repeatable way to assemble prompts and supporting context. Anthropic and others recommend a layered approach—think of it as building blocks that together create stable, reliable outputs.

9-Layer Prompt Structure

  1. Task context – Define the role and scenario clearly.
  2. Tone context – Set communication style/personality.
  3. Background data – Insert docs, guides, or retrieved knowledge.
  4. Detailed task description & rules – Constraints and interaction policies.
  5. Examples – Demonstrations of correct behavior.
  6. Conversation history – Maintain continuity across turns.
  7. Immediate request – Current user’s query.
  8. Reasoning step – Encourage step-by-step thinking.
  9. Output formatting – Specify structured responses.
  10. Optional prefilled response (if any) – Seed with a starting template.

This structure makes prompts less brittle and more reusable—context engineering in action. ## Where Context Engineering Shines

  • Agent Coding & AI Dev Tools​
    Code copilots like Code Interpreter, Claude Code, or GitHub Copilot get much smarter when they have curated context: project files, prior outputs, coding style guides.
  • Knowledge-Intensive Agents​
    “NAE” (Neural AI Agents) or research bots need retrieval pipelines, summarization, and context compression to navigate huge datasets.
  • Business Applications​
    Customer service agents need past tickets and CRM history.
    Marketing copilots need brand guidelines and prior campaigns.
    Enterprise apps need stable, reusable context windows across users.

In short, anywhere you need continuity, accuracy, or personalization, context engineering is essential.

Joon Ahn's newsletter

Read more from Joon Ahn's newsletter

marketers spend most of their week making small decisions, not writing. which lead is worth contacting. which message fits that lead. which ad creative to test. is this search term coming from a buyer. is this ad fatiguing. does the landing page match the promise. each one is small. thousands per week makes them expensive. last week i wrote about JEV, the decision model from TypeSafe AI. quick recap: an LLM generates an answer word by word. JEV takes a situation and a fixed list of possible...

hey JEV is insane. it scores your video before you film it, so you know if it's worth making. let me explain. most AI tools write. ChatGPT and Claude generate scripts, hooks, titles, whatever you ask for. JEV is different. it's a new model from TypeSafe AI, and it doesn't write anything. it judges. you give it information plus specific questions. it returns decisions, scores, and confidence your software can use right away. LLMs write. JEV decides. why this matters AI made content cheap....

hey. new long-form video is up. this one solves the most annoying problem in ai video: your character looks different in every shot. the short version: stop generating videos from one random portrait. build two reference files first. one defines who the character is. one defines how the shot looks. then every scene you generate inherits both. i just published the full build: How to Make Consistent AI Characters with GPT Image 2.5 + Seedance. same character across three separate videos....