Microsoft Research Asia's Freehand agent harness uses one bash tool and beats Codex, Claude Code and Gemini CLI by 5.1%
Microsoft Research Asia and three Chinese universities released Freehand, an MIT-licensed agent harness built on a single bash tool, a ~200-word prompt and a model-editable memory file. According to the team, it scores 5.1% higher on average than the official harnesses on frontier models and cuts per-task cost from 7.34 to 3.73. It loses to the official harnesses on mid-tier models.
Microsoft Research Asia (MSRA) has open-sourced Freehand, an agent harness that strips out long system prompts, specialized tools and fixed-threshold context compression, leaving a single bash tool. According to the research team, Freehand's average score is 5.1% higher than the official harnesses (Codex, Claude Code, Gemini CLI) across five benchmark domains and three frontier models. The report comes from Chinese-language outlet QbitAI (量子位), which covers the paper and the GitHub release.
The project is MIT-licensed, available on GitHub and PyPI, and described in arXiv paper 2612.02442. MSRA led the work with Xi'an Jiaotong University, Zhejiang University and Fudan University. Freehand is part of MSRA's AgentOpt series.
Design
The team audited Codex CLI, Claude Code, Gemini CLI, DeepSeek Harness, OpenCode and Pi through source review and API traffic capture. It found that these harnesses typically preset three things before the model sees a task:
- Strategy guidance: workflows hard-coded in system prompts of thousands of words. Gemini CLI mandates a research, strategy, execution lifecycle. Codex uses about 3.3K words to prescribe rg-first search and parallel reads. Claude Code enforces read-before-edit and repeatedly injects
<system-reminder>. - Execution interfaces: operations a terminal could handle are split into a dozen or more than thirty dedicated tools, with fixed timeouts and polling intervals.
- Memory management: history only grows, and the model cannot edit it. Context is truncated or summarized when it hits a hard 80% or 90% threshold.
Freehand cuts the initial static prefix to about 0.35K tokens, using four components:
- A roughly 200-word descriptive prompt covering the loop, the tools, memory editing and the status line. It prescribes no workflow and inserts no mid-run reminders.
- A single
bash(command, timeout_s?)tool. The model sets the timeout (default 120 seconds, range 1 to 86,400 seconds) and can wait or move a job to the background. - A native memory file,
transcript.json, holding the full conversation in native API message format. The model can rewrite it with scripts to prune logs or compress history, and can insert images as native image blocks. - A one-line meter after each turn showing turn count, context tokens, total input (cached) and output tokens, dollar cost and elapsed minutes.
The user side supports streaming Markdown in the terminal, interruption, session resume, per-turn rollback and provider switching, plus a browser interface and a desktop client.
Results
Evaluations ran in isolated Docker containers and QEMU/KVM virtual machines on Terminal-Bench 4, Terminal-Bench Science, Agents' Last Exam (ALE), OSWorld 2.1 and AutomationBench. The models were GPT-6-astra, Claude Opus 5.5 and Gemini 4 Carbon, compared against each vendor's official harness and against OpenCode, Pi and DeepSeek Harness.
Across 11 frontier-model comparison groups, the team reports:
- Average score gain of 5.1%.
- Average per-task cost down from 7.34 to 3.73 (a 49.2% reduction).
- In a five-way simultaneous rerun on the same machine and network endpoint, an average of 6.25 minutes per problem, 17% to 62% faster than the other frameworks.
Ablations indicate the gains come from removing the hard-coded workflow prompts and the specialized interfaces. The team attributes the token savings on long tasks to the model reading and trimming transcript.json itself.
Mid-tier models reverse the result
On Terminal-Bench 4, official harnesses beat Freehand with weaker models:
| Model (official harness) | Official | Freehand | Difference |
|---|---|---|---|
| GPT-6 Sol (Codex) | 34.9% | 29.2% | -5.7 pp |
| Claude Sonnet 5.5 (Claude Code) | 41.6% | 34.9% | -6.7 pp |
| DeepSeek V4.1 Flash (DeepSeek Harness) | 28.9% | 23.8% | -5.1 pp |
Limits
Freehand has no built-in sandbox and no execution approval prompts. Commands run with local user permissions, so the team advises testing inside a container or virtual machine.
The team plans to study the capability boundary where preset rules flip from crutch to cage, develop post-training methods for minimal interfaces, and extend the approach to multi-agent collaboration.
What this means
The results suggest harness design should be matched to model capability. In the team's data, preset rules help weaker models and constrain frontier ones. Teams running frontier models in long tasks have a reported cost and speed argument for a thinner harness with model-controlled memory. Teams on mid-tier models have the opposite evidence on Terminal-Bench 4. The absence of a sandbox is a practical constraint for anyone adopting it today. The figures are the authors' own evaluations, so independent replication will show how far they generalize.
Related Articles
DeepSeek releases production inference code for V4.1 Flash on Huawei Ascend chips
DeepSeek has released the production inference code it uses to run DeepSeek V4.1 Flash on Huawei's Ascend chips. The company says the system already handles substantial production traffic on Ascend 950 hardware.
OpenAI and Anthropic say unreleased models found weaknesses in cryptography that protects the internet
OpenAI and Anthropic confirmed in a joint statement that their unreleased models found weaknesses in some of the cryptography that protects the internet. The companies say the findings do not affect NIST's post-quantum standards and are not an immediate threat to the public. They are moving their own systems to post-quantum cryptography in the first half of 2027.
OpenAI claims disproof of the four-dimensional smooth Poincaré conjecture in six papers, Lean proof not yet run
OpenAI published six papers on GitHub claiming to disprove the four-dimensional smooth Poincaré conjecture, using an internal model whose name has not been made public. A Lean formal proof is included, but OpenAI noted that the Lean and Comparator tools were not run when the PR was prepared.
Anthropic publishes pretraining-loss curve, proposes pacing frontier AI on multiple capability and risk measures
Anthropic published its pretraining-loss curve on December 4, 2026 and proposed pacing frontier AI with several measures of capability and risk rather than pretraining loss alone. Jared Kaplan said a loss cap without RL limits would miss post-training gains.
Comments
Loading...