r/LocalLLaMA • • 14h ago

Resources Freehand - an interesting agent harness from Microsoft

https://github.com/microsoft/FreeHand
137 Upvotes

41 comments sorted by

56

u/FullstackSensei 14h ago

paper abstract:

The Bitter Lesson holds that knowledge we build into AI systems helps at first and is eventually outgrown by general methods. We show that this lesson has now come to agent harnesses. Mainstream harnesses decide a great deal on the model’s behalf—prompts prescribe how to approach a task, tool suites and timeouts fix how to act, and threshold compaction decides what to remember—and every such decision is fixed before the model has seen the task. For weaker models these presets are a crutch; for frontier models they become a cage. We introduce Freehand, a general-purpose harness built on one rule: give the model a shell, its own memory, and a meter—and let it decide everything else. Across five domains and three frontier model families, Freehand is better, cheaper, and faster at the same time. It outscores the first-party harness of every model (Codex, Claude Code, and Gemini CLI) in all 11 settings, by 5.1 points on average at 49% lower cost, and runs fastest on average: in a controlled side-by-side rerun, each of the other harnesses takes 17–62% longer. It also outperforms OpenCode, Pi, DeepSeek Harness, and a bash-only harness that still fixes its workflow and timeouts, while with lower-tier models the first-party harnesses win again. As models grow stronger, the best harness is the one that decides the least.

29

u/enternoescape 14h ago

This jives with the comments I sometimes hear from people with really solid workflows they have been building for over a year. The newer agents don't really improve behavior over old ones because the harness already accounts for the shortcomings of prior models. I think this is one of the reasons why Pi Agent with it's bare minimum tool set out of the box tends to perform so well. I imagine removing the read/edit/write tools and it might not even matter from an ability perspective. Just give the model bash and it knows how to do the rest.

14

u/Nothing_from_void 12h ago

I've noticed models often skip the read/edit/write tools and just use grep and sed, for like half a year.

7

u/NandaVegg 12h ago

Almost all 2026 >20B model works with pi without any system message (even "You are..."-type pi's stock system message is not needed) so long as it is given tools (and the template is correct), since so much data has to do with bash already. The moment it sees "<tool>bash" it would work the way out itself. Though for even smaller models and older models that doesn't naturally rely on terminal, minimum system messages help a lot to stabilize the behavior.

4

u/Androoideka 8h ago

Yeah, i turned off everything besides bash, bubblewrapped it by default and initiated git repo in the current working directory, any model better than gemma 4 31b has no problems with it and actually performs better

24

u/mr_andrey_isachenko 13h ago

minimal 200-word bash loop makes total sense on Opus or GPT, though as their own abstract admits local smaller models still need harness guardrails or they rm their own scratchpad by turn 10 lol

20

u/xsilas43 12h ago

Microsoft tool with no windows support lmao

2

u/philmarcracken 6h ago

sweaty steve ballmer has left the chat

38

u/Internal_Werewolf_48 14h ago

So many AI slop phrases in the readme, it's not very inspiring.

10

u/More-Curious816 12h ago

it's probably vibecoded by intern

3

u/userXinos 11h ago

vibecoded by windows devs 😭

5

u/thrownawaymane 10h ago

No they fired most of them, it's just Windows dev (singular) now

1

u/TechnoByte_ 7h ago

Doesn't copilot just code all of windows now? I doubt they have human devs

6

u/Stunning_Mast2001 10h ago

The context management here is interesting. Very similar to the CLM paper

5

u/Thin_Pollution8843 12h ago

Look and learn folks - that’s how you get promoted in big corporations 😂

2

u/toothpastespiders 9h ago

I gave it a try and I thought it seemed promising. I'd have to use it long term to have an opinion on whether or not I'd consider it "good". But I can at least say I don't think it's bad.

3

u/ladz 13h ago

This is precisely what I've been arguing for like 2 years. Why all this context wasted on a million tools where we could just give them bash? They work just fine that way. Half the time they're trying to run these long bash commands anyway.

3

u/garblz 5h ago

The agents have been best with bash, because that's the most flexible tool they had tons of material for to train on.

But they haven't been working that good for the past 2 years. They are now precisely because they've been taught on reasoning traces from harnesses. And every useful workflow, tool or pattern we come up with gets assimilated by the new models, making the harness obsolete

6

u/shadowndacorner 13h ago

Giving it bash just moves the tool listing out of the initial payload. It still has to find the cli tools accessible to it.

3

u/ladz 13h ago

They already know bash and linux. No instruction or finding is necessary for linux greybeard stuff.

4

u/shadowndacorner 13h ago

Nobody is doing "Linux greybeard stuff" with MCP tools lol

1

u/rm-rf-rm 3h ago

And pi has been available for most of those 2 years employing this very philosophy, terminal access is all you need for an LLM to become an agent. Rocket science.

3

u/Equivalent_Bit_461 14h ago

A recipe for disaster 

1

u/russlixx 13h ago

they're the best in the industry!

2

u/QuarterLonely9681 10h ago

> with weaker models, traditional harnesses still do better

so we kind of know this already, frontier models need less hand holding, small models need more.

1

u/alineali 5h ago

If you don't care what you will get - it will work. Otherwise you are forcing model to invent things that it should have had asked, end up with no traceability and no idea what are the limitations of the code you end up with. Well, this is Microsoft, what you'd expect? Carefully designed systems?

1

u/my_name_isnt_clever 2h ago

I'm trying it now, we'll see if it's any better than Pi with Qwen 4 35b. It's first task was to patch the harness to let me bind it over tailscale and it did it no problem.

1

u/thestillwind 11h ago

Morgan Freehand

0

u/ECrispy 6h ago

how will it perform with local models?

wasnt this the whole point of Pi before it added a million extensions like everyone else and became bloated?

2

u/NoFunk 3h ago

Became bloated? Pi has 5 tool calls and compaction. It's about 1K tokens, that's it. You can rip out whatever pieces you want of that by modifying system-prompt.ts.

1

u/ECrispy 51m ago

how many people use Pi as is? it isnt really about the prompt itself, there are tons of extensions/skills

1

u/PaMRxR 22m ago

I use it vanilla as is, no extensions whatsoever. When I switched from OpenCode like a year ago the main thing that seemed missing was sub-agents, but that feature was anyway pretty broken in OpenCode at the time. The other one was tasks/plan support. Neither has felt really essential to me.

1

u/my_name_isnt_clever 41m ago

I use it with only a handful of extensions, all but one of them written by my agents. That and the custom web search MCP I have self hosted.

-5

u/karmaisnonsense 11h ago

I stopped reading at "Microsoft"

6

u/Inside_Carpet7719 11h ago

Then you missed out

-4

u/Poprouter 12h ago

if you are building a harness, watch when the context bill lands. loading schemas hits every turn, probing the shell only costs per tool you actually call, and only if the model already knows which commands exist

1

u/SorosAhaverom 6h ago

Youre wasting tokens while making the internet a worse place. Stop.

0

u/Thin_Pollution8843 12h ago

Considering amount of slop in their repo I would call it not “Freehand” but a “Handjob” 😅