What is Freehand?
Freehand is an open-source agent harness from Microsoft Research, released with the paper "Freehand: The Bitter Lesson Comes to Agent Harnesses" (arXiv:2612.02442). It sits in the Autonomous Coding Agents category of the AI Coding tools and is open-source, written in Python and licensed MIT. To get started: install.
Overview

Freehand is an open-source agent harness from Microsoft Research, released with the paper "Freehand: The Bitter Lesson Comes to Agent Harnesses" (arXiv:2612.02442). Its idea is the opposite of most coding agents: instead of detailed instructions, a fixed tool suite, preset timeouts and automatic compaction, Freehand gives a frontier model a runtime prompt of about 200 words, a single `bash` tool and control over its own context, and lets the model decide the rest.
After every turn the model sees a meter with its context size, token usage (including the cached share), cost and elapsed time. It sets its own command timeouts, can start detached jobs, and prunes its own history through bash. Automatic compaction exists but is off by default. The authors argue that fixed harness rules help weaker models but hold frontier models back, and the paper reports that with lower-tier models the first-party harnesses do better again.

In the paper's tests across five domains and three frontier model families, Freehand outscored each model's first-party harness (Codex, Claude Code, Gemini CLI) in all 11 settings, by 5.1 points on average at 49% lower cost. These are the authors' own results. The project is MIT-licensed, written in Python, and marked alpha: it has no sandbox and runs commands with your permissions. It runs on macOS and Linux, with the CLI and web UI also working under WSL2.
What it does
- A minimal model-facing setup: a ~200-word runtime prompt and one `bash` tool, with command timeouts set by the model and support for detached jobs
- The model manages its own context; automatic compaction is available but off by default
- A per-turn meter showing context size, token usage with cached share, cost and elapsed time
- Three interfaces over the same sessions: a terminal UI, a browser UI (`freehand web`) and a beta desktop app
- Sessions with resume, per-turn undo, interrupt, model switching, streaming Markdown and HTML export
- Headless mode (`freehand -p`) that writes activity to stderr and the final summary to stdout, for scripts and CI
- Works with OpenAI (ChatGPT Plus/Pro sign-in or API key), Anthropic, experimental GitHub Copilot, and any OpenAI-compatible Chat Completions endpoint, including gateways such as LiteLLM
Getting started
Freehand needs Python 3.10+ on macOS or Linux (WSL2 works for the CLI and web UI). It has no sandbox, so run it in a project you are comfortable letting the model change.
Install
Use the install script, or install the `freehand-ai` package with pip or uv.
curl -LsSf https://raw.githubusercontent.com/microsoft/FreeHand/main/install.sh | sh
# or
pip install freehand-ai
# or: uv tool install freehand-aiSign in to a model provider
OpenAI is the default: sign in with a ChatGPT Plus or Pro plan, or pass an API key. Anthropic is also supported.
freehand login # Continue with ChatGPT (Plus or Pro)
freehand login openai # or an OpenAI API key
freehand login anthropic # then run: freehand --provider anthropicStart a session in your project
Run Freehand inside the directory you want it to work on. `-c` continues the last session in that directory.
cd your/project
freehand
freehand -cRun it headless or in a browser
`-p` runs one task without the interactive UI; `freehand web` opens the same sessions in a browser window.
freehand -p "fix the failing test"
freehand webUse another endpoint
Any OpenAI-compatible Chat Completions API works through the `openai-chat` provider.
freehand --provider openai-chat --api-base <url> --api-key-env <VAR>Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Run a frontier model on long coding, terminal or research tasks with less harness overhead and a lower token bill
- Compare a model's raw ability against first-party harnesses such as Codex or Claude Code on your own tasks
- Script one-shot agent jobs in CI with headless mode, reading the final summary from stdout
- Study harness design: a small, readable baseline for testing which harness rules still help a given model
How Freehand compares
Freehand alongside other open-source autonomous coding agents tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| opencode | ★ 231k | OpenCode is an open source AI coding agent that runs in your terminal, with built-in build and plan agents and an optional desktop app. |
| Claude Code | ★ 158k | Anthropic's agentic coding tool for the terminal, IDE and GitHub: it understands your codebase, executes routine tasks, explains code and handles git workflows from natural-language commands. |
| Orca | ★ 154k | Open-source desktop workspace that runs Claude Code, Codex, OpenCode and other CLI coding agents in parallel, each in its own git worktree, with a mobile companion app. |
| OpenAI Codex | ★ 137k | OpenAI's cloud and CLI coding agent that writes features, fixes bugs, and proposes code changes across a repo, running tasks in parallel. |
| Pi | ★ 125k | Minimal terminal coding agent harness with four built-in tools, extended through TypeScript extensions, skills and prompt templates instead of forks. |
| Gemini CLI | ★ 110k | An open-source command-line AI agent from Google that connects your terminal to Gemini models for reading code, editing files, running shell commands, and searching the web. |
| autoresearch | ★ 101k | Karpathy's minimal harness that hands a coding agent a single-GPU LLM training script and lets it run fixed five-minute experiments, keeping or discarding each change on its own. |
| Freehand | — | Microsoft Research's minimal agent harness that leaves the decisions to the model |
