Microsoft's Freehand paper says a nearly empty harness beats Codex, Claude Code and Gemini CLI. We read the code at its December 5 commit to show exactly what it sends the model, what it leaves out, and what the paper's own tables say about how often models use its main idea.
This explains reporting by
arXiv: Freehand, the bitter lesson comes to agent harnesses (Dec. 1, 2026). Read the original first:
https://arxiv.org/abs/2612.02442
In one minute #
- Freehand's system prompt is 202 words. The paper's audit puts the default instructions and tool schemas of Codex CLI at about 15.1K tokens, Gemini CLI 9.5K, Claude Code 8.5K, and Freehand 0.35K.
- It gives the model one tool, bash, with two parameters: command and an optional timeout_s. The default timeout is 120 seconds.
- The model's context is a file, transcript.json. If the model edits it, the edited version is what gets sent next.
- After each turn the harness appends one line: turn number, context size, tokens in and out, cost and minutes elapsed.
- A compaction module is in the code but off by default.
- The paper's Table 8 shows the model edits its transcript on 0.2% of short AutomationBench tasks but on 58.6% to 91.7% of tasks on the two longest benchmarks.
What the paper claims #
The arXiv paper, submitted December 1 by ten authors, says Freehand beat the first-party harness of each model (Codex, Claude Code and Gemini CLI) in all 11 model and benchmark settings it ran, by 5.1 points on average at 49% lower cost, and that the other harnesses took 17 to 62% longer in a side-by-side rerun.
It also reports the reverse for weaker models: with lower-tier models the first-party harnesses win again. On Terminal-Bench 4, GPT-6 Sol scored 34.9 with Codex and 29.2 with Freehand.
These are the authors' benchmarks. Nobody outside Microsoft has published a rerun yet.
The whole prompt is 202 words #
The prompt lives in src/freehand/prompt.md. We counted 202 words with wc -w. It describes the loop, names the one tool, explains the editable transcript, and describes the meter. It gives no rules about how to code, test or plan. Its key lines:
You are a coding agent. You run inside a minimal framework: one loop that sends
this conversation to you, executes the tools you call, and appends their results.
Nothing else is decided for you.
...
Tool: bash.
The paper's Table 1 compares the static prefix, meaning default instructions plus built-in tool schemas, across harnesses:
harness static prefix default tools
Codex CLI ~15.1K 23
Gemini CLI ~9.5K 16
Claude Code ~8.5K 22
DeepSeek Harness ~6.5K 34
OpenCode ~5.2K 10
Pi ~1.2K 4
Freehand ~0.35K 1
One tool, two parameters #
The tool schema is in src/freehand/runtime/agent.py. It is a single function named bash, which runs bash -lc in the work folder and returns combined output and the exit code:
{"name": "bash",
"parameters": {"type": "object",
"properties": {"command": {"type": "string"},
"timeout_s": {"type": "integer"}},
"required": ["command"]}}
The default timeout is 120 seconds (bash_timeout_s in config.json), and the model can pass its own timeout_s per call. The tool description tells the model to start long jobs with nohup and read the log later. Output longer than 40,000 characters is cut in the middle in the transcript (tool_output_max_chars), and the full output is saved to a file.
So Freehand is not timeout-free; it has a default the model can change. The paper's point is that the model, not a preset, makes that call.
Memory is a file the model can edit #
The runtime writes the conversation to transcript.json after every turn. If the model changes the file, through bash like anything else, the harness adopts the edit before the next call. If the API rejects the edited version, it reverts and shows the error.
After each turn the harness appends a meter line, built by status_line() in agent.py:
[harness] turn 12 | context 48,210 tokens | total in 512,004 (cached 401,880) out 9,312 | $0.84 | 6.2 min elapsed
That example line is ours, filled with made-up numbers in the code's format. The point is that the model sees its own context size and spend every turn and decides whether to prune.
The repo does ship runtime/compaction.py, a rolling-summary module adapted from the Pi coding agent, but its default is enabled: False.
What the paper's own Table 8 shows #
The headline idea is that the model manages its own memory. The paper's Table 8 counts how often it does, over one round per setting:
benchmark model tasks edited edits per task
AutomationBench GPT-6-astra 0.2% <0.01
AutomationBench Claude Opus 5.5 0.2% <0.01
Agents' Last Exam Claude Opus 5.5 6.7% 0.47
Agents' Last Exam GPT-6-astra 22.9% 0.62
Terminal-Bench 4 Claude Opus 5.5 28.6% 0.37
Terminal-Bench 4 GPT-6-astra 39.7% 0.97
TB-Science Claude Opus 5.5 58.6% 7.56
TB-Science GPT-6-astra 64.3% 5.03
OSWorld 2.1 (GUI) Claude Opus 5.5 77.8% 22.97
OSWorld 2.1 (GUI) GPT-6-astra 91.7% 25.49
The pattern follows task length. On AutomationBench, with 11 to 16 turns on average, the model edits on 0.2% of tasks; on TB-Science (63 to 110 turns) and OSWorld it edits on most of them, and on OSWorld the edits include attaching cropped screenshots. Yet the paper reports Freehand ahead on AutomationBench too, where self-editing is close to zero. That suggests at least part of the gain comes from what Freehand leaves out (a large instruction stack, dozens of tools, fixed compaction) rather than from self-editing. The paper's Table 6 ablation tests the parts separately on two benchmarks; read it before you credit any one of them.
Try it on your own tasks #
The code is MIT licensed. The runtime is 5,101 lines of standard-library Python (Python 3.9 or later) inside a 20,311-line package that adds a terminal UI, a web UI and a desktop app. The runtime is built to be copied into a task container that has only system Python.
Run it in a container or VM, since the model gets a full shell. Give it the same three or four real tasks you gave your current harness, and compare result, cost and time from the meter line. With a lower-tier model, expect your current harness to do better, as the paper found.
Who is affected #
| Case | Status |
|---|---|
| Teams building their own agent harness | A working minimal baseline to compare against, MIT licensed. |
| Users of Codex, Claude Code and Gemini CLI on frontier models | The paper reports lower scores and higher cost than Freehand in all 11 of its settings. |
| Users of lower-tier models | The paper reports first-party harnesses ahead again. |
What to do #
- Read prompt.md and the bash schema yourself; together they are under one page.
- Run Freehand in a sandbox on a few of your real tasks and compare with your current harness.
- Before adding tools or rules to your own agent, test whether a frontier model does better without them.
What is still unknown #
- Every score, cost and runtime figure is from the authors' own runs.
- We read the code; we did not run the benchmarks.
- Table 1 sizes are the paper's static audit at pinned versions; first-party harnesses change their prompts often.
- How much of the gain comes from each design choice depends on the paper's ablation, which covers two benchmarks and one model.
Sources #
- arXiv: Freehand, the bitter lesson comes to agent harnesses (Dec. 1, 2026) — the original report
- GitHub: microsoft/FreeHand (MIT)
- Freehand project page
- Freehand paper, HTML version
AI News Report· every headline, every morning.