A bare-shell agent harness outscored Codex and Claude Code with frontier models
Microsoft Research's Freehand gives a model only a shell, an editable record of its own conversation and a running meter; in its authors' tests it wins with frontier models but not weaker ones.

Turning a language model into an agent takes a harness: the loop that hands the model its context, runs the commands it chooses and reports what happened. Most harnesses decide much in advance. They prescribe workflows, offer fixed menus of 4 to 34 tools, cut commands off after a set time and summarise the conversation once it passes a set threshold in the context window, the model's working text. In a 2026 preprint, not yet peer reviewed, a Microsoft Research team argues that for the strongest models these presets have become a hindrance. They see this as an instance of what Rich Sutton called the Bitter Lesson: knowledge built into AI by hand helps at first and is later overtaken by general methods.
Their harness, Freehand, keeps only the basic observe-reason-act cycle. A prompt of about 200 words explains how the runtime works but prescribes no workflow. The only tool is bash, a command-line shell. The model sets each command's timeout itself and writes its own scripts instead of calling ready-made tools. Its conversation history is an editable file, transcript.json, which the model can prune or condense. Because the file uses the provider's native message format, the model can insert a screenshot to view on its next turn, then delete it. After each turn, a one-line meter reports the turn number, context size, tokens (chunks of text) and cost so far, and elapsed time. One prompt served every model and benchmark, and sandboxing and permissions stay with the host system.
The authors ran GPT-6-astra and Claude Opus 5.5 on five benchmarks: Terminal-Bench 4, Terminal-Bench Science, Agents' Last Exam, OSWorld 2.1 and AutomationBench. These span systems and scientific computing, Ubuntu desktop use and enterprise workflows. Gemini 4 Carbon ran on Terminal-Bench 4 alone, giving 11 settings and 191 rounds. Against the harness from each model's maker (Codex, Claude Code or Gemini CLI), Freehand's reported gains ranged from 0.9 percentage points on Terminal-Bench Science with Opus to 7.9 points on OSWorld 2.1 with GPT-6-astra (76.2 against 68.3). Mean cost per task was $3.73 against $7.34, with savings of 30% to 74% per setting. Over the ten GPT-6-astra and Opus settings, Freehand averaged 63.2%, against 56.8% to 59.3% for the makers' harnesses, OpenCode, DeepSeek Harness and Pi.
Freehand's fixed prompt and tool definitions come to about 0.35K tokens, against roughly 1.2K to 15.1K for the other harnesses audited. Fixed timeouts are costly too. In one run of a Terminal-Bench 4 task, mini-swe-agent, which also offers only bash but stops commands at 30 seconds, checked whether a job had finished 334 times and spent $70.77. Freehand waited up to 24 minutes in one call and spent $2.28. The authors also ran controlled tests with GPT-6-astra. On Agents' Last Exam, a variant that summarised automatically at 90% of the context window, instead of letting the model manage its memory, scored 67.7% against Freehand's 67.5% but cost 19% more. Adding Codex's prompt and tools back into the loop dropped the score to 63.7% and raised cost by 68%. On one benign task, Codex's system prompt alone, placed in Freehand, triggered first-turn refusals in 10 of 10 runs.
The advantage reverses with weaker models. On Terminal-Bench 4, Codex led Freehand by 5.7 points with GPT-6 Sol, Claude Code by 6.7 with Claude Sonnet 5.5 and DeepSeek Harness by 5.1 with DeepSeek V4.1 Flash. The authors therefore pitch Freehand at frontier models only, and they leave the crossover point unmapped. That test used one benchmark, and the controlled tests used one model on two. Some per-setting gains are small next to run-to-run variation: Freehand's 2.5-point lead on Terminal-Bench 4 with GPT-6-astra compares with a 3.0-point standard deviation across its rounds, and each benchmark got only two to five rounds. The speed edge is slim in the main results: an average of 31.7 normalised minutes against 32.0 for OpenCode, and Freehand was slower in some settings. The team ran every baseline itself, and apart from refusals on a benign task, the paper does not test whether dropping prompt rules alters safety behaviour. The authors also suggest the gains could widen if models were trained on Freehand's interface rather than largely on their makers' tool formats.
Freehand's reversal with weaker models fits a study that swapped planning, tools and context handling in and out of one coding agent and found that each piece's value depends on model, task and budget (earlier story). It also echoes work on a robot's software loop around GPT-6-astra, in which hand-built plans mattered less than camera detail and spatial estimates (earlier story).
- Paper
- Freehand: The Bitter Lesson Comes to Agent Harnesses
- Authors
- Zezi Zeng, Yuke Zhao, Muzhao Tian, Yifan Yang, Qi Dai, Bei Liu et al.
- Venue
- arXiv preprint — not yet peer reviewed · 1 December 2026
- Link
- arxiv.org/abs/2612.02442
- Index
- stacks.braintank.ai
- Code
- github.com/microsoft/FreeHand
- Cite


