glimfly
ai updated

What is context engineering? (and is prompt engineering dead?)

In one sentence:Context engineering is the practice of deliberately curating everything that loads into a model's context window before it answers: which files, which past messages, which tool results, and which instructions, so the model has what it needs and nothing crowding it out.

What it actually is

Context engineering is deciding what a model actually sees the moment before it answers: which files got loaded, which past messages survived in the conversation, which docs or search results got pulled in, which tools it’s allowed to call, and in what order all of that landed in its context window. Prompt engineering, the older and narrower term, covers the wording of the one message you just typed. Context engineering covers everything else in the room with that message.

Think of briefing a contractor for a job site. Word your instructions perfectly, but if the contractor never sees the blueprints, the permit history, or which wall is load-bearing, that wording doesn’t save the outcome. Context engineering is deciding what goes in that folder before the contractor picks up a hammer.

Why your AI just did this

The term arrived once coding agents stopped being single-turn chatbots and started running over many turns, reading many files, and calling tools across a whole session, in tools like Claude Code, Cursor, and Lovable. Writing one message to a chatbot, wording is most of the job. Deep into an agent session, most of what shapes the next move isn’t the latest message at all: it’s the CLAUDE.md or AGENTS.md loaded at the start, the files already read, and whatever survived the last round of compacting.

Anthropic’s engineering team frames the context window as a finite resource with diminishing returns: every added token competes for the same fixed space, and accuracy measurably degrades as that space fills with low-signal content, something the field now calls context rot. That’s a big part of why Claude Code auto-compacts long sessions, keeps CLAUDE.md short by design, and hands you subagents to keep exploration out of your main conversation. It’s the same reason a beginner in Lovable or Cursor gets vaguer answers deep into a long build, even when every prompt along the way was clear.

The phrase got popularized in 2025. Andrej Karpathy posted about preferring “context engineering” over “prompt engineering” that year, arguing that people associate prompts with short task descriptions while real agent work is the harder job of filling the context window with the right information. Anthropic’s engineering blog picked up the same framing months later, in a post about managing an agent’s entire context state, not just its instructions.

When you’ll run into it

You’ll see the phrase on Reddit and X, usually as “prompt engineering is dead, it’s all context engineering now,” dropped into a thread about why an agent keeps making the same mistake. You’ll also meet the underlying problem without the label attached: your agent re-adds a function you deleted, asks a question you already answered, or gives a noticeably vaguer answer the longer a single session runs, all symptoms of the context window filling with old or already-summarized content.

It also shows up whenever someone tells you to “just give it a CLAUDE.md” or “point it at the two files that matter instead of the whole repo.” That’s context engineering advice wearing a tool-tip costume. Structurally, most coding agents now expect some project-level instructions file for this exact reason: Claude Code looks for CLAUDE.md specifically, while Cursor, Codex, and dozens of others share one open format, AGENTS.md, built so you write that guidance once instead of per tool.

What to check

  • Trim your CLAUDE.md or AGENTS.md down to what the agent can’t infer from the code itself. A bloated file buries the instructions that matter
  • Point your agent at the specific file or two the task touches instead of asking it to read the whole project
  • Start a new session for a new, unrelated task instead of piling it onto a conversation already full of an old debugging thread
  • Before a big task, tell your agent to focus its context on what matters instead of leaving that to automatic compaction
  • Treat vaguer answers, repeated questions, or the agent re-adding deleted code as a signal to prune context, not as the model having an off day
  • Keep large reference docs and search results out of the main conversation, and let the agent fetch them just when it needs them

Say it like a dev

Instead of: “just word the prompt better, this should work” Say: “let’s check what’s actually loaded in context right now, not just how I’m phrasing the ask”

Instead of: “why does it keep forgetting things I said earlier” Say: “this session’s context window is probably full or already compacted, should we start fresh and put that rule in CLAUDE.md instead”

Instead of: “give it more instructions to fix this” Say: “trim what it’s reading down to the two files this actually touches, instead of the whole repo”

People actually ask

“People keep saying prompt engineering is dead, is that true?”

Wording your request still matters, so it's not dead in the sense of useless. What changed is where the hard work moved. Once agents run over many turns, read many files, and call tools across a whole session, the bigger lever isn't how you phrase one message, it's what else is sitting in the context window at that moment. That's the shift people mean when they say context engineering replaced it.

“What's actually different between prompt engineering and context engineering?”

Prompt engineering is about wording the single message you just typed. Context engineering is about everything else present when the model reads that message: the project instructions file, the files it already opened, the summary left behind after the conversation got compacted, and the tools it has access to. A perfectly worded prompt can still fail if the model never saw the file it needed.

“I'm not a programmer, how do I actually do context engineering as a vibe coder?”

Keep your project's instructions file short and specific instead of dumping your whole history of preferences into it. Point your agent at the exact file or two it needs instead of asking it to read the entire project. Start a fresh session for a new task instead of piling it onto a conversation already full of an old debugging thread. All three are context engineering, no coding knowledge required.

Related terms

Checked against

free tool · no signup

Just met this in a real session? Glim reads it in plain words.

Paste what your agent just did, a git diff, your terminal, or its summary, and Glim tells you what changed and what to check before you ship. Nothing stored.

Explain my session →