Microsoft Freehand Beats Codex, Claude Code at Half Cost

Your coding agent’s biggest cost is not the model. It is the harness wrapped around it. Microsoft Research just proved it. Its new open-source harness, Microsoft Freehand, beat Codex, Claude Code and Gemini CLI in all 11 benchmark settings — scoring 5.1 points higher on average while cutting the cost per task by 49%.

The paper, “Freehand: The Bitter Lesson Comes to Agent Harnesses”, was submitted to arXiv on December 1, 2026. The code is already public on GitHub under an MIT license, so anyone can install it today and test the claim.

A harness is the loop around an AI model: it sends context to the model, runs the actions the model asks for, and returns the results. Freehand’s argument is that today’s harnesses decide too much for the model — and those decisions now cost more than they save.

The headline numbers

Freehand vs. the first-party harnesses

11 / 11
settings won against Codex, Claude Code and Gemini CLI

+5.1 points
average score gain, at 49% lower cost per task

$3.23 vs. $6.70
mean cost per task: Freehand vs. the vendors’ own harnesses

“Give the model a shell, its own memory, and a meter — and let it decide everything else.” — the Freehand paper’s one-line design rule

The tests covered five benchmarks — Terminal-Bench 4, Terminal-Bench Science, Agents’ Last Exam, OSWorld 2.1 and AutomationBench — with three frontier model families: GPT-6-astra, Claude Opus 5.5 and Gemini 4 Carbon. Freehand also beat OpenCode, Pi and DeepSeek Harness, and ran fastest: in a controlled rerun, each rival took 17% to 62% longer.

Microsoft’s team audited eight popular harnesses through their source code and captured API requests before building Freehand.

Harness Fixed instructions Built-in tools
Codex CLI ~15,100 tokens 23
Gemini CLI ~9,500 tokens 16
Claude Code ~8,500 tokens 22
DeepSeek Harness ~6,500 tokens 34
OpenCode ~5,200 tokens 10
Pi ~1,200 tokens 4
Freehand ~350 tokens 1 (bash)
Freehand benchmark chart: best mean score 63.2%, lowest mean cost $3.23 per task, fastest mean time 31.7 minutes
Freehand’s own results chart: best mean score (63.2%), lowest mean cost per task ($3.23) and fastest mean time (31.7 minutes). Image: Microsoft Research, via GitHub.

How Freehand works

Freehand hands the model three things, and nothing else.

Freehand’s three parts — and nothing else

1. A shell, with time under the model’s control. One bash tool. The model sets the timeout of every command itself, so it can wait for a long computation instead of polling it.
↓
2. Memory as a file the model edits. The conversation history lives in the environment as an editable file, so pruning a stale log is just another shell action.
↓
3. A meter instead of rules. After every turn the harness reports context size, tokens, cost and elapsed time — where the model stands, never what to do about it.

The timeout example shows why this matters. Under a fixed 30-second cutoff, one Terminal-Bench 4 run turned a single wait into 334 polling calls, at more than ten times the cost of an agent that sets its own timeout.

Diagram comparing mainstream harnesses with Freehand: 20+ preset tools and auto-compaction versus one bash tool and self-managed memory
Mainstream harnesses wrap the model in preset tools, reminders and auto-compaction. Freehand gives it a short runtime description, one bash tool and control over its own history. Image: Microsoft Research.

What it costs per task

The money claim is the one that matters for anyone running agents at volume. Across the ten GPT-6-astra and Claude Opus 5.5 settings, Freehand averaged a 63.2% score against 58.4% for the vendors’ own harnesses — and a mean cost of $3.23 per task against $6.70.

Benchmark Model Freehand First-party harness
OSWorld 2.1 GPT-6-astra 76.2% · $3.96 Codex 68.3% · $14.94
OSWorld 2.1 Claude Opus 5.5 80.1% · $2.09 Claude Code 74.9% · $7.49
Terminal-Bench 4 GPT-6-astra 57.1% · $3.12 Codex 54.6% · $5.88
Terminal-Bench 4 Claude Opus 5.5 61.9% · $3.38 Claude Code 54.9% · $4.91

On OSWorld 2.1 with GPT-6-astra, Freehand scored 7.9 points higher while costing $3.96 per task against Codex’s $14.94 — a 73% saving on that benchmark. Every token was priced through one accounting pipeline at public list prices, across 191 evaluation rounds.

How to try it — and make money with it

Freehand runs on macOS and Linux, and signs in with a ChatGPT Plus or Pro plan, or with an OpenAI or Anthropic API key:

  • Install: run the installer from the Freehand GitHub repository, or pip install freehand-ai.
  • Sign in: run freehand login for ChatGPT, or freehand login anthropic for Claude.
  • Run it: cd your/project, then freehand for an interactive session or freehand -p "fix the failing test" headless.
  • Switch models mid-session: use /model to move between providers without restarting.

The money angle is simple: if your agent work costs half as much per task, you can pocket the margin or undercut competitors on the default harness. A freelancer selling bug-fix work can quote the same job for less, because the token bill behind it is smaller.

One warning matters more than any feature. Freehand has no sandbox. The model’s commands run with your permissions and nothing asks first. Microsoft’s own guidance is to use a container or virtual machine for code you do not trust. Treat that as a rule, not a suggestion.

The catch: read this before you switch

Three caveats keep this honest. First, this is a preprint, not a peer-reviewed paper, and the authors built the harness they are testing — nobody outside the team has independently rerun the numbers yet. Treat the results as a claim to verify, not a fact to quote blindly.

Second, the advantage reverses on smaller models. On Terminal-Bench 4, the first-party harnesses won again with lower-tier models: Codex beat Freehand 34.9% to 29.2% with GPT-6 Sol, Claude Code led 41.6% to 34.9% with Claude Sonnet 5.5, and DeepSeek Harness led 28.9% to 23.8% with DeepSeek V4.1 Flash. Third, Freehand is alpha: the desktop app is in beta and native Windows support is still coming.

Even with those limits, the direction is clear. As models get stronger, the best harness is the one that decides the least.

Frequently asked questions

What is Microsoft Freehand?

Freehand is a free, open-source agent harness from Microsoft Research. It gives a frontier AI model a ~200-word runtime description, one bash tool, an editable conversation history and a per-turn cost meter — and leaves every other decision to the model.

How much does Freehand cost?

The software is free under an MIT license. You pay only for the model behind it: a ChatGPT Plus or Pro plan, or API usage with OpenAI or Anthropic. The paper reports a mean cost of $3.23 per benchmark task, against $6.70 for the vendors’ own harnesses.

Which models does Freehand work with?

It was tested with GPT-6-astra, Claude Opus 5.5 and Gemini 4 Carbon, and it supports OpenAI, Anthropic and any OpenAI-compatible API, including gateways such as LiteLLM. Use it with a frontier model: with weaker models, the first-party harnesses still win.

Is Freehand safe to run?

It has no sandbox and no approval prompts — commands run with your permissions. Microsoft recommends a container or virtual machine for code you do not trust, and the repository itself warns that repository content is untrusted input.

Why does Freehand lose on smaller models?

Presets act as guardrails when a model cannot plan well on its own. On Terminal-Bench 4 with GPT-6 Sol, Claude Sonnet 5.5 and DeepSeek V4.1 Flash, the first-party harnesses scored higher. The advantage flips only once the model is strong enough to use its freedom well.

Where can I get Freehand?

On GitHub at microsoft/FreeHand, via the install script or pip install freehand-ai. The paper is on arXiv as 2612.02442, submitted December 1, 2026.

Sources: Zeng et al., “Freehand: The Bitter Lesson Comes to Agent Harnesses,” arXiv:2612.02442, submitted December 1, 2026; Microsoft FreeHand repository, README and results, GitHub.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top