Microsoft's Freehand: A Bash-Only Agent Beats Claude Code, but Only With Top Models

Microsoft Research Asia gives an AI agent nothing but a command line, a memory it can edit itself, and a cost meter. According to the paper, this bare-bones harness beats the tools from OpenAI, Anthropic and Google at half the price. We re-ran the numbers and compared them with the first independent tests. They show where the approach hits its limits.

Analysis Dec 6, 2026 9 min read Original analysis by our editors
Illustrative image, AI-generated

What's going on

When you code with Claude Code, Codex or Gemini CLI today, the language model works inside a so-called harness, a software scaffold. It hands the model tools, feeds it a long system prompt with prescribed workflows, kills commands after fixed timeouts, and trims the conversation history once it gets too full. With Freehand, Microsoft Research Asia challenges that whole approach. The paper "Freehand: The Bitter Lesson Comes to Agent Harnesses" (arXiv 2612.02442) came out on December 1. The package landed on GitHub under the MIT license on December 2, and the repo now has around 2,700 stars. According to QbitAI, Xi'an Jiaotong, Zhejiang and Fudan universities were also involved alongside Microsoft.

The authors' core rule:

Give the model a shell, its own memory and a meter – and let it decide everything else.

The thesis in the title goes back to Rich Sutton. His 2019 "Bitter Lesson" argues that built-in human knowledge in AI research eventually loses out to general methods that get better with more compute. We checked how well the numbers hold up. Our counter-thesis: so far, the lesson only applies to the strongest models.

How little is in it

According to the README and the paper, Freehand has four parts:

  • A prompt of around 200 words. It only describes how the environment works and doesn't prescribe a workflow. One line from it: "Nothing else is decided for you." The fixed prompt prefix is about 0.35K tokens long.
  • A single Bash tool. The model sets the timeout for each command itself. The default is 120 seconds, and anything from 1 to 86,400 is allowed. It can wait out long jobs or push them into the background.
  • An editable history (transcript.json). The model deletes or condenses old content itself. Automatic trimming is opt-in only and off by default.
  • A status line after every step showing context size, tokens including the cached share, cost and elapsed time. It contains no advice.

For comparison, the paper puts the fixed prompt prefix of harnesses with lots of built-in tools at 5.2K to 15.1K tokens per step. Independent measurements land in the same ballpark. According to an analysis by Daniel Vaughan, Codex CLI (v0.114.0) sends about 8,500 tokens even in a minimal session, Gemini CLI sends 10,000 to 13,000, and Claude Code 6,000 to 10,000 depending on configuration. The Pi harness stands out: at around 350 tokens, its prompt is about as short as Freehand's, yet it performs worse in the paper. So a short prompt alone doesn't explain the effect.

The numbers, recalculated

We averaged the eleven settings from the README table ourselves. Freehand comes in at 62.7 percent and $3.73 per task, the vendor harnesses at 57.6 percent and $7.34. That's +5.1 points and 49 percent lower costs, matching the paper. Elsewhere, the README and Sulat cite 63.2 vs. 58.4 percent and $3.23 vs. $6.70. Those figures were apparently averaged differently, but the direction is the same.

Benchmark Model Freehand Vendor harness Difference
Terminal-Bench 4 GPT-6-astra 57.1% · $3.12 Codex 54.6% · $5.88 +2.5
Terminal-Bench 4 Claude Opus 5.5 61.9% · $3.38 Claude Code 54.9% · $4.91 +7.0
Terminal-Bench 4 Gemini 4 Carbon 57.1% · $8.76 Gemini CLI 49.5% · $13.72 +7.6
TB Science GPT-6-astra 63.8% · $7.71 Codex 58.1% · $12.99 +5.7
TB Science Claude Opus 5.5 55.2% · $8.16 Claude Code 54.3% · $12.86 +0.9
Agents' Last Exam GPT-6-astra 67.5% · $1.92 Codex 63.6% · $4.45 +3.9
Agents' Last Exam Claude Opus 5.5 66.5% · $1.16 Claude Code 62.2% · $2.29 +4.3
OSWorld 2.1 GPT-6-astra 76.2% · $3.96 Codex 68.3% · $14.94 +7.9
OSWorld 2.1 Claude Opus 5.5 80.1% · $2.09 Claude Code 74.9% · $7.49 +5.2
AutomationBench GPT-6-astra 49.5% · $0.56 Codex 44.8% · $0.89 +4.7
AutomationBench Claude Opus 5.5 54.4% · $0.19 Claude Code 47.9% · $0.27 +6.5

So the "11 out of 11" holds up, but it includes some close calls. On TB Science with Opus, the gap is just 0.9 points. On Terminal-Bench 4 with GPT-6-astra, it's 2.5 points, with a spread of ±3.0 across five runs. According to the paper, the lead across all settings is highly significant (p<0.001), but individually only in "nearly every" setting of the three larger benchmarks. The speed claim has limits too. In a controlled parallel run with 44 tasks and 440 runs, the other harnesses took 1.17 to 1.62 times as long. But on TB Science with GPT-6-astra, Freehand ran 23.5 minutes longer than Codex. The paper explains this by saying Codex gave up earlier and reached the goal less often.

Where the gain comes from is interesting. In the ablation (removing components one at a time) with GPT-6-astra, the success rate barely changes when you strip Freehand of self-management, i.e. history editing and the status line: 56.8 instead of 57.1 percent. Costs go up, though. Swap in the Codex prompt and Codex tools instead, and the score drops to 54.6 percent while input rises from 0.99 to 2.11 million tokens. The authors offer some vivid examples. With the Codex system prompt, the model refused a harmless biology docking task in 10 out of 10 runs. With the Freehand prompt, it solved all ten. On a long computation task, Freehand waited up to 24 minutes in a single call and got by with 42 calls for $2.28. The minimal agent mini-swe-agent, with a fixed 30-second cutoff, polled 334 times and cost $70.77.

The flip side: weaker models

The authors don't hide this, but English-language coverage mostly mentions it only in passing. On Terminal-Bench 4 with five runs, the vendor harnesses win with smaller models:

Model Vendor harness Freehand Cost (vendor / Freehand)
GPT-6 Sol Codex 34.9% 29.2% $2.42 / $0.97
Claude Sonnet 5.5 Claude Code 41.6% 34.9% $1.70 / $1.75
DeepSeek V4.1 Flash DeepSeek Harness 28.9% 23.8% –

That's a 5 to 7 point deficit. With Sonnet 5.5, Freehand doesn't even save money. The authors call the vendors' guardrails a crutch for weak models and a cage for strong ones. According to QbitAI, exactly where the line falls hasn't been determined yet.

What independent tests show

The first outside test comes from JP Caparas (Sulat). He had Freehand 0.1.1 and opencode each solve three small tasks with five models, for 30 runs in total with one pass per combination. He explicitly calls it a smoke test, not a benchmark. Every run passed the checks. Freehand used 45K instead of 359K input tokens for test fixing and 32K instead of 349K for the long computation job, roughly 8 and 11 times fewer. But on a drawing task (a pelican on a bicycle as SVG), two Freehand runs went off the rails. DeepSeek V4.1 Flash kept going for 15 minutes until Caparas stopped it, racking up 107 tool calls and roughly 2.3 million input tokens. In opencode, the same model finished in ten seconds. Gemini 4 Neon ended with an error after three empty responses. As Caparas puts it: if you leave every decision to the model, you also leave it the decision of when to stop. He discloses that he's an ambassador for OpenAI, Firecrawl and Devin.

A second signal comes from Issue #94. A user replicated Freehand's principles in Claude Code, with a short prompt and Bash only. Across six small bug fixes with Opus 5.5, costs dropped 44 percent, with 18 out of 18 successes in both variants. In Codex the drop was 39 percent, in OpenCode 32 percent. One commenter objected that the tasks were too easy to measure differences in quality. In Issue #10, lead author Zezi Zeng concedes that none of the five benchmarks specifically measures work in large repositories. Yet that's everyday reality for many developers. On Hacker News, the response has been muted so far, with individual posts scoring 2 to 6 points. We found no reports from people using local models, and we weren't able to run our own measurements.

What you need to try it

Freehand runs on macOS and Linux and requires Python 3.10 or later. On Windows, it currently only works via WSL2. Install it with pip install freehand-ai or uv tool install freehand-ai, then run freehand login and freehand in your project folder. Supported providers are OpenAI (including via ChatGPT Plus/Pro login), Anthropic, Amazon Bedrock, Azure, Google Vertex AI, GitHub Copilot (experimental), and any OpenAI-compatible endpoint via --provider openai-chat --api-base <url>. In theory, that lets you hook up local servers like llama.cpp too. According to the release notes, though, some gateways still reject requests with an HTTP 422 error. Important: Freehand has no sandbox and no confirmation prompts. Commands run with your permissions and have access to files, the network and credentials. That's why the developers recommend a container or VM if the code isn't yours. According to the README, there's no telemetry.

Our take

Our assessment: the numbers are better documented than in many vendor comparisons. There are multiple runs, significance tests, pinned versions and an ablation. Our recalculation confirms the averages. Still, these are the authors' own measurements, and no third party has replicated them on the same benchmarks yet. The real finding is a tipping point: the stronger the model, the more the vendors' guardrails get in the way. With mid-range models, though, they still help, and those are exactly the models many people use when running locally or on a budget.

Switching can pay off if you're paying API prices for long, open-ended tasks with Opus 5.5, GPT-6-astra or comparable frontier models. That's where input tokens are the biggest cost driver. If you need approval before every command, work on native Windows or use a smaller model, you're better off sticking with the vendor's tool. Judging by Issue #94, the easiest part to carry over is the core idea: a short prompt, few tools and a visible cost meter.

#agents#microsoft#coding#claude code#codex#open source

Ask the AI assistant

Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.

Connecting …

The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.

Comments

What do you think? Already tried it? Write it here, no sign-up needed.

  1. Loading comments …

Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.