A short course for people who already ship code

“Agent” is one loop.
Everything else is vocabulary.

If you use a coding agent like Codex CLI or Claude Code daily, you already operate a harness, drive an agentic loop and do context engineering. Nobody hands you the words for any of it. This page gives you the words, attached to the mental model that makes them stick. Click any node in the loop to jump to its lesson.

THE HARNESS MODEL reads context, proposes next step TOOL CALL "run pytest", "edit main.py" EXECUTE sandboxed, maybe approved CONTEXT WINDOW the model's entire working memory results feed back in → loop repeats until the task is done or the agent gives up
fig. 1, the whole field in one diagram. everything inside the dotted line is the harness. every term in this course points at part of it.
Lesson 00 · The one-sentence model

An agent is a model in a loop with tools

Strip away the marketing and the entire field reduces to one sentence:

agent
An LLM that runs in a loop, choosing and invoking tools (run a command, edit a file, search the web), observing the results, and continuing until a goal is met, rather than producing one answer and stopping.

That's it. A chat model answers once. An agent acts, observes, and acts again. The loop is what changed between 2023-era "paste your stack trace into ChatGPT" and today's "fix the failing tests" typed into a terminal.

Three components, three families of jargon:

Every remaining lesson is just zooming in on one box of fig. 1.

Lesson 01 · The dotted line in fig. 1

Harness: the software you're actually running

harness
The program wrapped around the model that runs the loop: it builds the prompt, defines the tools, executes the model's tool calls, feeds results back, manages the context window, and enforces safety policy. Codex CLI is a harness. So are Claude Code, Cursor's agent mode, and Aider.

This is the most under-explained word in the field, and the most important one to get straight, because when you invoke an agent, the model is maybe 80% of the outcome and the harness is the other 20%, and the 20% is what differs between products. The same model in two different harnesses behaves like two different developers.

What the harness does on every single turn

# one turn of the loop, from the harness's point of view
→ send  system prompt + AGENTS.md + history + tool menu
← recv  tool_call: shell{ cmd: "pytest tests/ -x" }
→ run   (in sandbox, per approval policy)
→ send  tool_result: "FAILED tests/test_auth.py::test_expiry ..."
← recv  tool_call: apply_patch{ file: "auth/tokens.py", ... }
... repeat until model replies with plain text instead of a tool call

You'll also hear scaffold / scaffolding: an older, looser synonym from the research world, and agent framework (LangChain, LangGraph, the OpenAI Agents SDK), libraries for building your own harness rather than using a packaged one.

why "harness"? Borrowed from "test harness": the fixture that holds a component and drives it through its paces. Same idea: the model is the engine, the harness is everything that holds it, feeds it, and keeps it from flying off the bench.
Lesson 02 · The adjective

"Agentic" is a spectrum, not a switch

agentic coding
A workflow where you delegate a goal ("make the failing CI job pass") rather than dictate steps, and the system autonomously plans, edits, runs, and iterates, with you reviewing outcomes instead of keystrokes.

"Agentic" measures how much of the loop runs without you in it. The industry climbed this ladder in about four years:

RungWhat it isWho holds the loop
autocompleteCopilot-style ghost text; predicts your next linesYou, entirely
chatQ&A about code; you paste results back manuallyYou are the harness
agentic (supervised)Codex CLI / Claude Code in a terminal: it edits and runs, you approve and steerShared
agentic (delegated)Background/cloud agents: hand off a task, get back a PRThe agent; you review the diff

Note the third row: in chat-era workflows you were the harness: you ran the commands, copied the errors, pasted them back. Agentic tooling automated you out of the plumbing, not out of the judgment.

Related terms that live on this ladder: autonomy (how far it goes before checking in), human-in-the-loop (any checkpoint where you approve or redirect), headless (running the agent non-interactively, e.g. codex exec in a CI job, no human in the loop at all).

Lesson 03 · The verbs

Tools, tool calling, and MCP

tool calling (a.k.a. function calling)
The protocol that lets a model act: the harness sends the model a schema of available functions; the model replies with structured JSON ("call shell with cmd=pytest") instead of prose; the harness executes it and returns the result as a new message.

Two things senior devs usually find clarifying:

MCP, Model Context Protocol
An open standard (originated by Anthropic, now adopted broadly, including by Codex) for packaging tools and data sources as servers that any compliant harness can plug in. Think "USB-C for agent tools": write a connector once, GitHub, Postgres, your internal ticket system, and every MCP-aware agent can use it.

Before MCP, every harness had bespoke integrations. After MCP, tools are portable: the same MISP or Slack connector can serve Codex CLI today and a different harness next year. When you edit config.toml to add an [mcp_servers] entry, you are extending the tool menu from Lesson 01.

disambiguation "Tool use", "function calling", and "actions" are the same mechanism under different brand names. MCP is not a competitor to tool calling. It is a standard packaging format for tools.
Lesson 04 · The working memory

Context: the window, and the engineering of it

context window
The fixed number of tokens the model can attend to in a single call, its entire working memory. Everything the agent "knows" right now (instructions, code it has read, test output) must fit inside it. Nothing persists between calls except what the harness re-sends.

This is the constraint that shapes everything. The model has no memory, no filesystem, no state. The harness reconstructs its world every single turn. Which makes the central craft of the field:

context engineering
Deciding what goes into the window: which files, which docs, which history, in what form. The successor term to "prompt engineering", less about magic phrasing, more about information logistics.

You already do this. Every time you write an AGENTS.md (or CLAUDE.md in that harness), build commands, conventions, "never touch the migrations", you are doing context engineering: front-loading knowledge the agent would otherwise burn turns rediscovering. Terms in this family:

Lesson 05 · More loops

Subagents and orchestration

subagent
An agent spawned by an agent: the parent delegates a scoped task ("find every caller of this function") to a child loop with its own fresh context window, and gets back only the conclusion.

The motive is Lesson 04's constraint. Exploring a large codebase might chew through 100k tokens of reading; if a subagent does the exploring, the parent's window receives a 500-token summary instead of the whole excursion. Subagents are context isolation, not (primarily) parallelism, though harnesses increasingly run them in parallel too.

Adjacent vocabulary: orchestrator / orchestration (the parent agent, or a workflow engine, coordinating multiple agents), multi-agent system (several specialized agents, planner, coder, reviewer, collaborating), handoff (one agent passing control to another). Useful skepticism: multi-agent designs add real coordination overhead, and a strong single agent with good tools often beats a committee of weak ones. The pattern earns its keep on wide, decomposable tasks.

Lesson 06 · The execute box

Sandboxes, approvals, and permissions

An agent that can run arbitrary shell commands is an agent that can run rm -rf, exfiltrate your env vars, or obey a malicious instruction hidden in a README it read (that last one is called prompt injection: structurally it is untrusted input reaching an interpreter). So every serious harness layers guardrails around the EXECUTE box:

The clean way to hold it: the model proposes, the harness disposes. Capability lives in the model; authority lives in the harness config, which is why that config, not the model card, is the security boundary you should actually review.

Lesson 07 · Keeping score

Evals and benchmarks

eval
A repeatable test of model-or-agent behavior: a task set plus a grading method. The unit test of the AI world, and like unit tests, the ones you write for your workflows matter more than the public ones.

Public benchmarks you'll see quoted: SWE-bench (Verified): real GitHub issues from real repos; the agent must produce a patch that passes the repo's own tests; the de-facto standard for agentic coding. Terminal-Bench: tasks done purely in a shell. Older ones like HumanEval (single-function generation) are effectively saturated and tell you little about agents.

Two caveats worth carrying: benchmark scores measure a model + harness + prompt combination, not the model alone; and public benchmarks leak into training data over time (contamination), so treat headline numbers as directional. The professional move, the same one you'd make for any vendor claim, is a small private eval: ten tasks from your own backlog, run against each candidate setup.

Reference

The glossary, one line each

TermOne-liner
agentLLM + loop + tools, pursuing a goal until done.
agenticAdjective for workflows where the system, not you, runs the loop.
harnessThe software around the model: prompt assembly, tool execution, context management, policy. Codex CLI is one.
scaffoldResearch-world near-synonym for harness.
tool / function callingModel emits structured JSON requesting an action; harness executes and returns the result.
MCPOpen standard for packaging tools as portable plug-in servers.
context windowThe model's entire, fixed-size working memory per call.
context engineeringThe craft of choosing what fills the window.
compactionHarness summarizes old history to free window space.
RAGRetrieving relevant content into the window on demand.
AGENTS.mdRepo-level standing instructions the harness auto-loads (CLAUDE.md in Claude Code).
system promptHarness-authored instructions that outrank everything else.
subagentChild agent with a fresh window; returns a summary, protecting the parent's context.
orchestrationCoordinating multiple agents or agent steps into a workflow.
human-in-the-loopAny designed checkpoint where a person approves or steers.
headlessAgent running non-interactively (CI, scripts), no human in the loop.
sandboxOS-level confinement of what the agent's commands can touch.
approval modePolicy for when the harness pauses to ask you.
prompt injectionMalicious instructions in content the agent reads; untrusted input reaching the loop.
evalRepeatable task set + grader for measuring agent behavior.
SWE-benchBenchmark: fix real GitHub issues so the repo's tests pass.
Self-check

Five questions, no grades on file

1. In one turn of the loop, who actually executes pytest?

The model only ever produces text. The harness recognizes the tool-call format, runs the command (per sandbox and approval policy), and feeds stdout back in.

2. Codex CLI and Claude Code are best described as…

Both wrap a model with a loop, tools, context management, and policy. The model is a component they call.

3. The main reason to spawn a subagent is…

A child loop burns its own context on exploration and hands back only a summary. Parallelism is a bonus, not the point.

4. Writing a good AGENTS.md is an act of…

You're pre-loading the window with knowledge the agent would otherwise spend turns rediscovering, pure information logistics.

5. "The model proposes, the harness disposes" means the real security boundary is…

Capability lives in the model; authority lives in harness policy. Review the config like you'd review any privileged service account.