Microsoft FreeHand, hands-on: the agent harness that lets the model decide everything
Microsoft Research's FreeHand hands the model one bash tool, its own memory, and a cost meter — and beats Codex, Claude Code, and Gemini CLI on every benchmark it ran. Install it, point it at any model, and run your first task.
- Why now: paper Dec 1 (
arXiv:2612.02442);freehand-ai0.1.2 released Dec 4; 1,753 stars, created Nov 17. - The result: highest score and lowest cost in all 11 settings; +5.1 points at 49% lower cost vs the first-party harnesses.
- Verified here: pip install to 0.1.2;
doctor,status, web UI; Ollama + Qwen2.5-1.5B-Instruct local path; three-step headless demo, tests pass. - The catch: built for frontier models — with lower-tier models the first-party harness wins; small local models need one command at a time.
- Cost: free — no account needed for the local path; the frontier path needs a ChatGPT plan or an API key.

Every coding agent you have used decides a remarkable amount on your behalf before it ever sees your task. The system prompt tells it how to approach the problem. The tool list tells it how to act. A fixed timeout decides how long a command may run, and an automatic compaction threshold decides what it is allowed to remember. For a weak model those presets are a crutch. For a frontier model, Microsoft Research argues, they are a cage — and the paper to prove it landed on December 1. FreeHand, the harness from that paper, gives the model about 200 words of runtime description, one tool, control over its own memory, and a meter showing context, tokens, cost, and elapsed time. Then it gets out of the way. Across five benchmarks and three frontier model families it scored highest and cost least in every setting the authors ran, and it did it with the smallest harness ever shipped by a major lab: a shell, a transcript, and a meter.
This tutorial installs FreeHand, connects it to a model three ways — a ChatGPT sign-in, an API key, and a local model running on your own machine — and runs a first task end to end, with every command and every output verified in a sandbox for this article. You will also see where the design breaks down: it is built for frontier models, and the paper is unusually honest about what happens when you point it at a small one.
What you’ll need
macOS or Linux — the CLI and the web interface run on both, and under WSL2 on Windows; native Windows support is listed as coming soon. Python 3.10 or later for the PyPI install, or no Python at all if you use the install script, which fetches uv and its own Python 3.12. No GPU, no Docker, no local model unless you want the free local path in Step 3. For the frontier path you need either a ChatGPT Plus or Pro plan (the sign-in counts against your plan, not API billing) or an API key from OpenAI or Anthropic. The whole tutorial costs nothing if you use the local path, and the local model used here — Qwen2.5-1.5B-Instruct, 1.1 GB — runs on a CPU.
One thing to understand before you start: FreeHand has no sandbox and asks for no approval before running a command. Every command runs with your permissions, your files, your network, and your environment variables. The README says this in plain language and tells you to use a container or VM for code you do not trust. Treat that as a requirement, not a suggestion: run FreeHand in a directory you can afford to lose, or inside a disposable container, and never point it at a repository containing credentials or untrusted instructions until you have read the security notes in the final section.
The idea: one tool, its own memory, a meter
Mainstream harnesses — Codex, Claude Code, Gemini CLI, OpenCode, Pi — hand the model a long system prompt full of rules, twenty or more preset tools, runtime reminders, and automatic compaction at a fixed context threshold. FreeHand hands it a runtime description of about 200 words and one bash tool, from which the model builds whatever it needs. The model sets each command’s timeout and can run jobs detached. It prunes its own history: the editable transcript lives in a file the model can rewrite, and automatic compaction exists as an option that is off by default. Before a task begins the model sees about 0.35K tokens and one tool; after every turn it also sees its own meter — context size, tokens with the cached share, cost, and elapsed time.

The human-facing side is complete even though the model-facing side is minimal: a terminal interface with streaming Markdown, interrupt, sessions and resume, per-turn undo, model switching, and cost and context display; a browser interface with the same sessions; and a desktop app in beta for macOS and Linux. Sessions persist, can be forked, exported as a self-contained web page, and inspected turn by turn. The bet behind all of it is the paper’s title — the Bitter Lesson applied to agent harnesses. As models grow stronger, the best harness is the one that decides the least.
The numbers: what the paper actually measured
The paper, arXiv:2612.02442, submitted December 1, 2026, runs FreeHand against the first-party harness of each model — Codex, Claude Code, Gemini CLI — plus OpenCode, Pi, and DeepSeek Harness, across five benchmarks and three frontier model families: GPT-6-astra, Claude Opus 5.5, and Gemini 4 Carbon. Eleven settings in total. FreeHand had the highest score and the lowest cost in every one, and the shortest mean time per task. The headline aggregates: 5.1 points higher at 49% lower cost than the first-party harnesses on average, and in a controlled side-by-side rerun on the same machines and API endpoints, each of the other harnesses took 17–62% longer. The README’s own summary figure puts the mean at a 63.2% score, $3.23 per task, and 31.7 minutes per task.
| Benchmark | Model | FreeHand | First-party harness |
|---|---|---|---|
| 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 |
| Terminal-Bench 4 | Gemini 4 Carbon | 57.1% · $8.76 | Gemini CLI 49.5% · $13.72 |
| Agents’ Last Exam | GPT-6-astra | 67.5% · $1.92 | Codex 63.6% · $4.45 |
| OSWorld 2.1 | Claude Opus 5.5 | 80.1% · $2.09 | Claude Code 74.9% · $7.49 |
| AutomationBench | GPT-6-astra | 49.5% · $0.56 | Codex 44.8% · $0.89 |
Read the fine print before you switch, because the paper prints it. With lower-tier models the order reverses: on Terminal-Bench 4 the first-party harness scores higher with GPT-6 Sol (Codex 34.9% vs 29.2%), Claude Sonnet 5.5 (Claude Code 41.6% vs 34.9%), and DeepSeek V4.1 Flash (DeepSeek Harness 28.9% vs 23.8%). FreeHand is built for frontier models; with a smaller model, that model’s first-party harness may serve you better. That caveat is not a footnote in the paper — it is the mechanism. The harness decides almost nothing, so the model has to be good enough to decide for itself. Keep it in mind in Step 4, where a 1.5-billion-parameter local model demonstrates the failure mode in person.
Step 1: Install FreeHand
The fastest path is PyPI. Python 3.10 or later, in a virtual environment so the tool does not pollute your system Python:
python3 -m venv ~/.venvs/freehand
source ~/.venvs/freehand/bin/activate
pip install freehand-ai
freehand --version
The last command should print freehand 0.1.2 — the version released on December 4, two days after the v0.1.0 and v0.1.1 preview releases on December 3. The other install path is the shell script, which installs uv if it is missing and then FreeHand with its own Python 3.12:
curl -LsSf https://raw.githubusercontent.com/microsoft/FreeHand/main/install.sh | sh
Either way, confirm the install with the offline self-check, which makes no API calls:
freehand doctor
On the sandbox used for this tutorial it reported git 2.43.0, the shell, the proxy settings, and editor=unset, clipboard=none, node=yes, with one expected failure: credentials — not configured, because no sign-in had been added yet. That is the next step. Check the sign-in state at any time with freehand status, which lists the ChatGPT sign-in, saved API keys, and the provider new sessions will use.
Step 2: Sign in — three ways, pick one
FreeHand supports four providers, and the sign-in depends on which one you choose. The default is OpenAI’s Responses API, reached either through a ChatGPT sign-in or an API key:
freehand login # Continue with ChatGPT (Plus or Pro)
freehand login openai # or save an OpenAI API key
freehand login anthropic # or save an Anthropic API key
The key is asked for interactively, never as a command-line argument, and is kept in ~/.freehand/auth.json with mode 0600. Environment variables work too: OPENAI_API_KEY or ANTHROPIC_API_KEY are picked up without any login step. For Claude models you need an API key — a Claude subscription cannot be used. A GitHub Copilot sign-in is available as an experimental option, and a LiteLLM gateway can put GPT, Claude, and Gemini behind one key; the gateway setup is documented in the project’s docs/gateway.md. The sign-in commands were not run for this tutorial — the sandbox has no ChatGPT plan and no API key — but the local path in the next step needs no sign-in at all, and that is the path the demo uses.
Step 3: Point it at a local model
FreeHand talks to any OpenAI-compatible Chat Completions endpoint, which means a local server works with no account and no key. This tutorial verified the path with Ollama and a 1.5-billion-parameter instruct model, Qwen2.5-1.5B-Instruct, served as a GGUF file. Pull it and confirm it is there:
ollama pull qwen2.5:1.5b
ollama list
Then tell FreeHand about the endpoint. All settings live in ~/.freehand/config.json (or $FREEHAND_HOME/config.json); the file is plain JSON, and a malformed file stops FreeHand at startup with the line and column of the mistake, so check it after editing:
{
"provider": "openai-chat",
"model": "qwen2.5:1.5b",
"api_base": "http://127.0.0.1:11434/v1",
"api_key_env": "FH_LOCAL_KEY",
"max_output_tokens": 512
}
The api_key_env names the variable that signs requests; for a local server the value can be anything, so set a dummy before you run:
export FH_LOCAL_KEY=dummy-no-key
Two settings in that file deserve explanation, because both were set for a reason. max_output_tokens: 512 caps each turn’s output: on a two-core sandbox a 1.5B model generates roughly 10–15 tokens a second, and the default cap of 128,000 tokens would let a rambling turn run for a very long time. And provider: openai-chat is what makes api_base apply — the settings belong to the provider named in the same file, and a session started with a different --provider does not take them. The same file can carry request_extra, extra fields sent with every request; note that the local server used in testing ignored the enable_thinking: false extra for Qwen3, so thinking models still think. An instruct model sidesteps the issue entirely, which is why the demo uses one.
Step 4: Run your first task, headless
FreeHand’s -p flag runs one task without the interactive UI: activity goes to stderr and the final summary to stdout. Run it from inside a scratch directory, one command per invocation. That matters with a small local model, as you are about to see. First, create the file:
freehand -p "Use the bash tool to run this exact command and nothing else: printf 'def word_count(text):
return len(text.split())
' > word_count.py. Report the command's exit status."
Then the test file:
freehand -p "Use the bash tool to run this exact command and nothing else: printf 'from word_count import word_count
assert word_count(\"hello world\") == 2
assert word_count(\"one\") == 1
assert word_count(\"\") == 0
print(\"all tests passed\")
' > test_word_count.py. Report the command's exit status."
Then run the tests:
freehand -p "Use the bash tool to run this exact command and nothing else: python3 test_word_count.py. Report the exact output."
The three files this produces are exactly 51 and 155 bytes, and the third command prints all tests passed and exits 0 — verified by running the tests outside FreeHand as well. That is the whole loop working: the model calls the one tool it has, the command executes with your permissions, the result comes back, and the session is recorded under ~/.freehand/sessions/ with its transcript, prompt, and a journal of every turn.

Now the honest part. The demo above is written as three one-command runs for a reason: the open-ended version of this task — “create the files and run the tests” in a single prompt — failed four times in the sandbox with two small local models. Qwen3-0.6B replied that no tools were needed, created nothing, and reported that the tests had passed. Qwen2.5-1.5B-Instruct called the tool once, tried to run the tests on files that did not exist, and then printed the code in its reply instead of writing it. A heredoc version mangled the file contents, turning four spaces of indentation into the literal words “four_spaces =”. The printf form above is the version that survived: one line, nothing to reformat, nothing to plan. With a frontier model you can hand FreeHand the open-ended task and watch it plan the steps itself — that is the use the paper benchmarks. With a 1.5B local model, give it one command at a time and check the files after each step; the model’s own summary is not reliable evidence, and in testing it claimed success when files were missing and failure when a fix had worked. Trust the filesystem and the tool output, not the summary.
Step 5: The web UI, sessions, and undo
The same sessions run in a browser window with freehand web, which prints a token URL on 127.0.0.1 and serves this machine only. Verified in testing: opening the bare address without the token returns a 403 with the message “Open Freehand with the address freehand web printed; this one carries no sign-in.” The desktop app in beta shares those sessions and settings, so a session started in the terminal continues in the app.
Inside a session, the commands that matter most are the safety net. /diff shows what changed since your last message, /undo restores the files to before one of your messages one turn at a time, and /export saves the session as a self-contained web page. freehand sessions lists them, with export and delete, and freehand gc reclaims disk under ~/.freehand. The model also edits its own context: the transcript is a file, and if you rewrite it the model uses your version next turn. That is the entire memory system — no hidden compaction, no vector store, just a file the model manages.
When to use FreeHand vs the alternatives
Use FreeHand when the model is strong and the task is open-ended: a frontier model, a real codebase, a task you would describe in a sentence rather than a checklist. That is the setting the paper measured, and the margins there are large — 5.1 points and roughly half the cost against the first-party harnesses. Use the first-party harness — Codex, Claude Code, Gemini CLI — when the model is a lower tier, or when you want guardrails: preset tools, fixed timeouts, and automatic compaction are exactly the safety net a weaker model needs, and the paper’s own numbers show them winning there. Use OpenCode or Pi when you want a fuller harness with more built-in tools and are willing to pay the token cost for them. Use a local model behind FreeHand when you want the loop without an account — for learning the harness, for offline work, for tasks where the model’s mistakes cost nothing — and accept that you will be driving it one command at a time.
Two more things before you commit. First, FreeHand loads AGENTS.md files and skills from folders you have trusted, and repository content is untrusted input — a malicious AGENTS.md in a cloned repo is instructions from a stranger, so only trust folders you control. Second, there is no approval step and no sandbox, so the practical boundary is the directory you launch it in: a scratch directory, a container, or a VM for anything you would not run by hand.
What was verified, and what wasn’t
Run verbatim in a sandbox for this tutorial: pip install freehand-ai (version 0.1.2), freehand --version, --help, doctor, status, and freehand check against the local Ollama backend, which passed every check — three models listed, an agent run done after two model calls, a bash tool call accepted and executed, 205 streaming events, 1,845 input tokens with 1,004 cached. Also verified: the freehand web token URL and its 403 without one, the Ollama connection (ollama serve, model listing, a qwen2.5-1.5b-local model built from the Qwen2.5-1.5B-Instruct Q4_0 GGUF, 1,066,227,232 bytes), and the three-step headless demo above, with the files and the test run checked independently. The local-model failures — the skipped steps, the dropped lines, the hallucinated summaries — are also from those runs, not from the docs. Not run here, because the sandbox has no account or key: the ChatGPT sign-in, the OpenAI and Anthropic API-key paths, the Copilot sign-in, the LiteLLM gateway, and the desktop app. The benchmark numbers come from the paper and the README table, not from local runs, and the frontier-model behaviour — one open-ended prompt, the model planning the steps — is the paper’s claim, flagged as such. If you run it with a frontier model, the first thing to check is whether the open-ended version of the Step 4 task works in one prompt; on a small local model it does not.
The takeaway
FreeHand is the smallest possible answer to a real question: how much harness does a frontier model actually need? The paper’s answer — a shell, a transcript it can edit, and a meter — is backed by the largest margins in the current round of harness comparisons, and the tool itself is a fifteen-minute install. The catch is the same as the pitch: the harness decides almost nothing, so everything depends on the model. Point it at a frontier model and it is the fastest, cheapest harness in the paper’s tables. Point it at a 1.5B local model and you will be writing its commands for it, one printf at a time. Both outcomes are the design working as intended — which is why the first thing to do after installing it is not to benchmark it, but to give it a task and watch what it decides to do. If it plans the steps, checks its own work, and stops when it is done, you have found your harness. If it skips the file creation and reports success anyway, you have found its floor — and the paper told you that floor was there.
Sources: the FreeHand repository (github.com/microsoft/FreeHand), its usage and configuration documentation, the paper “Freehand: The Bitter Lesson Comes to Agent Harnesses” (arXiv:2612.02442), the freehand-ai package on PyPI (version 0.1.2), and the project’s GitHub releases. Star counts, release dates, and benchmark figures are as observed on December 4, 2026. The install, local-model setup, web UI, and three-step demo were run in a sandbox for this tutorial; the frontier-model paths and the benchmark results are as documented by the project.