Context engineering

Engineer what the model sees (files, docs, rules, tools) more than the wording.

Draft: open for discussion

Definition

The prompt is only the last line of what the model sees. Context engineering is the work of assembling everything else: the right files, docs, schemas, conventions, examples, tools and constraints, and keeping out what does not help. With good context, short prompts work. With bad context, no wording will save you. It is central to working with coding agents.

Example prompt

Most of the work happens before the prompt, which is a single line.

Context engineering
# AGENTS.md (project rules, always loaded)- Stack: React + Vite, tests with Vitest.- Images come from GET /api/images?limit=N.- Components live in src/components, one test file each.- Never fetch inside components. Use hooks in src/hooks.# Attachedsrc/hooks/useImages.tssrc/components/LazyImage.tsxdocs/design-tokens.md (transition timings)Build the home carousel described in issue #142.

What it reveals

  • Maturity with agents and larger systems
  • Understanding of what the model needs to know, and what it does not
  • Ability to make a team's conventions readable by machines

Use it when

  • Working with coding agents on a real codebase
  • Recurring tasks where rules should be written once
  • Large codebases where the model cannot see everything

Watch out for

  • Context stuffing: irrelevant material dilutes the model's attention
  • Stale rules files that contradict the code
  • Leaking secrets or private data into the context

In an interview

Look for

  • What did the candidate give the model, and what did they leave out on purpose?
  • Do they keep rules and docs up to date as the project changes?

Ask

  • Why these three files and not the whole folder?
  • What would you add to AGENTS.md after this task?

Origin

Popularized in June 2025 by Shopify CEO Tobi Lütke, who said he preferred the term to "prompt engineering", and amplified a week later by Andrej Karpathy, who described it as the art of filling the context window with just the right information for the next step. The term was already in use earlier that year, for example in Dex Horthy's 12-Factor Agents and in Cognition's "Don't Build Multi-Agents". Nobody is credited with coining it.

Tobi LütkeAndrej KarpathyJun 19, 2025

Sources