How to Run Microsoft's FreeHand Free: The AI Coding Agent With One Bash Tool
On 1 December 2026, Microsoft Research published a paper that hit number one on Hugging Face Daily Papers. The project is called FreeHand, and it is a coding agent with a deliberately shocking design: it has exactly one tool. No file editor, no search tool, no test runner, no task planner. Just bash, a short prompt, and a frontier model left alone to do the work. The harness is free and MIT licensed, and version 0.1.1 is on PyPI. This post is a tutorial. It walks you through installing FreeHand, running your first real task, and pointing it at a local model so the whole thing costs zero dollars.
Two honest facts belong in the first paragraph, not in a footnote. First, "free" describes the harness, not the model. FreeHand itself costs nothing and sends no telemetry, but the model behind it bills per token unless you run a local model. Second, FreeHand wins with frontier models and loses with smaller ones. Microsoft's own paper says that on Terminal-Bench 4, Codex with GPT-6 Sol beats FreeHand 34.9 percent to 29.2 percent, and Claude Code with Claude Sonnet 5.5 beats it 41.6 percent to 34.9 percent. If you point FreeHand at a small local model, expect worse results than that model's own harness.
What is FreeHand, and why does it have only one tool?
FreeHand comes from Microsoft Research's AgentOpt series. Its authors are Zeng, Zhao, Tian, Yang, Dai, Liu, Qiu, Zhuang, Zhu and Luo, from Microsoft Research Asia with collaborators at Xi'an Jiaotong, Zhejiang and Fudan universities. The paper is arXiv:2612.02442, submitted 1 December 2026, 31 pages, and the repository microsoft/FreeHand was created on 17 November 2026. By 5 December it had 1,872 stars and 162 forks.
The idea comes from Richard Sutton's essay "The Bitter Lesson", which argues that hand-built knowledge and clever scaffolding help weak systems in the short term and become a cage as models get stronger. Every coding agent you have used is full of scaffolding: a file-reading tool, a file-editing tool, a search tool, a test tool, a planner, a summarizer, and a pile of rules telling the model what it may and may not do. FreeHand asks what happens if you take all of it away and trust the model instead.
The answer, at least for the strongest models, is that less wins. FreeHand gives the model a descriptive runtime prompt of about 200 words, roughly 0.35K tokens, with no rules at all. It describes the environment and gets out of the way. The model builds whatever tools it needs out of shell commands: it reads files with cat, edits them with sed or a heredoc, searches with grep, and runs tests with pytest. A human developer has a terminal, not an "edit file" button in their head. FreeHand bets that a frontier model works the same way.
That bet is also why the flip side matters. A weaker model does not invent good tooling from a bare terminal. It flails, runs the wrong commands, and burns context. The first-party harnesses, with their specialised tools and guardrails, exist precisely to catch those failures. FreeHand removes the safety net, so it only pays off when the model is strong enough not to need it.
What are the four primitives?
FreeHand is built from four primitives, and only four. Everything else that other agents add is gone.
First, the prompt. About 200 words, about 0.35K tokens, descriptive rather than prescriptive, and no rules. A typical coding agent loads thousands of tokens of system instructions before it does anything. FreeHand spends almost nothing on instructions, which leaves more of the context window for your code and your task.
Second, the one tool: bash. The model gets a single tool, a shell command, and it sets the timeout for each command itself. Long jobs can be detached and checked later, so a test suite or a build does not block the whole session. If the model wants to read a file, it runs cat. If it wants to find a function, it runs grep. This is the design decision the project is named for, and it is also the reason the whole harness is so small.
Third, model-managed memory. Most agents compact the conversation automatically when it gets long, summarising the transcript behind the model's back. FreeHand does not. The model edits its own transcript.json directly, deciding for itself what to keep, what to cut, and what to summarise. Automatic compaction is available as an option, but it is off by default.
Fourth, the per-turn meter. After every turn, FreeHand shows the context size, the tokens used with the cached share, the cost, and the elapsed time. You always know exactly what a turn cost and how much context it burned.
Those four primitives are the entire product. There is no plan mode, no subagent system, no skill loader, no approval prompt, and no sandbox.
How do I install FreeHand?
You need macOS or Linux, and Python 3.10 or newer. There is no native Windows build yet, but the command line interface and the web interface both run under WSL2 on Windows, and that is the route Windows users should take. The desktop app is in beta, and its preview installers are unsigned, so your operating system will warn you about them.
Install it with the one-line script from the README, or with a package manager if you prefer:
curl -LsSf https://raw.githubusercontent.com/microsoft/FreeHand/main/install.sh | sh pip install freehand-ai uv tool install freehand-ai
The PyPI package is freehand-ai, currently version 0.1.1, and it installs a freehand command. Check it with freehand --help after installing. If the command is not found, your Python package directory is not on your PATH, which is the most common install problem, and the fix is to add it or to use uv tool install, which handles the PATH for you.
That is the whole install. There is no account to create, no server to run, and no configuration file to write before your first session. The README states that FreeHand sends no telemetry: it talks only to the model service you choose and to the MCP servers you configure yourself. For a tool that will run shell commands on your machine, that promise matters, and the MIT licence means you can read the source.
How do I run my first task?
Start with a login. FreeHand can use your ChatGPT Plus or Pro subscription, or a paid API key from OpenAI or Anthropic. Then change into a project directory, start an interactive session, and give it a task. The commands, verbatim from the README, are:
freehand login freehand login openai freehand login anthropic cd your/project freehand freehand -c freehand -p "fix the failing test"
freehand login on its own signs in with ChatGPT Plus or Pro. The other two take an API key from the provider you name. Pick the provider whose frontier model you want to use, because the model choice is the single biggest factor in how well FreeHand performs.
In an interactive session, type a task in plain language and watch it work. To continue your last session later, run freehand -c. To switch models inside a running session, type /model and pick another one. Sessions are stored as plain text under ~/.freehand/sessions/, and you can resume them or export one as HTML.
For your first real task, pick something small, visible and reversible. A good first task is a failing test in a disposable project. Create a throwaway directory, put one small Python file and one test file in it, break the test on purpose, and run FreeHand headless with freehand -p "fix the failing test".
The -p flag runs headless: it takes the task, works on it without asking you anything, prints its activity to stderr, and prints a final summary to stdout. In the log you will see the whole design in action: the model reads the files with cat, rewrites one with a shell command, runs pytest, and either fixes the next failure or reports the test green. An independent run by senn-tech on 3 December 2026 did exactly this in a fresh python:3.12-slim container with freehand-ai 0.1.1: a small task fixed after 6 rounds, test green. Their source check confirmed the tool list contains only bash, so the one-tool claim is real.
Try one more thing in that first session: interrupt it. Press Ctrl+C mid-turn and watch what happens. FreeHand supports interrupting a run, and with no approval prompts anywhere, the interrupt is your main control. Also try /undo, which restores files from snapshots taken before each turn. It is useful, but it is not a backup: files over 1 MB, gitignored paths, node_modules, .venv directories, and anything outside the project directory are not covered. Do not treat undo as a safety net for files you care about.
When you are done, try freehand web: a browser UI on your own machine, bound to 127.0.0.1, that needs a token to open.
How do I run FreeHand free, with a local model?
This is the section most readers came for, so here is the exact deal. The harness is free. The model is billed by default. Every login in the previous section means a paid subscription or a paid API key, and every turn burns tokens that someone pays for. If you want the whole stack to cost zero dollars, you need a local model, and FreeHand supports that through its provider flag.
The README's Models table says, verbatim, that "Any OpenAI-compatible Chat Completions API" works with freehand --provider openai-chat --api-base <url> --api-key-env <VAR>. Ollama serves an OpenAI-compatible API at http://localhost:11434/v1, so Ollama is the server this route uses:
ollama pull qwen3:8b export OLLAMA_API_KEY=ollama freehand --provider openai-chat --api-base http://localhost:11434/v1 --api-key-env OLLAMA_API_KEY
Then pick your local model inside the session with /model. Three details matter. First, Ollama ignores the API key, but FreeHand still wants a key variable to exist, so set OLLAMA_API_KEY to any value first. Second, the flag shape is exactly --provider openai-chat with --api-base and --api-key-env. Do not invent a --model flag; the model is picked inside the session with /model. Third, qwen3:8b is only an example. Pick a local model that fits your machine.
A small local model running through FreeHand will score worse than the same model running through its own harness. Microsoft's own numbers say so, and the reason is structural: FreeHand removes the scaffolding that small models need. So use the local route to learn the harness for zero dollars. Do not use it to judge FreeHand, and do not use it for work that matters. When you want the real performance, point the same harness at a frontier model and pay the per-token cost, which the scoreboard below shows is lower than the first-party alternatives.
Two other routes are worth knowing. GitHub Copilot works as a provider, but it is experimental: run freehand login copilot after installing the optional SDK. A LiteLLM gateway puts GPT, Claude and Gemini behind a single key, so you can switch frontier models without juggling three API keys.
How do I keep it safe? The setup that matters most
FreeHand has no sandbox and no approval prompt. Every command the model runs executes with your permissions, your files, your network access, your credentials and your environment variables, without asking. A headless run with freehand -p can run dozens of commands while you watch, or while you do not. The authors recommend a container or VM for untrusted code, and their README documents a Dockerfile for exactly that.
So the first safety rule is simple: never run FreeHand on a machine that holds real credentials. Run it in a throwaway container or VM, or at minimum in a disposable directory on a machine with nothing sensitive on it. The senn-tech run cited earlier used a fresh python:3.12-slim container, and that is the right pattern to copy. Sessions are stored as plain text under ~/.freehand/sessions/, and credentials live in ~/.freehand/auth.json at file rights 600.
The second rule is to use the two defences FreeHand ships in ~/.freehand/config.json. The first is a pre_bash hook, which sees each command before it runs and can refuse it. The second is shell_environment_policy, which can drop environment variables with KEY, SECRET or TOKEN in their names before they reach the model. Both are worth setting up, but there is an honest nuance about the second one. A source-code check of version 0.1.1 by senn-tech found that the KEY, SECRET and TOKEN exclusion list is ignored by default, and it only takes effect when you switch it on through shell_environment_policy with ignore_default_excludes set to false. Do not assume your secrets are hidden from the model just because the policy exists. Switch it on explicitly, and verify it works, before you trust it.
Here is the shape of the safety configuration in ~/.freehand/config.json. Check the README for the exact field layout in the version you install, because this file is alpha software and the shape may change:
{
"pre_bash": "a hook that sees each command first and can refuse it",
"shell_environment_policy": "drop KEY, SECRET and TOKEN variables, with ignore_default_excludes set to false"
}
Treat that block as a checklist, not a paste-ready config. The pre_bash hook is a script of your own that inspects each shell command and refuses the ones you never want run, such as anything touching your home directory or SSH keys. Set both up in the container, test them with a deliberately bad command, and only then give FreeHand a real task.
The third rule is about what you ask it to do. Do not point FreeHand at untrusted code, and do not ask it to run a repository you have not read. A prompt injection in a README, an issue, or a file the model reads can become a shell command, and there is no approval step to catch it. The safety model of this tool is you, the container, and the hooks. If any of those three is missing, do not run it.
How good is it, really? The honest scoreboard
Every score below is Microsoft's own, from the paper, across 11 settings: three frontier model families on five benchmarks. There is no independent replication yet. Treat these as the authors' claims, not as settled fact.
The headline claim is that FreeHand scored 5.1 points higher at 49 percent lower cost than each model's first-party harness, and that it was the fastest on average. The mean across the settings is a 63.2 percent score at 3.23 dollars per task and 31.7 minutes per task.
With Claude Opus 5.5, FreeHand against Claude Code, the scores are:
Terminal-Bench 4: FreeHand 61.9 percent at 3.38 dollars, Claude Code 54.9 percent at 4.91 dollars.
Terminal-Bench Science: FreeHand 55.2 percent at 8.16 dollars, Claude Code 54.3 percent at 12.86 dollars.
Agents' Last Exam: FreeHand 66.5 percent at 1.16 dollars, Claude Code 62.2 percent at 2.29 dollars.
OSWorld 2.1: FreeHand 80.1 percent at 2.09 dollars, Claude Code 74.9 percent at 7.49 dollars.
AutomationBench: FreeHand 54.4 percent at 0.19 dollars, Claude Code 47.9 percent at 0.27 dollars.
The same pattern holds for the other two model families. With GPT-6-astra against Codex, FreeHand leads on all five benchmarks, including OSWorld at 76.2 percent and 3.96 dollars against 68.3 percent and 14.94 dollars. With Gemini 4 Carbon against Gemini CLI, Terminal-Bench 4 is 57.1 percent at 8.76 dollars against 49.5 percent at 13.72 dollars. In every row, FreeHand scores higher and costs less.
Now the flip side, which the authors published themselves. With lower-tier models, the order reverses. On Terminal-Bench 4, Codex with GPT-6 Sol scores 34.9 percent against FreeHand's 29.2 percent. Claude Code with Claude Sonnet 5.5 scores 41.6 percent against FreeHand's 34.9 percent. The DeepSeek harness with DeepSeek V4.1 Flash scores 28.9 percent against FreeHand's 23.8 percent. FreeHand is a frontier-model tool. The free local route is for learning, and the paid frontier route is where the wins in the table actually live.
Two more caveats. FreeHand is alpha software, version 0.1.x, with no native Windows build yet. And every number above comes from the authors, with no independent replication. If you try FreeHand, run your own comparison first: the same task through FreeHand and your current harness, on the same model. The per-turn meter makes that easy, and your own numbers will tell you more than any table.
How does FreeHand compare to other free AI tools on RiseMe?
FreeHand is the first agent harness RiseMe has covered, and it sits neatly next to the free models and agent setups from the last few weeks. Our Flint 1.1 tutorial shows a free coding model you can run locally, and it is a natural model to point FreeHand at for the zero-dollar route, keeping in mind the flip side above. Our Qwen4 tutorial covers a 35B model with a 1-million-token context, which is the kind of large local model that makes a one-tool harness more interesting.
If you want to build an agent rather than run one, our n8n Nod tutorial sets up a personal agent that works with your files and apps through a chat interface, and it also runs free with a local Ollama model. The contrast is instructive: n8n Nod gives the model a whole workshop of connected tools, while FreeHand gives it one shell and trusts it to build the rest.
And if you want to see a model act on a screen instead of a terminal, our Sico-GUI tutorial covers Microsoft's free GUI agent that taps and types on an Android phone.
FAQ
Is FreeHand really free?
The harness is free. It is MIT licensed, there is no subscription, and the README says it sends no telemetry. The model is a separate cost. A ChatGPT Plus or Pro login, or a paid API key, bills per token or per subscription. The only zero-dollar route is a local model through Ollama, as shown above, and that route trades performance for price.
Can I run it on Windows?
Not natively yet. The command line and web interfaces run under WSL2, and the desktop app is in beta with unsigned preview installers.
Which model should I use with it?
A frontier model. The paper's wins are all with Claude Opus 5.5, GPT-6-astra and Gemini 4 Carbon, against those models' own first-party harnesses. With smaller models the order reverses, and FreeHand scores lower than the model's own harness.
Is it safe to run on my main computer?
No. FreeHand has no sandbox and no approval prompt, so every command runs with your permissions and your environment variables. Run it in a container or a VM, or in a disposable directory on a machine with nothing sensitive on it. Remember that the KEY, SECRET and TOKEN exclusion list is off by default until you switch it on.
How is it different from Claude Code or Codex?
Those harnesses give the model many specialised tools, a planner, rules, and automatic compaction. FreeHand gives it one bash tool, a 200-word prompt, model-managed memory, and a per-turn meter. With a frontier model, Microsoft's numbers say the simpler harness scores higher, costs less, and runs faster.
What can it actually do with only bash?
Everything a developer does at a terminal: read files, edit them, search a codebase, run tests, build a project, install packages, and chain commands together. The model builds its own tools out of shell commands. It can also detach long jobs and check them later.
Where do my sessions and credentials live?
Sessions are plain text under ~/.freehand/sessions/, and credentials live in ~/.freehand/auth.json at file rights 600. The web interface binds to 127.0.0.1 and needs a token.
Is the benchmark table trustworthy?
It is Microsoft's own table, from the authors' paper, with no independent replication yet. The headline is a 5.1 point lead at 49 percent lower cost across 11 settings, with a mean of 63.2 percent at 3.23 dollars per task. Run your own comparison on a task you care about before you switch.
Sources
FreeHand repository, GitHub
FreeHand paper, arXiv:2612.02442
freehand-ai on PyPI
FreeHand documentation site
Repo of the Day: FreeHand, the Microsoft harness that beats Claude Code with one bash tool, Jorge Turbica
Microsoft FreeHand: One Bash Tool Harness, senn-tech
Microsoft FreeHand and the Bitter Lesson agent harness, ExplainX
Keep reading on RiseMe
How to Make a Free AI Agent Use Your Android Phone: Microsoft's Sico-GUI
How to Run Alibaba's Qwen4 Free: The 35B AI With a 1-Million-Token Memory
How to Set Up Your Own Free AI Agent With n8n Nod
How to Use Flint 1.1 Free: The Coding AI
Run AI on Your Own PC: Ollama Tutorial


