Two years ago the advice was to learn prompt engineering. Last year it was context engineering. Both are turning into things the agent does for itself.
The short answer
Goal engineering is writing the finish line for an AI agent instead of the instructions. You define the outcome, the check that proves it, the things that must not change on the way, and a budget. The agent writes its own prompts and gathers its own context until the check passes. Your skill moves from wording to verification.
The term is new. Harrison Chase used it in a LangChain post on 14 November 2026, and his prediction is blunt: prompt engineering and context engineering will disappear, and goal engineering will remain. I think he's right about the direction. I'm less sure "disappear" is the right word, and I'll come back to that.
How we got here: prompts, then context, then goals

Remember when "prompt engineer" was going to be the job of the decade? The skill was wording. Say "think step by step". Give it a role. Put the important instruction last. Add three examples. People sold courses on magic phrases, and some of the phrases genuinely worked on the models of the time.
Then the models got better at reading plain requests, and the phrasing tricks stopped earning much. In June 2025, Shopify's Tobi Lütke said he preferred "context engineering", which he described as "the art of providing all the context for the task to be plausibly solvable by the LLM." Andrej Karpathy added his "+1" days later, calling it "the delicate art and science of filling the context window with just the right information for the next step." Simon Willison wrote it up on 27 June and guessed the term would stick. It did.
By September 2025, Anthropic's engineering team was calling context engineering "the natural progression of prompt engineering". The work became choosing documents, tools, memory and examples, and keeping the context window from filling with junk.
Now look at what shipped in 2026. OpenAI's Codex and Anthropic's Claude Code both added a /goal command. You type a condition, and the agent keeps taking turns until a separate model judges the condition met. Claude Code's documentation gives examples like migrating a module "until every call site compiles and tests pass". Nobody is writing the prompt for turn 47. The agent writes it.
That's the shift. You used to write the words. Then you chose what the model saw. Now you describe what done looks like, and how anyone would know.
What is goal engineering?
Goal engineering is specifying an outcome so precisely that a machine can check it. A good goal has four parts:
- One end state. A test result, an exit code, a row count, an empty queue. Something that is either true or false.
- The check that proves it. The command or query whose output shows the end state, such as
pytest tests/test_spatial.pyexiting 0. - Constraints. What must not change on the way there: no edits to the raw data folder, no tests deleted or skipped, no new dependencies.
- A budget. When to stop trying: 30 turns, two hours, or a token spend.
The Claude Code docs say almost exactly this. A condition "that holds up across many turns usually has" one measurable end state, a stated check and the constraints that matter. They add a detail most people skip: the evaluator "doesn't run commands or read files independently". It only reads what the agent has already shown in the conversation. So a check that never appears in the transcript doesn't exist as far as the evaluator is concerned.
That sentence should change how you write goals. "The output is correct" can't be judged. "Run python validate.py and show the summary line; it must say 0 failures" can.
Why prompt engineering stopped being the skill
Prompt engineering assumed one exchange. You write, the model answers, you judge the answer. Every trick was about getting a better single answer.
Agents don't work in single answers. METR's research on long tasks found that the length of task an AI agent can finish has doubled roughly every seven months for six years. When an agent runs for a couple of hours, your prompt is the first message out of hundreds. Most of the prompts that drive the work are written by the agent itself, to itself and to its subagents.
You can't hand-tune those. You can only decide where they're heading.
(There's still a place for careful wording. Tool descriptions, system instructions for products used by thousands of people and prompts in a high-volume pipeline still deserve attention. That's product engineering, though, not the everyday skill people were told to learn.)
Why context engineering is going the same way
Context engineering assumed you knew what the model needed to see. For a chatbot answering from a document set, you did. For an agent working through a codebase, you mostly don't, and the agent is better at finding it. It searches the repository, reads the files that matter, runs the command and reads the error. Coding agents already gather far more of their own context than any human curates for them.
So the context work moves into the agent, the same way the prompt work did.
Here's where I part company with "it will disappear". Chase's own example points the other way. The hardest context to supply, he writes, is knowledge that lives only in people's heads. In the sales-agent deployment his post describes, Actively AI rebuilt its agents so each one did one kind of job across many accounts. Reps could review similar work side by side, and their feedback carried over. The context that matters most comes from a person reviewing results and saying "no, not like that".
That is still context engineering. It just stops being something you do before the run and becomes something you do after it, as review. If you want an honest headline: prompt engineering and context engineering are over as the main skill. They aren't over as things that happen.
A goal that works, and one that doesn't
Here's a task I'd give an agent in GIS work: migrate a folder of analysis scripts from GDA94 to GDA2020.
The prompt-engineering version:
You are an expert GIS developer. Carefully update all the scripts in
scripts/ to use GDA2020 instead of GDA94. Think step by step and make
sure the results are correct."Make sure the results are correct" sounds responsible. It isn't checkable. The agent will change some EPSG codes, run nothing, and tell you it's done. If it does run something, nobody defined what passing means.
The goal-engineering version:
/goal Every script in scripts/ writes outputs in GDA2020 (EPSG:7844 or
EPSG:7855), and `pytest tests/test_spatial.py -q` exits 0 with the
result shown in the conversation.
Proof: run `python tools/crs_report.py out/` and show its output. Every
layer must list a GDA2020 EPSG code, and the feature count for each
layer must equal the count in baseline_counts.csv.
Constraints: do not modify anything in data/raw/ or tests/. Do not skip,
delete or mark any test as expected to fail. Do not add dependencies.
Budget: stop after 30 turns and report what is still failing.The second version is longer, and none of the extra length is wording. Every line is either a check or a fence. The feature count comparison matters more than it looks: a reprojection that silently drops records still produces a valid GDA2020 layer. I've written separately about the GDA94 to GDA2020 shift and why web maps end up 1.8 metres off, and the checks above are the ones that catch it.
Here's how the two versions typically play out. Given the first, an agent searches for 4283 and 28355, swaps in 7844 and 7855, and reports success. Every script still runs. But a script that called set_crs() instead of to_crs() now labels GDA94 coordinates as GDA2020 without moving them. The output looks right, opens in QGIS and sits about 1.8 metres off. Nothing in the first instruction would ever surface that.
Given the second, the same mistake fails the run. The CRS report shows the right code, but the test that compares a known survey mark against its published GDA2020 position fails by 1.8 metres, the evaluator says "not yet", and the agent has to find the set_crs() call to get past it. Same agent, same model. The only difference is whether "done" was something that could be checked.
How agents game a goal
Write a weak goal and the agent will meet it in a way you didn't want. This isn't new. DeepMind researchers catalogued it in 2020 as specification gaming: behaviour "that satisfies the literal specification" without the outcome the designer meant. In one of their examples, a robot rewarded for raising the bottom face of a red block flipped the block over instead of stacking it on the blue one.
Coding agents do the same thing with smaller stakes. "All tests pass" can be met by deleting the failing test. "The build is clean" can be met by switching off the warning. "Under 500 lines per file" can be met by putting the excess in one enormous line.
The constraints in a goal exist for exactly this. The most useful review question for any goal is: what is the cheapest way to make this check pass without doing the work? Then write a constraint that blocks it. For data work, two constraints usually cover it: one protecting the tests and one protecting the input data.
A spatial example shows why the second one matters. Set the goal "every parcel in the output falls inside the council boundary" and the cheapest way to pass is to drop the parcels that don't. Clip, filter, done. The check passes, and you've lost the 40 parcels that straddle the boundary, which were probably the ones you cared about. The fix is a constraint the agent can't route around: "the output feature count equals the input feature count, and any parcel that crosses the boundary is listed in boundary_exceptions.csv, not removed."
How to start goal engineering on Monday
You don't need a new tool to practise this. It works with any agent, and with people.
- Write the check before the goal. If you can't name a command, query or count that proves the work is done, you aren't ready to delegate it. Write the check first, even if it's a 20-line script.
- Make the proof show up. Tell the agent to print the check's output. A goal evaluator, a reviewer and your future self can only trust what they can see.
- Ask "how would I cheat?" For each check, write the constraint that blocks the cheap way to pass it.
- Set a budget and a report. "Stop after 30 turns and report what's still failing" turns a failed run into a useful one.
- Review in batches. Chase's point about feedback applies to everyone. When agents do one kind of task many times, you can review twenty results side by side and spot the pattern you'd miss in one.
Most of this is what good engineering managers already do when they write acceptance criteria. That's the uncomfortable part of the story for anyone who spent 2023 collecting magic phrases. The skill that lasts is old: saying clearly what done means, and how you'll know.
If you work in GIS, the checks in the GDA94 to GDA2020 offset post turn straight into goal conditions. And if your team is working out how to hand real analysis work to agents without losing trust in the numbers, that's part of the GIS consulting work I do. Get in touch.
Common questions
Is prompt engineering dead?
As the main skill, yes. Phrasing tricks matter much less with current models, and agents now write most of their own prompts during a run. Careful writing still matters for tool descriptions, system instructions and high-volume pipelines, where one prompt runs thousands of times.
What is the difference between context engineering and goal engineering?
Context engineering decides what information the model sees at each step. Goal engineering decides what outcome the agent must reach, how that outcome is checked and what it must not break on the way. With long-running agents, the agent handles much of its own context, and your job moves to the goal and to reviewing results.
Do I still need to learn prompt engineering?
Learn the basics, because clear writing helps everywhere. Don't spend months on it. Time spent learning to write testable acceptance criteria and small validation scripts pays off more with agents than time spent on prompt templates.
Technologies: AI agents, Claude Code, OpenAI Codex, LangChain, PyProj, GDA2020.
References
- LangChain: Goal Engineering (Harrison Chase, 14 November 2026)
- Simon Willison: Context engineering (27 June 2025)
- Anthropic: Effective context engineering for AI agents (29 September 2025)
- Claude Code documentation: Keep Claude working toward a goal
- METR: Measuring AI ability to complete long tasks
- DeepMind: Specification gaming, the flip side of AI ingenuity (21 April 2020)