Terminal-Bench

An AI agent sits at a blank terminal with a job: rebuild an old program, train a model, break a puzzle. Terminal-Bench 2.0 sets 89 such jobs. The best agent finishes 62.9% of them, so over a third stay out of reach.

Learn how a benchmark for agents that work in a terminal is built, checked, run and read, and what the failures teach.

Tap an agent below and watch how many of the 89 jobs it resolves, meaning it passes every test for that job. Notice the error band. Then we build, piece by piece, everything underneath: the task, the tests, the audit, the agent loop, the scores and the ways agents fail.

You need a feel for what a command line is (a place where you type commands and read text answers) and a little Python for the code. We build the rest from zero.

Based on Terminal-Bench: Benchmarking Agents on Hard, Realistic Tasks in Command Line Interfaces (arXiv 2601.11868, January 2026) by Mike A. Merrill, Alexander G. Shaw and dozens of co-authors from Stanford, the Laude Institute and many other groups. Every idea is re-taught here in our own words and devices. It is a reading of CS 329Z Lecture 10, Terminal-Bench.

Resolve the 89 tasks

Rates and error bars are the paper’s (Figure 1 and Table 2 of arXiv 2601.11868). Each rate is an average over at least five runs of every task. Which dots are filled is illustrative: the grid shows how many tasks, not which ones.

Chapter 0

Why Another Benchmark

See why a hard, realistic benchmark of terminal work was missing, and what this paper builds to fill the gap

Picture a developer at a laptop. A build fails. She opens a terminal, types a command, reads the error, types another command, and ten minutes later the build works. No mouse. No pictures. Only text going in and text coming out.

Now picture an AI agent doing the same job. It gets the same terminal. It types a command, reads the same error text, and decides what to type next. This is how many popular coding agents work today. The paper names Cursor, Codex CLI, Claude Code and Gemini CLI. They run commands such as grep, find and cat, or call custom tools that search the web, edit files or run code.

So here is the question this paper asks. How do you measure whether such an agent is good at real terminal work? Not on a toy puzzle. On the kind of job a skilled engineer is paid to do.

What a benchmark is, and why it can run out

A benchmark is a fixed set of tasks with a fixed way to score them. You run an agent on the tasks, count how many it gets right, and compare that number across agents. It works like an exam. Everyone sits the same paper, so the marks can be compared.

An exam only helps while it has headroom: room between the weakest and the strongest student. If every student scores 98%, the exam cannot say who is better. Agents improve fast, so benchmarks that were hard a year ago can become saturated, meaning the top scores are packed against the ceiling. The paper says this is the gap it targets. Current benchmarks, it argues, either do not measure real-world tasks or are not hard enough to measure frontier models.

Try it with a toy. Two exams, one easy and one hard. Slide the agent’s skill up. Then look at how much each exam’s score moves when the agent gets ten points more skilled.

Find the headroom

Each curve is the score an agent of a given skill earns on one benchmark. The teal marker is your agent. The teal dot is the same agent after ten more points of skill. Drag the skill and compare the two jumps.

60

Illustrative: both curves are made-up S-shaped curves (the easy one centred at skill 25, the hard one at skill 80) to show saturation. They are not data from the paper, which reports that frontier agents score under 65% on Terminal-Bench 2.0.

At low skill the easy exam still separates agents. At high skill its curve is flat, so a real improvement barely moves the score. The hard exam does the opposite. That is exactly what the authors want from Terminal-Bench 2.0: frontier agents sit in the middle of the curve, where progress still shows.

What the paper builds

The paper makes three things. First, Terminal-Bench, a framework for writing terminal tasks. Second, Terminal-Bench 2.0, a set of 89 tasks written by people and checked by hand. Third, a study of 16 models and six agents, with an error analysis that says why agents fail.

Each task has four parts. A container is a sealed, disposable computer-in-a-box with the right software and files. An instruction says what to do. A set of tests checks the result. A reference solution proves the task can be done. Tasks range from training a machine learning model, to building and running Linux from its source code, to reverse engineering a binary file. Chapter 1 opens one up.

The headline result is short. Frontier models and agents resolve less than 65% of the 89 tasks, and smaller models score around 15%. The hero at the top of this page showed the top of that range.

How it differs from its neighbours

The paper lists related work in four groups. Software engineering benchmarks such as SWE-Bench ask an agent to fix real code issues. Tool-use benchmarks such as τ-Bench test calls to fixed tools. Computer-use benchmarks such as WebArena and OSWorld test browsing and desktop control. Science benchmarks test research tasks. Terminal-Bench stands apart in two ways. Its tasks are diverse and long, and they come from experts. And they run in a real shell, not a made-up environment.

Our agent evaluation lesson covers the general craft of scoring agents. This lesson shows one benchmark done carefully, from the first task to the last error bar.

The road

  1. A task is a container and a test: the four parts, and why tests read the final state.
  2. Trust the tests: specificity, solvability and integrity, and the audit that enforces them.
  3. Choosing the hard tasks: 229 become 89, and difficulty is measured two ways.
  4. The agent loop and Terminus 2: keystrokes in, screen out, and context summaries.
  5. Reading the scores: the main table, error bars, and model against agent.
  6. Cost, turns and tokens: what a run costs and what more effort does not buy.
  7. How agents fail: execution, coherence and verification errors.
  8. Command errors and limits: failed commands, and the authors’ own caveats.
  9. Field guide: numbers, a checklist, the core loop as code.
An old benchmark now shows every top agent between 96% and 99%. What is the main problem for researchers?

Chapter 1

A Task Is a Container and a Test

Open one task and see its four parts, and why the tests look at the final state instead of the commands

You hire a contractor to rebuild a kitchen. At the end you do not ask which hammer she used. You walk in and check: do the taps run, does the oven heat, do the cabinets close? You judge the result. Terminal-Bench judges agents the same way.

That choice shapes the whole benchmark, so this chapter opens one task and looks at every part.

Four files and a clock

A Terminal-Bench task is a small folder. It holds an instruction, a Docker image, a set of tests, an example solution and a time limit. A Docker image is a recipe for a sealed machine: which operating system, which programs, which files. Running the image gives a container, a fresh copy of that machine for one attempt. When the attempt ends, the container is thrown away, so one agent’s mess never reaches the next.

task/
  task.yaml       # the instruction, difficulty, category, time estimates, time limit
  Dockerfile      # builds the container the agent works in
  tests/          # pytest checks, run after the agent stops
  run-tests.sh    # installs test tools and runs tests/
  solution.sh     # the oracle: a human-written way to pass every test

The agent sees only two things: the instruction and the container. It does not see the tests or the solution. The paper’s running example is a COBOL job. The instruction reads: re-implement the COBOL program in /app/src/program.cbl in Python, and your script must produce identical results to the COBOL baseline. COBOL is an old business language, so this is the kind of legacy work the authors call realistic.

Tests that look at the end state

Now the key design choice. After the agent stops, the harness copies the tests into the container and runs them. The paper states the rule directly: the tests check properties of the final container state. They do not test the agent’s commands or its console output. The authors call this outcome-driven, and say it is intentional because each agent should be free to reach the goal by different routes.

Look at the example in the paper’s Figure 2. Three tests ran. test_required_files_exist passed. test_data_files_exist failed with “File not found: BOOKS.DAT”. test_program_output failed with “Account balance mismatch”. The summary line reads: 1 passed, 2 failed. A task counts as resolved when the checks pass, so this attempt did not resolve it. We can write that rule in one line.

resolved(t)
One if task t is solved in this attempt, zero if not. It is the only score an attempt earns.
∧j
“And” over all tests j. Every test must pass. One failed test makes the whole attempt a fail.
testj
One check, written in pytest (a Python test tool). It returns pass or fail. Example: does BOOKS.DAT exist?
sfinal
The container as the agent left it: files, running programs, settings. Nothing else is looked at.

The data flow is plain. In: an instruction string and a container. During the attempt: the agent sends a command, the container returns text. Out: a final state. Then the tests turn that state into a list of passes and fails. Try it below with four different agents on the COBOL task, and switch between the two ways of grading.

Grade the route or the result

Pick an agent’s attempt, then flip between grading its final state and grading its commands. Watch which attempts pass under each rule.

Illustrative: the four attempts and the route checker are invented to show the idea. The task, its instruction and the three test names come from the paper’s Figure 2. The “route checker” here insists that cobc ran, which is exactly the kind of test Terminal-Bench avoids.

Outcome grading accepts both honest routes and rejects the dummy and the buggy port. The route checker does the reverse in two places. It fails “Read only”, a perfectly good solution, and it passes “Buggy port”, a wrong one, because the buggy port ran the right command. Checking how checks the wrong thing.

Interactive, with a clock

Tasks are interactive. The agent must explore the container, call tools such as an editor or a Bash command, and decide what to try next. It has a time limit. Tasks are written in the Harbor task format and run with the Harbor harness, which the authors released. Harbor runs many containers in parallel (the study used between 32 and 100 on a sandbox service) and supports agents such as Claude Code, Codex CLI, OpenHands and Mini-SWE-Agent, plus the authors’ own Terminus 2 (Chapter 4). The 2.0 set runs with one line: harbor run -d terminal-bench@2.0.

Because the format is general, the authors also converted 26 existing benchmarks into it, using small translators they call adapters (the paper’s Appendix D). A task format that fits so many sources is a sign that “instruction, container, tests” is the right unit.

An agent solves a task by an unusual route, but the final container passes every test. What does Terminal-Bench record?

Chapter 2

Trust the Tests

Check a task three ways, so that a pass means the work was done and a fail means the agent fell short

A teacher marks an exam and a student scores 40%. Was the student weak? Or did the question ask for “an essay” while the marking guide wanted “exactly three paragraphs”? If the exam is unfair, the mark tells you nothing. A benchmark has the same weak spot, and the authors say validating the tasks was “extremely difficult”.

So before any model ran, every task had to earn trust. The paper sets three standards.

Specificity, solvability, integrity

Specificity means the tests pass if and only if the container ends in an acceptable state. The instruction must describe every correct end state. The tests must capture every correct end state. Solvability means it is possible to pass. Each task has an oracle solution, a script that mirrors a real workflow and, when run, makes every test pass. Integrity means an agent cannot cheat with a shortcut that would not exist in real work. The paper’s example: if a task edits a git repository at a commit, all later commits must be removed, or the agent could peek at the future.

Specificity is the subtle one. It is an “if and only if”, so it can break in two directions.

∀j: testj(s) = pass
“For every test j”, the test passes on the final state s. This is the machine side: what the harness sees.
acceptable(s)
A human would agree the work is done. This is the real side: what the instruction asked for.

Read the arrow left to right. If it fails, the tests pass work that is wrong (a false pass). Read it right to left. If that fails, the work is fine but a test rejects it (a false fail). A false fail usually means the tests demand something the instruction never said, such as an exact file name.

The audit pipeline

The authors built a pipeline with two phases, shown in the paper’s Figure 3. Before a task is merged into the repository:

  1. Contributor submission. The author completes a checklist: run agents on the task, check test coverage, block exploits, confirm it reproduces.
  2. Automated checks. Continuous integration (CI) runs deterministic checks. The oracle must pass. A no-op dummy agent, one that does nothing, must fail. A language model reviews the code.
  3. Expert human review. Experienced reviewers work with the contributor.

After a task is merged:

  1. Model experiments. Strong models run every merged task, and the transcripts are saved.
  2. Manual trajectory audit. Auditors read runs. If a model fails, they ask: is this a real lack of skill, or a flaw in the task?
  3. Adversarial exploit audit. An agent tries to cheat. A person inspects what it found.
  4. Final decision. Accept, flag for revision, or reject.

The effort was large. The three reviews gave each task about three hours of combined reviewer time, which the authors say adds up to multiple hundreds of person-hours, not counting the time to write the tasks.

The tools behind the audit

Some checks are plain code. A canary check confirms a special string is in every file. The Big-Bench canary string tells model builders to keep this data out of training sets. Other deterministic checks make sure the Dockerfile does not copy in the tests or the oracle, must not pin apt packages (old versions can vanish), and that no container runs with dangerous privileges.

Some checks use a language model. They ask whether every behaviour the tests check is described in the instruction, and whether every behaviour described is tested. They also check for typos in file names, pinned Python dependencies, and a hardcoded solution, an oracle that just echoes the final answer instead of computing it.

A debug tool reads failed runs and decides whether the instruction was too thin. Its rule is neat. If every trial fails the same tests with similar errors, the spec is probably missing something. If trials fail in different ways, the difficulty is probably fair.

The adversarial exploit agent is an OpenHands agent told to act like a security researcher and cheat. It must use at least some cheating. The paper lists what it found: monkey-patching test environments, guessing answers, and generating every possible answer in the hope that tests check only that the right answer exists and not that wrong ones are absent. Try the audit on five toy tasks.

Audit a task

Choose a task. Four probes run against it: the oracle, a dummy that does nothing, a fair attempt that follows the instruction, and a cheater. Pink ticks are what a sound task would give. A red mark means the task is broken.

Illustrative: the five tasks and the probe results are invented to show each failure. The three standards, the dummy and oracle checks, the debug tool and the cheating agent come from Sections 2.3 and Appendix B of the paper.

Each flaw is caught by a different layer. The CI oracle run catches a broken oracle. The dummy check catches a weak test. The debug tool and the manual trajectory audit catch a hidden demand, because honest models keep failing the same test. The exploit agent catches a leaky history. No single check is enough, which is why there are many.

How the paper grades itself

The authors also scored the benchmark with the Agentic Benchmark Checklist (ABC), an outside rubric for agent benchmarks. Terminal-Bench scored 0.857 on outcome validity, 1.000 on task validity and 0.830 on benchmark reporting, an average of 0.896, second among existing benchmarks on the ABC leaderboard. They name the misses honestly. They use no objective metric for test quality. Some flakiness remains, since results can depend on hardware or on outside services. And all tasks are public, so the canary string is largely symbolic against intentional training on the data.

Honest models all fail the same test on one task. The test wants a file called output.csv, but the instruction only says “save to CSV”. Which standard is broken, and which tool is built to flag it?

Chapter 3

Choosing the Hard Tasks

Follow 229 contributed tasks down to 89, and learn how the paper measures how hard each one is

Suppose you want to test the best chess players in the world. You cannot use puzzles that a club player solves in a minute. You need hard, varied positions, and you need to know they are fair. The authors faced the same need for terminal work, and they chose to crowd-source it.

From 229 tasks to 89

The authors opened the project on GitHub and asked for contributions. 93 contributors created 229 tasks. Each author attached two estimates: how long a domain expert would need, and how long a junior engineer new to the topic would need. Each author also picked a category and a difficulty label, medium or hard.

Then the cut. The authors selected 89 of the 229 for the Terminal-Bench 2.0 set. They used two signals: the author’s difficulty assessment, and a quality assessment from three experienced human reviewers (Chapter 2). The set is small on purpose. Every task is checked by hand, and the authors prefer a smaller, trusted set to a larger, noisy one.

How long would a human take?

Table 1 of the paper gives the author estimates for 74 tasks. Look at the shape. For an expert, 36 tasks (48.6%) take under an hour and 35 (47.3%) take between an hour and a day. Only 3 (4.1%) take more than a day, and none take more than a week. For a junior engineer the picture shifts right. Only 6 tasks (8.1%) take under an hour, 53 (71.6%) take an hour to a day, 12 (16.2%) take one day to a week, and 3 (4.1%) take more than a week. Switch between the two below.

Time a human would need

Bars show how many of the 74 estimated tasks fall in each time range. Choose who is working, and watch the weight move to the right.

Counts and percentages are Table 1 of the paper (author estimates, so subjective). One task, fix-ocaml-gc, needs an expert almost a day and a junior engineer ten days (240 hours).

Two things stand out. Most tasks are not quick: about half need an expert over an hour. And the junior-versus-expert gap is large, which fits the benchmark’s aim of capturing skilled, domain-heavy work.

What the tasks are about

The paper’s Figure 4 counts tasks per category, as labelled by the authors. Software engineering is the largest, with a bar of 26 of the 89, and no category is a majority. Categories include system administration, data science, scientific computing, security, debugging, model training, mathematics, video processing, games and even personal assistant tasks. The paper notes that these non-engineering categories are present too. Some task names show the range: winning-avg-corewars asks for a Redcode warrior that wins battles, write-compressor asks for a file of at most 2,500 bytes that a given decompressor expands into the exact text, and vulnerable-secret asks the agent to extract a hidden key from a program by reverse engineering.

Hard for people, hard for models?

Author labels are opinions. The paper adds a measured difficulty. It defines empirical difficulty from results: for each task, count the share of frontier models for which the Terminus 2 agent resolves it.

d(t)
The empirical difficulty label of task t. It comes from what models did, not from what the author thought.
st
The share of the selected frontier models that Terminus 2 lets resolve task t. Worked toy: if 12 of 15 models solve it, s = 80%, so it is Easy.
33.3% and 66.7%
The two cut points: one third and two thirds. Toy: 7 of 15 models is 46.7%, so Medium.
Hard
Fewer than a third of models solve it. Toy: 3 of 15 is 20%, so Hard.

Now compare the two labels. The paper’s Figure 7 is a small table: for each human label, how the tasks fall across empirical labels. Counting Appendix H, the set has 30 tasks labelled hard, 55 medium and 4 easy by their authors. Pick a human label below.

Do models agree with the author?

Choose the difficulty the author gave. The bars show how those tasks turned out for models.

Percentages are Figure 7 of the paper (rows sum to 100%). The task counts are our tally of the difficulty labels in the paper’s Appendix H (30 hard, 55 medium, 4 easy); the four easy tasks are not in the figure. Counts in each bar are the percentage times the row size, rounded.

Hard labels hold up: 93.3% of them were empirically hard, only 3.3% medium and 3.3% easy. Medium labels do not: 54.5% turned out hard for models. The paper gives examples: break-filter-js-from-html (slip past an XSS filter) and winning-avg-corewars need creative or adversarial thinking, not pattern following. Human intuition about “medium” misses that. The overall correlation is r = 0.436 with p < 0.001. That is a clear but moderate link: the label helps, and it is far from perfect.

The paper defines a task as empirically Hard when Terminus 2 resolves it with fewer than 33.3% of the frontier models. What does that definition measure?

Chapter 4

The Agent Loop and Terminus 2

Watch an agent type keystrokes into a shell, read the screen, and survive a full context

Imagine two cooks entered in a contest. One brings her own knives, her own stove and a sous-chef. The other uses the kitchen tools provided. If the first wins, did she cook better, or did she bring better gear? The paper hits this problem when it compares AI models.

Why a neutral agent

An agent is a language model plus the program around it, called a scaffold (or harness). The scaffold decides which tools the model can call, how it shows results and how it handles long jobs. Many scaffolds are tuned to the habits of one model, especially when the same company builds both. Worse, popular agents are installed into the container and bring tools that are whole programs, far more complex than one Bash command. So a score mixes the skill of the model with the cleverness of the scaffold.

The authors answer with their own scaffold, Terminus 2. It is built as a neutral testbed to compare models. It has one tool: a headless terminal. It finishes tasks using only Bash commands. Nothing else.

The loop

The loop is simple. The model writes text that Terminus 2 treats as keystrokes, the keys a person would press. Terminus 2 sends them into a tmux session inside the Docker container. (tmux is a program that holds a terminal screen so another program can read it.) After the keys run, Terminus 2 captures the screen, the paper calls it the captured pane, and gives that text back to the model. The model reads it and writes the next keystrokes. Calls to the model go through a library called LiteLLM, which lets one loop talk to many providers.

Because everything is keystrokes, the model has full freedom. To write a script into a file it can echo the text straight in, or it can open an editor such as vim and type. It can scroll, press arrow keys to move through a menu, and open extra shells. Dedicated agents give the model an “edit file” tool instead. Terminus 2 gives it none, and lets the model choose.

When the context fills up

Every command and every screen is added to the context, the text the model reads on each turn. A model can only read so much (its context limit). Hard tasks can run past it. The paper reports trials using almost 100 million tokens. So Terminus 2 adds a context summarization step. When the context reaches the limit, it asks a language model to condense it. The prompt starts: “You are about to hand off your work to another agent. Please summarize what you’ve done so far.” The loop then continues from the short note, which lets the agent work on tasks that need millions of tokens.

Step through a toy run. Change the context limit and see when the hand-off happens.

Step the agent loop

Press Step to run one turn: the model types keys, the container answers with a screen. The tall bar is the context. When it reaches the dashed limit, the agent writes a hand-off note.

12k tokens

Illustrative: the eight commands, the screens and the token counts are invented to show the mechanics (the COBOL job is the paper’s running example). The loop of keystrokes, a tmux pane inside Docker, a captured pane and a summarization hand-off is the paper’s Figure 34 and Appendix F.

Lower the limit and the hand-offs come sooner. Each hand-off throws away detail, which is a trade. A small context keeps each model call cheap and fast but risks forgetting a fact. A large one keeps the facts and costs more per call.

The six agents, the models and the harness

The study runs six agents: three vendor command-line agents (Claude Code, Codex CLI, Gemini CLI) and three open-source software engineering agents (OpenHands, Mini-SWE-Agent, Terminus 2). It uses 16 frontier models, from closed ones such as GPT-5.2, Claude Opus 4.5 and Gemini 3 Pro to open-weight ones such as Kimi K2 Thinking and GLM 4.6. Each vendor agent runs only with its own company’s models. Models with an adjustable reasoning effort use the provider default, which is “medium” for Anthropic and OpenAI. Closed models are called through first-party APIs and open-weight ones through Together.AI.

For every supported model and agent pair the benchmark runs at least five times. That gives 32,155 trials in total, where a trial is one agent’s attempt at one task. The runs used the Harbor harness on a sandbox service called Daytona, with 32 to 100 containers at once.

Here is the loop as code. This is our sketch of the idea, not the authors’ source.

def run_trial(instruction, container, llm, limit, max_secs):
    history = [SYSTEM_PROMPT, instruction]
    while time_left(max_secs):
        keys = llm(history)                     # text in, keystrokes out
        screen = container.tmux_send(keys)      # run them, capture the pane
        history += [keys, screen]               # both grow the context
        if tokens(history) >= limit:
            note = llm(history + [HANDOFF_PROMPT])
            history = [SYSTEM_PROMPT, instruction, note]
        if finished(keys):
            break
    return container.run_tests()                # graded on the final state
Why did the authors build Terminus 2 instead of only reporting each company’s own agent?

Chapter 5

Reading the Scores

Read the headline table with its error bars, and find out whether the model or the agent matters more

Two runners finish a race. One takes 61.2 seconds and the other 61.4. Who is faster? On one race you cannot tell, because a gust of wind could flip the order. You would race them many times and look at how much the times wobble. An agent benchmark has the same problem, and the paper handles it with repeated runs and error bars.

What a score is

The score is the resolution rate: the share of tasks the agent resolves, averaged over repeated attempts. For each pair of agent and model, the benchmark runs every task at least five times. A model that is lucky on one run and unlucky on the next averages out.

R
The resolution rate for one agent and model pair. A number from 0 to 1, shown as a percentage.
1 / |T|
One divided by the number of tasks, 89 here. It turns a sum into an average over tasks.
∑t∈T
Add up over every task t in the set T.
1 / K
One divided by the number of runs of each task. K is at least 5.
resolved(t, k)
One if run k of task t passed every test (Chapter 1), else zero.

Take the counts. Table 2 lists 55 pairs of agent and model, and the study ran 32,155 trials in total. That is about 585 trials per pair, or about 6.6 runs of each of the 89 tasks. So 62.9% means: averaged over those runs, about 56 of the 89 tasks resolved.

The headline numbers

Codex CLI with GPT-5.2 has the highest average at 62.9%. Terminus 2 with Claude Opus 4.5 follows at 57.8%, and Terminus 2 with Gemini 3 Pro at 56.9%. Proprietary models fill the top 13 places. The best open-weight result is Terminus 2 with Kimi K2 Thinking, at 35.7% (plus or minus 2.8) on average, which the paper rounds to 36%. Smaller models score near 15%. The paper also notes that state-of-the-art performance nearly doubled in the eight months between Gemini 2.5 Pro and GPT-5.2.

Every score carries a 95% confidence interval, the error bar in the paper’s Figure 1. The paper reports it without a long derivation. Read it as a plausible range. If the bars of two agents overlap, the data cannot cleanly say which is better. The top two scores are 62.9% ± 3.0 and 57.8% ± 2.5, whose bars just touch, so even first place is closer than the bare ranking suggests.

Model or scaffold?

This is the question Terminus 2 was built to ask. The paper’s claim: model choice is usually more important than the agent scaffold. It offers two numbers. Codex CLI’s rate climbs by 52% when it uses GPT-5.2 in place of GPT-5-Nano. Gemini 2.5 Pro gains 17% when paired with Terminus 2 instead of OpenHands. The big swing comes from the model; the scaffold swing is smaller, though not zero.

Table 2 lets you see both effects directly. Choose a view below.

Change the agent or the model

Bars are resolution rates from Table 2, with the 95% interval as a teal band. In the first view the model is fixed and the agent changes. In the second view the agent is fixed and the model changes.

Values are the paper’s Table 2 (resolution rate and 95% interval); The lowest-scoring pairs in the table are not shown, so the model-change view understates the full spread.

Changing the agent for one model moves the score by about 6 to 9 points. Changing the model under Terminus 2 moves it by more than 20 points even among the six models shown, and the full spread is larger. The model matters more here. Even so, 9 points is large: it drops GPT-5.2 from first place to fourth.

What the scores do not say

Some tasks are not solved by any agent. And the scaffold column hides a choice: each model’s score in Figure 1 comes from the scaffold that maximised its performance, so Figure 1 is a best-case view per model. Be careful when reading a rank as a statement about the model alone.

Think about what this means for a team that picks an agent. If you only compare vendor agents, you cannot tell whether the model or the harness did the work. Terminus 2 holds the harness fixed, so a gap between two rows of the Terminus 2 column is a gap in the models. Rows from different agents mix both effects, and the paper’s own Figure 1 uses the best scaffold per model, so treat it as a ceiling, not a fair fight.

Agent A scores 57.8% ± 2.5 and agent B scores 56.9% ± 2.5. What is the fair reading?

Chapter 6

Cost, Turns and Tokens

See what a run costs, and why more turns and more tokens do not buy more resolved tasks

A mechanic who works twice as long on your car is not twice as good. A student who writes twice as many pages is not twice as right. We know this in daily life. Do agents behave the same way? The paper checks, and the answer is mostly yes.

What a run costs

Running the whole benchmark once costs between about one dollar and one hundred dollars, depending on the model’s price per token. A token is a small piece of text, roughly a short word or part of one. The model is billed for the tokens it reads and the tokens it writes. The paper’s Figure 5 plots cost on a log scale from $0.1 to $1000 against resolution rate for every agent.

Most attempts are short. In Figure 10, most trials finish in under 20 minutes, use fewer than 25 model calls and fewer than 10 million tokens. But the tail is long. Some attempts run for two hours, make hundreds of model calls and burn almost 100 million tokens on one task. That tail is why Chapter 4’s context summarization exists.

The Pareto frontier

To compare cost and score together, the paper draws a Pareto frontier. The idea is plain. Agent A dominates agent B if A is no more costly and no less accurate, and is strictly better on at least one. The frontier is every agent that nothing dominates.

A ≻ B
“A dominates B.” Nobody would pick B over A, since A is at least as good on both counts.
cost
Anything you pay: dollars, tokens, minutes or turns. Lower is better.
score
Resolution rate. Higher is better.

Now the surprise. Intuition says that an agent that tries more turns and writes more text should solve more tasks. The paper tests it. The appendix computes the average number of turns (it calls each one an episode) for each model under Terminus 2, and compares it to the model’s success rate. The correlation is r = −0.028 with p = 0.916. A correlation r runs from −1 to 1; zero means no straight-line link. The p-value says how often a link this strong would show up by pure chance if there were none. At 0.916, chance explains it easily. So there is no sign that more turns buy more success.

The paper gives named examples. GPT-5 Codex leads with about 44% success at about 10 episodes per trial. Claude Sonnet 4.5 reaches about 43% with 22 episodes. GPT-5 gets about 35% with only 7. At the other end, Qwen 3 Coder 480B and GLM 4.5 Air use about 35 episodes yet reach only about 24%. Plot them yourself and look for the frontier.

Find the frontier

Each dot is a model under Terminus 2: turns per trial across, success rate up. Tap a dot to see what dominates it. Switch on the frontier to see the dots that nothing beats.

The five points use the values the paper quotes in Appendix G.1 (“about” 44%, 43%, 35%, 24% and 24%, and about 10, 22, 7, 35 and 35 episodes). The paper does not print exact values for them. The frontier is computed here with the rule above, using turns as the cost.

Two points land on the frontier: GPT-5 and GPT-5 Codex. The other three are dominated. Claude Sonnet 4.5 is a close call, since it scores 43% against 44% but takes more than twice the turns. The two models near 35 episodes are dominated by everything.

Tokens tell the same story

The same appendix compares average output tokens with success. The link is weak and negative: r = −0.170, p = 0.515. Claude Sonnet 4.5 and Claude Opus 4.1 reach top-tier success rates (about 43% and 38%) with moderate token use. GPT-5-Nano writes the most by far, about 60 thousand tokens on average, and resolves only about 8%. The authors read this as a sign that long output can mean wandering, not care.

Their conclusion, which we can keep: skill shows up as better decisions inside each turn, not as more turns or more words. For anyone building agents, that points at the quality of each step, and not at raising a turn limit.

One caution. With only 16 models, a correlation of −0.17 cannot be told from zero. The honest statement is narrow: in this data, more effort did not predict more success. It does not prove that effort never helps inside a single model.

Model X scores 44% in 10 turns per trial. Model Y scores 24% in 35 turns. In the paper’s terms, what is the relation?

Chapter 7

How Agents Fail

Sort failed runs into execution, coherence and verification errors, and see how the labels were checked

A student gets 40% on an exam. The teacher could write “try harder”. A better teacher reads the paper and writes: “you ignored the question’s format, you contradicted your own step 3, and you never checked your answer.” The second note tells the student what to fix. The paper does this for agents.

Building the labels

Counting failures is not enough. The authors want to know how agents fail, so model builders know what to improve. They start from the Multi-Agent System Taxonomy (MAST), a list of failure types from earlier research on multi-agent systems. Terminal-Bench uses one agent in a terminal, so many MAST labels do not apply. They drop “conversation reset”, “information withholding” and “ignored other agent’s input”, which need several agents. They merge “disobey task specification” with “disobey role specification”, since a terminal run has no explicit roles. They also drop “fail to ask for clarification”, since the setup does not allow questions.

What remains is nine failure modes in three classes. Each class has a plain question behind it.

ClassFailure modeWhat the agent did
Execution
Did it do what was asked?
Disobey specificationContradicted an explicit directive: a required method, a source of truth, a constraint or an output location.
Step repetitionRe-ran the same phase again and again with no change of strategy.
Unaware of terminationKept acting after clear success or clear futility.
Coherence
Did it stay consistent?
Reasoning-action mismatchClaimed one thing (“tests passed”) while its own logs showed another.
Context lossForgot or contradicted recent facts about files, errors or its own plan.
Task derailmentDrifted from the goal into irrelevant work.
Verification
Did it check its work?
Premature terminationDeclared success before the objectives or the checks were met.
No or incorrect verificationMarked the task done with no real check of the final result, or ignored a failing check.
Weak verificationChecked something that misses what matters, sometimes making up data it should have derived.

These are the paper’s Appendix C.1 definitions, shortened. Each mode has its own written rubric with a framing, a decision procedure and exclusion rules, so two annotators can tell the modes apart. Try labelling some made-up failures yourself.

Label the failure

Read each short failure story. Pick the class that fits best. The answer names the exact mode.

Illustrative: the seven stories are invented to match the paper’s definitions in Appendix C.1. They are not real traces from the study.

Who did the labelling

Humans cannot read thousands of long traces. So the pipeline mixes machines and people. For each task the authors sampled two failed trials per model, all from Terminus 2 for a consistent setting. They used a trace-analysis tool called Docent, which summarizes, clusters and searches agent transcripts, plus a custom pipeline that collected labels from two human annotators. A language model, GPT-5 in high-reasoning mode, served as the main judge.

The authors measured how far to trust the labels. On a calibration set of 20 trials, the two annotators agreed with a Cohen’s κ of 93%. Cohen’s kappa is agreement with the lucky matches removed. If two people guess among three labels, they match a third of the time by chance. Kappa asks how far above that they are.

κ
Agreement beyond chance. One is perfect; zero is no better than guessing.
po
The share of items where the two labellers matched. Toy: they match on 19 of 20, so 0.95.
pe
The share they would match by chance. Toy: with three equally likely labels, one third, 0.333.
1 − pe
The most agreement beyond chance there could be. It scales the answer to run up to one.

The toy numbers give (0.95 − 0.333) / (1 − 0.333) = 0.925, close to the paper’s 93%. The toy is illustrative; the paper gives only the result. Next the judge was compared with 120 traces labelled by people. It agreed on 90% of them, with 92% precision and 90% recall. Precision asks: of the labels the judge gave, how many were right? Recall asks: of the true labels, how many did the judge find?

What the failures look like

The paper’s Figure 8 shows the mix for three models. For the two closed frontier models, Claude Opus 4.5 and GPT-5.2, execution errors dominate and coherence and verification errors are less common. The open-weight model, Qwen Coder, has a more balanced pattern with more errors of every kind. The authors draw a practical lesson. A model with mostly execution errors may gain most from stricter adherence to instructions. A model with errors spread across classes needs better consistency and self-monitoring. Different models need different fixes.

Notice what this taxonomy leaves out. It does not ask whether the agent was clever. It asks whether the agent was careful. A run can fail with no wrong idea at all, only a skipped check or a forgotten file name. That is useful for builders. A reminder in the prompt to re-read the instruction, or a final step that runs the tests, targets exactly these slips.

An agent writes “all tests pass” in its notes while its own last log shows two failing tests. Which class fits best?

Chapter 8

Command Errors and Limits

Count the commands that fail, learn why they add up, and read the limits the authors name

Last chapter looked at the whole run: did the agent follow the task, stay consistent and check itself? This chapter zooms in to a single line. The agent types a command. The shell answers command not found. The turn is spent, the screen is longer, and nothing has moved forward. How often does this happen?

Counting failed commands

The authors reviewed individual command input and output pairs from the recorded Terminus 2 runs. They used a language model as a judge (GPT-5 with medium reasoning) to decide whether the output showed a failure. They checked it against three human annotators on 66 pairs, and the judge agreed with the majority label 92.4% of the time.

The command error rate is the share of commands that failed. It ranges from 9.2% for Grok 4 up to 26.7% for GPT-OSS-120B. Even the lowest rate means roughly one command in eleven fails. The worst fails more than one in four.

What kind of errors

To sort the failures the authors wrote a taxonomy in several families. Invocation and CLI errors come from how a command is called: the program is not installed or not on the PATH (the list of folders the shell searches for programs), the path given is wrong, the file is not executable, the wrong interpreter is used, a flag does not exist, a required argument is missing, or the shell syntax is broken (an unclosed quote or heredoc). They also list mismatches between shells and between GNU and BSD versions of a tool. Filesystem and permissions errors cover missing files and denied access. Further families cover runtime failures of programs that start and then crash, and errors in interactive programs such as a Python prompt.

The judge (GPT-5 with high reasoning) sorted 3,800 failures sampled across tasks and models into this taxonomy. It agreed with 50 labels from an author 82.0% of the time. The most common single cause, by a wide gap, was calling an executable that is not installed or not on the PATH: 24.1% of all failures. Failures when running executables came next at 9.6%.

Why is “not installed” so common? A fresh container holds only what the task author put there. A person would run which python3 or try apt install before relying on a tool. A model often assumes the tool exists, because it exists on the machines in its training data. The fix is a habit, not new knowledge: look before you leap.

Why small rates add up

A one-in-four failure rate sounds survivable. But a task takes many commands. If each command fails with chance p and we ignore how failures link, the chance that a run has at least one failed command grows quickly.

P(≥ 1 failure)
The chance that at least one of the k commands in a run fails.
p
The chance that one command fails. The paper’s range is 0.092 to 0.267. Then (1 − p) is the chance it succeeds.
k
How many commands the run types. All k must succeed for a clean run, so we multiply (1 − p) by itself k times.

Work it for 20 commands. At p = 9.2%, a clean run has chance 0.90820 ≈ 0.145, so 85.5% of runs have at least one failure, and the average run has 1.84 failed commands. At p = 26.7%, a clean run has chance 0.73320 ≈ 0.002, so about 99.8% have a failure, with 5.3 failed commands on average. Move the sliders to see the whole spread.

Compound the failures

Bars show the chance of exactly 0, 1, 2 and more failed commands in one run. Pick a model’s rate, then drag the number of commands.

20

The two rates are the paper’s (Section 4.5). The bars assume each command fails independently, which is a simplification: real failures cluster, since one missing tool breaks every later command that needs it. Treat the shape as an illustration, not a measurement.

A failed command is not always a failed task. Agents can read the error, install the tool and go on. But each failure uses a turn and puts noise in the context. This is a direct cost of the compounding Chapter 6 saw: more effort spent, no more progress made.

The limits the authors name

The paper ends with candid caveats. They are worth listing, since a benchmark user should keep them in mind.

  1. Cheating by looking up the answer. Agents have internet access, so in theory one could find the public oracle solutions. The authors saw no such behaviour in tens of thousands of trajectories, but ask users to stay alert.
  2. Training on the test. A model builder could train on the tasks. The files carry a canary string. A private test set would help, but building one was outside the scope of the paper.
  3. Reproducibility. Versions are pinned and images are prebuilt, but internet access brings outside dependencies, and machine resources and container limits can differ between runs.
  4. Task quality. Despite heavy review, some tasks might still miss the verification standards. The authors chose diversity and realism over the easier check that a narrower, in-house benchmark would allow, and invite change requests on the repository.
  5. Saturation. Scores nearly doubled in eight months. Terminal-Bench 2.0 may become saturated within a year, so the authors plan new, harder task sets and will post new results at tbench.ai.
Each command fails 10% of the time, independently. A run types 20 commands. About how likely is a run with no failed command?

Chapter 9

Field Guide

Take the numbers, the checklist, the core loop as code, and the credit away with you

Here is the whole paper in one paragraph. Terminal-Bench is a way to test agents on real terminal work. A task is a container, an instruction and tests that check the final state, and it is trusted only after it passes three standards and a long audit. The 2.0 set has 89 such tasks, chosen from 229. The authors ran six agents and 16 models for 32,155 trials. The best average is 62.9%. Model choice matters more than agent choice. More turns and more tokens do not buy more success. Agents mostly fail through execution slips, then coherence and verification slips, and about one command in four to eleven fails outright.

The numbers to remember

MeasurementValueSource
Tasks contributed, then selected229 from 93 contributors, 89 in version 2.0Section 2.2
Reviewer time per taskabout 3 hours combinedSection 2.3, Figure 3
Study size6 agents, 16 models, at least 5 runs each, 32,155 trialsSection 3
Best resolution rate62.9% ± 3.0 (Codex CLI with GPT-5.2)Figure 1, Table 2
Next two57.8% ± 2.5 (Opus 4.5) and 56.9% ± 2.5 (Gemini 3 Pro), both with Terminus 2Table 2
Best open-weight modelKimi K2 Thinking, 35.7% ± 2.8 (36% in the text)Section 4, Table 2
Hard labels that were empirically hard93.3%; medium labels that were hard: 54.5%; r = 0.436Figure 7
Failure labelling qualityannotators κ 93%; judge agrees 90% (92% precision, 90% recall)Section 4.4
Command error rate9.2% (Grok 4) to 26.7% (GPT-OSS-120B); command not found 24.1% of failuresSection 4.5, Figure 9
Turns and tokens against successr = −0.028 and r = −0.170, neither clearly different from zeroAppendix G
Cost of one full runabout $1 to $100, by model priceSection 4.1
Agentic Benchmark Checklist0.896 average (0.857, 1.000, 0.830)Appendix B.5

Terms in one line each

TermMeaning
ContainerA fresh, disposable machine built from a Docker image, used for one attempt.
Oracle solutionA human-written script that makes every test pass, proving the task is solvable.
Dummy agentAn agent that does nothing. It must fail, or the tests are too weak.
Outcome-drivenTests check the final container state, never the commands used.
Scaffold (harness)The program around a model: its tools, its loop, its memory handling.
TrialOne agent’s attempt at one task.
Resolution rateThe share of tasks resolved, averaged over repeated runs.
Pareto frontierThe agents that no other agent beats on both cost and score.
Cohen’s kappaAgreement between labellers once chance matches are removed.

Check a task of your own

The paper hands task writers a checklist. Use it as a short test for any benchmark task you write, even outside Terminal-Bench. Tick what is true of your task.

Grade your own task

Each line is a check from the paper’s contributor checklist or its CI. Tick the ones your task meets.

The list paraphrases Appendix B.1 (the pull request checklist) and the CI rules of Section 2.3. It is a study aid, not an official scoring tool.

The core as code

All of Chapters 1 to 5 fit in one short function. This is our sketch of the idea, in Python, not the authors’ harness.

from statistics import mean

def attempt(task, agent):
    box = start_container(task.image)              # fresh, disposable machine
    agent.solve(task.instruction, box, task.time_limit)
    box.copy_in(task.tests)                        # tests arrive only now
    ok = box.run("pytest -q").returncode == 0      # every test must pass
    box.destroy()
    return ok                                      # graded on the final state

def audit(task, oracle, dummy, fair):
    assert attempt(task, oracle)                   # solvable
    assert not attempt(task, dummy)                # a no-op must fail
    # plus: an exploit agent tries to cheat, a person reads what it found

def resolution_rate(tasks, agent, K=5):
    return mean(mean(attempt(t, agent) for _ in range(K)) for t in tasks)

Where it sits

Terminal-Bench joins a line of agent benchmarks: SWE-Bench for repository fixes, τ-Bench and the Berkeley Function Calling Leaderboard for tool use, WebArena and OSWorld for computer use, and research benchmarks for science. Its marks are real shells, expert-written long tasks, and the effort spent on proving the tasks fair. For the craft behind agent scoring, see our agent evaluation lesson, the evaluation statistics lesson on error bars, and benchmark auditing. The lecture this paper belongs to is CS 329Z Lecture 10, Terminal-Bench; the course begins with what agentic systems are. For another paper on the code around a model, read Harness Learning.

Credit and sources

Terminal-Bench: Benchmarking Agents on Hard, Realistic Tasks in Command Line Interfaces was written by Mike A. Merrill and Alexander G. Shaw (equal contribution and corresponding authors) with Nicholas Carlini and dozens of co-authors from Stanford University, the Laude Institute, Anthropic and more than forty other institutions, ending with Andy Konwinski and Ludwig Schmidt. It was posted as arXiv 2601.11868 in January 2026. Read the original at arxiv.org/abs/2601.11868. The dataset and the harness are at tbench.ai, and the configuration files for the paper’s runs are in the laude-institute/terminal-bench-experiments repository. Every number in this lesson comes from that paper, except where a device says it is illustrative.

Trust the tests before you trust the scores. The most careful part of this paper is not the model ranking. It is the audit: outcome tests, three standards, a dummy that must fail, a cheater that must be caught. A benchmark score is only as good as the task behind it.
Go back to the hero and pick each agent again. Now read the error band as an honest range, remember the 89 tasks behind each dot, and ask which of them were solved by skill and which by luck.
Which statement matches the paper’s findings?
Terminal-Bench
Read the paper · Back to Veanors