Context engineering is the real job.
Model choice comes after what you feed it. How to give AI the right context: what to include, what to cut and how to write it down once.

By Rabin Nuchtabek · Updated 2026-10-29 · 3 min read · For Must know, Builders
Part of What is a forward deployed engineer? The ultimate guide to becoming one in 2027
Most bad AI output isn't a model problem. It's a context problem. The model didn't know who the email was for, which numbers were current, what you tried last week or what "good" means at your company. Switching to a bigger model rarely fixes that. Fixing the context does.
That's why I think context engineering is the actual job. Prompting is what you type. Context engineering is everything the model sees when it answers: instructions, documents, examples, tool results, chat history and memory.
More context isn't better context
Every model has a context window, and the windows got huge. That tempts people to paste everything. Don't. Models use long inputs unevenly. Researchers found they handle material at the start or end of a long prompt better than material in the middle ("lost in the middle"), and Chroma's tests showed performance dropping as inputs grow, even on simple tasks (context rot). Irrelevant text isn't free. It competes with the part that matters.
The goal is the smallest set of high-signal material that gets the job done.
The four layers
Think of context in layers, from the most stable to the most specific:
- Who and how. Your role, audience, style, rules and the words you never use. Changes rarely. Write it once as system instructions, project instructions or a file like CLAUDE.md or AGENTS.md.
- The project. What this piece of work is, decisions already made, constraints, where things live. Changes per project.
- The task. What you want right now, what good looks like and the material for it.
- The working memory. What happened in this session: drafts, feedback, tool results. This is the layer that bloats. Trim it, or start fresh with a summary when a chat runs long.
Write your context down once
The habit that pays back the most is a short context document you reuse everywhere. Keep it under a page:
- Who you are and who you work for.
- Your audiences and what they care about.
- Your style: tone, length, formatting, banned words.
- Standing rules: "cite sources", "never invent numbers", "ask before assuming".
- Known mistakes: every time the model gets something wrong twice, add a line.
That last point is the trick. Your context document should be a living list of corrections. After a month, it holds most of your judgment.
Context for agents and coding tools
Agents make all this more important, because they gather their own context with tools and run for many steps, and every step adds to the window. Good agent setups:
- Keep instruction files short and specific: build commands, conventions, where things live, what not to touch.
- Load detail on demand instead of upfront. Agent skills do this well: the agent sees a one-line description and reads the full instructions only when a task needs them.
- Give tools clear, distinct jobs, so the agent picks the right one.
- Hand big side tasks to subagents with fresh windows, and bring back only the result.
Retrieval: when it won't fit
When the material is too big, or changes often, don't paste it. Retrieve it. Retrieval-augmented generation finds the few relevant passages and feeds only those to the model, with the source attached so you can check the answer. Most "chat with your documents" products work this way, and their quality depends far more on how documents are split and searched than on the model.
A quick context checklist
Before you blame the model, check:
- Did it know the goal and the audience?
- Did it have the actual material, or was it guessing?
- Was the important part buried in the middle of a wall of text?
- Was the chat so long that early instructions got diluted?
- Did you show it what good looks like?
Fix the context first. If it still fails, then try a different model.
"constrained context" is the entire game right now.
most teams ship an agent, then dump every doc, every slack thread, every stale spec into the context window... and act shocked when it confidently outputs garbage.
selecting context is harder than building the agent.
Questions people ask
What is context engineering in AI?
Context engineering is shaping everything the model sees when it answers, not just what you type. That includes instructions, documents, examples, tool results, chat history and memory. Prompting is only the part you type. Most bad output comes from missing context, such as not knowing the audience, which numbers are current or what good looks like at your company.
How do I write a reusable context document for AI?
Keep a short document under a page that you reuse everywhere. Include who you are and who you work for, your audiences, your style and banned words, and standing rules like "never invent numbers". Add a line every time the model gets something wrong twice, so the document becomes a living list of corrections that holds most of your judgment.
Is switching to a bigger model better than fixing context?
Usually not. A bigger model rarely fixes bad output, because most failures are context problems. Before you blame the model, check whether it knew the goal and audience, had the actual material, could find the important part, and saw an example of good work. Fix the context first, and only try a different model if it still fails.
Why does pasting too much context make AI answers worse?
More context competes with the part that matters. Models use long inputs unevenly and handle material at the start or end better than the middle, known as "lost in the middle". Chroma's tests showed performance dropping as inputs grow, even on simple tasks. Aim for the smallest set of high-signal material, lead with the goal and trim long chats.
How should I prepare for context engineering in 2027?
Start by writing your context down once in a short, reusable document and keep adding corrections. Organize context in layers: who and how, the project, the task and working memory. For agents, keep instruction files short, load detail on demand with skills, give tools distinct jobs and use subagents. Retrieve big or changing material instead of pasting it.
Key terms
Context engineering · Context window · Context rot · Retrieval-augmented generation · Agent skill · AGENTS.md · Subagent
Try it here
Skills and workflows · Prompt workbench