Wink Pings

Karpathy Says 'Delete Everything, Keep Graph': The Five Levels of AI Engineering

In a 124-minute demo, Andrej Karpathy said prompting is about to disappear, leaving only Graph. Based on Livsun's roadmap, this article breaks down AI engineering into five levels: Prompt, Context, Harness, Loop, Graph. Most people are at level one, but the competitive edge lies higher up.

In a 124-minute demo, Andrej Karpathy delivered a verdict: Prompting is going away. Delete everything, keep Graph.

In the video, he starts with Prompt, dismantles prompts step by step, and in the end only Graph remains. This tweet also includes a long article by Livsun titled Prompt → Context → Harness → Loop → Graph: The 5 Levels of AI Engineering. It breaks AI engineering into five levels. Models change every few weeks, but these five levels will not expire. Each level answers the same question: What can you give the model?

Level 1: Prompt engineering — you are the loop

You write instructions, the model answers, you judge, and then you revise. This is the slowest way because the slowest part of the system is the human. The model produces a result in seconds; reading, thinking, and retyping takes you minutes. The sign of being stuck at this level: you have accumulated a pile of magic phrases, such as think step by step and you are a world-class expert. These still help, but no sentence can give the model facts it does not have, tools it cannot call, or a way to check itself.

The test for going from 1 to 2: next time the answer is wrong, don't change the prompt. Ask one question: What did the model need to see at that moment? If the answer is a file, a document, an example, or a rule, then the problem is not the prompt—it is the context.

Level 2: Context engineering — filling the window

In June 2025, Shopify CEO Tobi Lütke said he prefers the term context engineering; the core idea is to provide the LLM with all the context the task requires. Karpathy replied with a +1 and gave the definition people now cite: filling the context window artfully for the next step.

The model does not know your project, your rules, or yesterday's decisions. It only knows what is in the window. So the focus shifts from polishing instructions to budgeting the window: unchanging rules go in the system prompt and CLAUDE.md; tool descriptions; decisions and state; retrieved materials; and finally the task itself. But the bottleneck at this level is that you are still assembling the window by hand.

Level 3: Harness engineering — the model is the engine, the harness is the car

A harness is everything around the model: tools, permissions, sandboxes, memory files, hooks, and run traces. Claude Code is a harness; so is Codex CLI. Put the same model into two harnesses and you get two different agents.

OpenAI published an article discussing harness engineering in February, and researchers from Fudan University and Peking University also ran experiments. They had one agent continuously improve another agent's harness; after ten rounds, Terminal-Bench 2 pass@1 rose from 69.7% to 77.0%, surpassing the human-designed 71.9%, and the frozen harness used 12% fewer tokens on SWE-bench Verified. The gains came from tools, middleware, and long-term memory, not from the system prompt. The place most people spend the most time is precisely the least important place.

Today's first action: give the agent a gate it cannot get around. Claude Code's Stop hook can run a command when the agent tries to finish, and if the tests do not pass, it blocks it.

{
  "hooks": {
    "Stop": [
      { "hooks": [{ "type": "command", "command": "npm test --silent >&2 || exit 2" }] }
    ]
  }
}

Now done means the tests pass, not that the model feels it can stop.

Level 4: Loop engineering — stop prompting by hand

On June 7, Addy Osmani named this level: Loop engineering is replacing yourself as the person who prompts the agent. It sits one level above the harness. Peter Steinberger says you should no longer manually prompt the agent; you should design loops that prompt the agent. Boris Cherny, the creator of Claude Code, also says he no longer prompts Claude; he writes loops.

The components of a loop: automations that wake up on a schedule to find work; worktrees that let parallel agents work without interfering with each other; skills that store project knowledge; plugins that connect to existing tools; and sub-agents that separate proposers from checkers, plus state storage. Claude Code's /loop can be used directly, for example:

/loop 30m read STATE.md, pick the top open bug, fix it in a worktree, run the tests, open a PR, then write what you did back into STATE.md

The trap is also simple: an agent loop can spend money all night. So every loop worth running needs brakes: a completion check outside the model, a budget, stopping after two consecutive rounds with no new progress, and writing state at every step so it can recover. A loop is not fully automatic; it removes typing, but the thinking is still yours. Skip loops, and every mistake will eventually become a reason for you to complain about the model.

Level 5: Graph engineering — drawing the shape of the work

The highest level no longer thinks in steps; it thinks in nodes and edges. A node is a task with clear inputs and outputs, and an edge exists only when an output feeds the next input. Many step one, step two, step three agents contain a lot of fake edges: they do not read each other's outputs at all; they just queue up.

After deleting fake edges, the line becomes a diamond: split breaks a task into independent chunks; fan out lets multiple agents process in parallel; verify filters results with skepticism; merge has the survivors write the answer. Claude Code's dynamic workflows (research preview, released in June) allow Claude to write a JavaScript script that runs with dozens or hundreds of subagents.

const parts = await agent(`Split this audit into independent parts: ${task}`, { schema: PARTS });

const findings = (await parallel(parts.items.map((part) => () =>
  agent(`Audit ${part.path}. Return every finding.`, { schema: FINDINGS })
))).filter(Boolean).flatMap((result) => result.items);

const verified = (await parallel(findings.map((finding) => () =>
  agent(`Try to disprove this finding: ${finding.claim}`, { schema: VERDICT })
))).filter((verdict) => verdict?.holds);

return agent(`Write the report from these verified findings: ${JSON.stringify(verified)}`);

Two rules: wait for all results only when you truly need all of them; otherwise let each result flow directly into the next step. Tier the models: cheap models run the fan-out, and the strongest model runs verification and merging. Rey added one line in the tweet: anyone can build an agent, but almost no one builds the graph that runs them.

Most people are still at level one

A comment in the replies said: The graph is the (new) moat. That line is worth remembering. A new model lands every few weeks, but the levels do not change. Each level wraps the next one, so what you learn now will not become obsolete when the next version ships. A prompter writes sentences; a level-5 engineer writes the shape of the work, and the sentences write themselves.

Five things you can do this week:

  1. Prompt: Delete every you are an expert from your most-used prompts and replace them with one good output example.
  2. Context: Write a one-page project file: rules, tech stack, decisions, completion status. Load it before every meeting and count how many fewer corrections you make.
  3. Harness: Add the Stop hook above so the agent cannot declare completion when tests fail.
  4. Loop: Put a /loop on your backlog or inbox, with a budget and a state file; run it overnight and read the state in the morning.
  5. Graph: Build a minimal diamond: split one review into multiple files, fan out in parallel, have an agent that doubts everything challenge each finding, and merge the survivors into a report.

发布时间: 2026-11-20 13:00