Mastra’s Harness Is SoTA on TerminalBench Across Anthropic/OpenAI Models

Mastra’s model-agnostic agent harness averaged 69.2% with Claude Opus 5.5 and 58.1% with GPT-6.1 Sol on Terminal-Bench 4.0, across three runs per model with goal mode enabled.

·

Nov 23, 2026

To compare how Mastra’s model-agnostic agent harness performs against the native harnesses from OpenAI and Anthropic, we ran GPT-6.1 Sol and Claude Opus 5.5 on Terminal-Bench 4.0 in Mastra’s harness and compared their results with the official Codex and Claude Code results for the same models.

With goal mode on, the average scores for Opus and Sol over three runs each were 69.2% and 58.1%, respectively. Opus’s measured score was higher than Claude Code’s 64.85%, while Sol was nearly tied with Codex’s 58.2%. The runs were done under different conditions, which we describe below.

Mastra’s harness is built around the AgentController class. It powers MastraCode, our command-line coding tool, and Mastra Factory, our open-source environment for building software with coding agents. We tested the harness through MastraCode, using patched builds that included the changes discussed below.

We examined the agents’ traces alongside the results and found that some agents completed their own checklists while leaving part of the request unfinished. Other attempts ran into tool failures or memory limits. We used these findings to investigate the harness and test changes.

Results

We compared each model’s results in Mastra’s harness with its results in the native harness:

The no-goal results are based on one full run for Opus and two for Sol, while the goal-mode results are based on three runs per model. The official Claude Code and Codex datasets each contain five attempts at every task.

With goal mode, Opus had a higher measured score in Mastra’s harness than in Claude Code, while Sol’s score was almost the same as in Codex. But, due to variability across attempts and differences in how the harnesses were tested, we cannot consider the Opus difference conclusive.

The no-goal builds already included bug fixes and stronger verification instructions. Goal mode introduced a persistent goal and a completion judge, so we cannot attribute the score difference between modes precisely to each of these additions.

We also compared the results across the benchmark’s seven task categories:

Each bar shows the pass rate across three attempts per task with Mastra in goal mode and five with the native harness. Hardware, Security, and Media contain only four or five distinct tasks each, so these comparisons should be interpreted cautiously.

Methodology

We configured the main agent to use maximum reasoning effort with both models. Each task supplied instructions and an environment with resource limits, and the benchmark grader evaluated the result.

With goal mode, each model attempted the same 66 tasks three times, giving us 198 scored attempts per model.

ModelRun 1Run 2Run 3Average
Claude Opus 5.569.7%68.2%69.7%69.2%
GPT-6.1 Sol59.1%59.1%56.1%58.1%

These builds included bug fixes and better instructions for verification. Goal mode kept the original prompt available throughout the run and added a completion check after the agent stopped working.

Which differences affect the comparison?

The official native-harness runs also used maximum reasoning effort. Several other differences make the results less straightforward to compare:

  • Access differed. Mastra used ChatGPT and Claude subscription logins, while the official native-harness runs used API credentials. We did not run any controlled experiments to test the effect of this difference.
  • We tested patched builds. We developed and tested the fixes and prompt changes on the same 66 tasks, rather than evaluating them on a held-out set of tasks.
  • Some Opus attempts used a fallback model. Our Opus build included refusal fallback and output-length continuation intended to match Claude Code. Some attempts included requests to an older Opus model after a refusal. The official Claude Code runs also used fallback behavior.
  • We kept the recorded benchmark grades. For instance, one Sol attempt received a passing grade even though the agent process was killed.
  • The grading version matters. Our results use the 4.0 graders, so they should not be compared directly with scores produced by the updated 4.1 graders.

How does Mastra’s harness work?

Mastra’s harness does three key things:

  • It gives the agent tools to read and modify files and execute commands.
  • It manages the conversation history.
  • It keeps the agent’s task list available throughout the run.

Managing conversation history with observational memory

Observational Memory is a mechanism for managing context in long, multi-round tasks. As the conversation progresses, it replaces older parts of the active conversation with summaries produced by an observer. When the summaries get too large, a reflector condenses them. The agent can retrieve older summaries, as well as the original messages they summarize, using a recall tool. Observational Memory was triggered during long Opus runs, but we didn’t evaluate its effect on the score separately.

Task management with Mastra’s AgentController

Task management is built into AgentController, with tools for creating and updating the task list, marking tasks complete, and checking their status. The agent can decompose the prompt into subtasks, which it can mark as in progress or complete. The agent can also update the task list as it explores. The harness maintains a separate record of the task list and injects updates into the model. Once the messages containing the task list leave the active conversation, the harness re-injects a fresh copy.

The agent is responsible for creating tasks and marking them as done. The task subsystem keeps track of what the agent thinks is done, but doesn’t verify that the agent’s plan covers all of the requirements of the original prompt.

Tasks vs goals with Mastra

We distinguish between tasks and goals. The task list is simply the plan the agent created for itself. In our goal-mode runs, the goal was the original prompt. The harness stores the goal separately from the task list and re-injects it when it leaves the active conversation. Thus, when the agent marks all tasks as done, the goal might not be done.

We use a separate judge that reviews the goal and the agent’s most recent answer to check if the goal is complete. The judge also has access to readonly tools that allow it to inspect the agent’s work. The judge may say that a solution is complete without guaranteeing that it is actually correct.

These runs allowed at most three completion checks. The benchmark grader evaluated the result separately.

How we improved our harness

Along the way, we made several improvements to our harness:

  • We improved verification guidance and introduced a dedicated completion check in goal mode. An agent can complete its own checklist without fulfilling the original request. Although we introduced a separate completion check, the judge still accepted many attempts that failed the benchmark.
  • By default, subagents are disabled in Mastra Code. We found that delegating subtasks led to redundant computation and overhead in these runs. This informed our design choices, but did not establish that disabling subagents alone improved accuracy.
  • We reduced memory pressure on the harness. We created a separate worker to run the search model and adjusted Linux process priorities so that, if the system runs out of memory, subprocesses are more likely to get killed before the main agent loop.
  • We resolved hidden command errors when using trailing tail pipelines. We patched the command processing system to preserve failure exit codes for supported pipeline patterns, including on shells where our previous mechanism did not work.
  • We fixed reporting errors from tools. In some cases, a processor would clear the error flag when a tool was called with invalid input. This led to calls being reported as successful even when the tool had failed.
  • We improved file format detection and recovery. Instead of relying only on file extensions, the harness now checks file content. When a provider rejects a file, the harness can remove it from the conversation and retry if the error identifies the file or it was the only file sent. Otherwise, the history stays unchanged and the error is reported.
  • We resolved some smaller file-handling issues. We fixed cases where some JSONL files were read as binary and loaded settings were rewritten with defaults. We also fixed Unicode characters being split when we truncate search results.

What’s next?

You can view the full results here.

There are a few directions for future testing:

  • We could run the harness with open-weight models to compare results.
  • Testing on tasks we didn’t use to develop the improvements and prompts would help us assess how well they carry over.
  • We could compare the same build without goal mode, with the original prompt kept available but no completion judge, and with both enabled.

To get started, see the AgentController documentation or try Mastra Code.

Share on X or LinkedIn
Aamish Ahmad Beg
Aamish Ahmad BegFounder, Lopus AI

Aamish is a founder at Lopus AI, where he leads research efforts.

All articles by Aamish Ahmad Beg →
Gautam Paranjape

Gautam works on research at Mastra.

All articles by Gautam Paranjape →