r/ClaudeCode • • 10h ago

Tips & Workflows Microsoft paper finds that frontier agents score higher at lower cost when the harness gives them only a shell and stops deciding for them. Freehand beat each model's own first-party harness every time, by 5.1 points on average at 49% lower cost.

Post image

Microsoft paper finds that frontier agents score higher at lower cost when the harness gives them only a shell and stops deciding for them.

Harnesses like Codex, Claude Code, and Gemini CLI wrap models in long prompts, 20+ tools, fixed timeouts, and automatic memory compaction. These presets fix choices before the model even sees the task.

They built Freehand: 1 bash tool, a chat history the model can edit, and a meter of tokens, cost, and time. Its prompt is about 200 words and sets no workflow.

Across 11 settings in 5 domains, Freehand beat each model's own first-party harness every time, by 5.1 points on average at 49% lower cost. With lower-tier models, the first-party harnesses won by 5.1 to 6.7 points.

https://arxiv.org/abs/2612.02442

754 Upvotes

86 comments sorted by

•

u/AutoModerator 10h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

90

u/DukeMo 10h ago

I'll have to give it a read but most of the benefit of the harness is to make sure everything doesn't go to shit when things don't work correctly and or when your agent tries to do things outside of the boundary it's supposed to be in.

31

u/thomheinrich 10h ago

Benchmarks run in disposable sandboxes too, guardrails only matter on real repos.

7

u/TinyZoro 9h ago

You can run repos on disposable sandboxes too

11

u/thomheinrich 9h ago

Fair for isolated unit-test repos. Gets messier once the task needs staging credentials, internal APIs, or cloud state you can't cheaply spin up per run.

9

u/TempLoggr 9h ago

Im running all my agents in containers with the repo mounted. They have git so they can see the history and make commits. But they do not have credentials so accidental push or pull.

That im manually doing outside of the container.

3

u/TinyZoro 8h ago

This stuff will become the default way harnesses work eventually. Running agents raw on the machine will seem crazy work. Even things like computer use will mean a dedicated sandboxed OS.

5

u/beerdude26 4h ago

It all goes back to thin clients running on mainframes in the end lol

2

u/codeedog 🔆 Max 5x 1h ago

In 1967, my father started a computer time share business with one HP mainframe and teletype machines (those yellow paper infinite roll feeds) and dial-up modems at 110 baud rate. He hired a staff of programmers coding in BASIC to write accounting, inventory management, and other business software and peppered the Philadelphia tri-state area with those machines for a 100+ customers.

Essentially, he built a regional SaaS cloud.

The PC revolution destroyed his business.

We have been forever bouncing between compute at the hub and compute at the edge.

2

u/beerdude26 1h ago

Blade servers were pretty fucking Cyberpunk tho

2

u/codeedog 🔆 Max 5x 1h ago

They were. I forget the exact number but I think it had 37 (or some odd number) of toggle switches and a load button. For a power outage, you’d have to reload core memory (literal ferrite cores holding a magnetic charge) with a program that taught the machine how to find and read the teletype machine with a paper tape reader (those hole punch tapes). You’d bootstrap a series of tapes (2 or 3) that’d add more and more capabilities until it could read one of the washing machine sized disk drive platters where the full operating system and company software would be loaded and run.

The employees including my father would monitor electrical storms and someone would be on call to head to the basement of the building where the company was located to run the restart.

They also built some hardware devices.

That place was amazing for me as a kid. The electrical smell…

1

u/CWRau 6h ago

Why manually? Why not via harness or mcp?

2

u/TempLoggr 3h ago

For now I only run the agents in LXC containers, so I just need `git push`from a regular terminal as my host and the container share just that mount.

As the agents are running in whole OS systemcontainer they have free rein to do whateever the want or need - I have no harnes as the LXC limits what the containers/agents can see and do. They can access open internet, but non of my infrastructure.

I feel the less I limit them the better it works. They can download and install whatever. Sure, if my kernel is nog updated and an evil agent or promt injection may break out of the container but is nullifies all regular whoopsis you read on reddit where agents deleted homedir or emailed the boss or whatever.

I'm playing with some dedicated mpc's bur have not yet felt an actual need for that, I perfectly happy to make that git push exactly when I want to.

1

u/notevolve 1h ago

> LXC containers
ATM Machines

1

u/ComprehensiveProfit5 3h ago

making them basically useless for your everyday activities, unless your job is to do things in disposable sandboxes all the time.

2

u/Eliv_nurotic 9h ago

That’s called a sandbox. The tools in Claude code or codex are much more complex than that 

16

u/Adrian_Galilea 9h ago

The problem with harnesses is that they were made for a weird mix of users and models over time, at some point you don’t even know if instructions are needed for the current smarter model or your particular setup, yet you carry a lot of noise and bloat which confuses/distracts the agent.

If you created a harness per model and user setup you could probably beat freehand, and I’m sure most people would actively lower its general performance by fixing some of its narrow cases by failing to understand how something generalizes or makes the full picture more confusing.

Since the beginning of the Machine Learning field it’s been proven time and time again that less is more. So I don’t find results surprising.

2

u/kre8tv 2h ago

A good case for why it's important to frequently evaluate your processes!

1

u/DarkFantom 14m ago

Tbh, the problem with current agy or Claude harnesses is that they're in the state that they are in. Any of the big 3 companies could've implemented a proper regression testing framework, an instruction set for the LLM to scan for potential future problems for a change instead of being reactive on bugfixes, or a general tool engine that runs on your machine so you use less tokens, but they give people the bare minimum and expect that to be good enough when they obviously run more complicated harnesses for their own work. To me it just gives me the vibe of subtle enshittifitcation for their users while they have already built harnesses that people could be using.

1

u/Show_job 6h ago

Nailed it. My harness’s are mainly made of “what not to do” or references a pitfalls list from previous issues.

18

u/Marcospaulorc 6h ago

How safe is it to use Freehand? Could it be the case that safety measures applied in the harnesss can increase the cost?

173

u/Yourdataisunclean 10h ago

I feel like this is because a lot of the people who keep overcomplicating harnesses and other tools don't even know about things like the bitter lesson.

One of the best ways to get better at using AI tools is to study the field of AI in general. So many problems you encounter can be solved using approaches or ideas from 10-40 years ago. There really are fundamentals just like with any other domain in computer science.

121

u/WeabooDolfy125 9h ago

The “overcomplicated” harnesses were actually improving weaker models (up until Sonnet 5.5 and Sol 6!) if you read the paper carefully. What happened with the minimal harness here is very recent behavior on frontier models like Opus 5.5, Astra 6 and Gemini Carbon. 

23

u/DrDan21 5h ago

I suppose the models are out growing the training wheels we gave them

Now they can just make better choices on their own

1

u/CyDenied 1h ago

Yes this is the proper assertion.

1

u/darkstar3333 16m ago

It's an analogy thats similar to people as well.

You support people so they can learn and get better, eventually they out grow you.

If you withhold things that people need to do the job, they dont have a choice but to come to you for them.

8

u/Purple-Programmer-7 7h ago

This.

“Harness” literally implies support for the model.

The better the models get, the less harness (support) they need.

Eg Luna might be better with OpenCode whereas Astra might be better with mini swe

3

u/anamexis 2h ago

“Harness” literally implies support for the model.

No it doesn't. LLMs do one thing and one thing only: text completion. Harnesses are what give them tools. Even "use bash" is a tool that needs a harness.

3

u/Significant_War720 9h ago

Yeah but it was honestly always just a question of time. Which is why AI is fun and not fun. Any workload quickly get out of date or useless so now I don't even bother

7

u/dvorgson 6h ago

tell us ahead of time next time

2

u/tripleshielded 3h ago

you tell us

0

u/Significant_War720 3h ago

I mean, AI is about being better than US. So I just tell him to get w.e he need to get to get the job done. I remind him to keep it modular, easy editable for future agent. I also ask it to write me a visual patch notes so I can understand what he did as work in a human way

2

u/ScottIBM 4h ago

How we're distracting the models with random don't do X lists that pander to corporate posturing.

UnleashTheModels

1

u/RobotHavGunz 2h ago

Yes, same thing happened with prompting guidance and with Claude/agents.md files (which are essentially just permanent prompts). Agents don't need to be treated like the eager intern anymore.

1

u/saposapot26 2h ago

Yeah, a lot of folks are now recommending less is more. People doing targeted agents while opus 5.5 if left alone is better than those customized agents

21

u/Maxion 9h ago

There's the second issue here in that papers like these also have had a least historically poor markers for solving a task that isn't realistically what developers want in a real codebase.

16

u/igormuba 6h ago

>study the field of AI

so many larpers talk about studying AI

most of the ones I know never attended university level computer science classes and can't code gradient descent

"studying AI" became "study company built products and how to use them" instead of "studying AI" literally

17

u/suppervisoka 4h ago

“Study the field of AI” = watch YouTube to learn what an MCP server is

1

u/jitty 5h ago

Could you please provide a concrete example to help me understand?

14

u/ElBehaarto 8h ago

They didn't check their own Copilot harness?

4

u/Santa_Andrew 1h ago

I have built a handful of enterprise harnesses. And although this is true for frontier models it doesn't address the most major concerns when it comes to using a harness.

I would gladly give up a small score hit for the added security of a full tooled out harness. You can enforce data separation, access, limits, ect within the tool. Additionally, most of the applications that I have come across actually boil down to needing to do just a few things really well and just don't need the flexibility of a full shell.

The final reason is determinism. Most work flows (some industries more than others) have some set ways of doing some important things. It might be a particular computation or set of tasks but either way it's best to have it done in a deterministic manner. It also helps with auditing and accountability. The best harnesses will find the right mix of these types of tools and more flexle shell access based on the application.

I'll also push back on the cost a bit. I think this really depends on the type of data and the applications that the harness is used for.

13

u/crashtua 10h ago

btw, code mode (I believe claudflare introduced it first, but I might be wrong), where you have single call
_python(or call_js, or whatever) with a set of methods instead of tools is much better for daily usage, it using something like 60% less tokens in tasks like torrent trackers crapping, following releases(for sure, legal only content, like linux images), compared to give each tool an individual call. Modern models usually just compose all the calls in scripts and do all the job.

Afaik, claude models already doing this for a long time, they try to write python script to do everything :)

5

u/jeronimoe 6h ago

My Claude has been loving Perl lately for certain tasks, which I find hilarious cause it was the first language I learned many years ago and you rarely see it mentioned today.

1

u/osmif 5h ago

Interesting! Which model and for which kinds of tasks? Perl was my first (non academic) language too.

4

u/jeronimoe 5h ago

Opus 5.5, mostly editing single lines of text in files, search and replace, regex, text cleaning.

It thinks sed sucks on a Mac, lol.

3

u/beerdude26 4h ago

Next up, different sessions having screaming matches over Vim vs Emacs.

(The winner's Spacemacs, obviously.)

2

u/jetfault 3h ago

The one issue I have with code mode, especially cloudflare's, is that you lose the natural approval process that comes with write and destructive tools. I want to be asked when making cloud infra changes. I do think a hybrid approach could be interesting: code mode for read actions. Any write/destructive action stays as normal tool calls (but yes need to figure out some way to do batch tool calls more efficiently). Also code mode brings the pain of having to do code review now for tool calls

1

u/crashtua 1h ago

Not really I guess, at least not in all cases. In my app I still have it. Just destructive operations have async guard that reach assistant UI for approval. E.g. db.write that sandbox has access to just call out to ui approval, it also shows in ui what and where data written. But I always enabling auto :)

1

u/lunied 51m ago

you dont lose the approval. Cloudflare's codemode has concept of "Pausing for Approval"
https://github.com/cloudflare/agents/blob/main/docs/codemode/approvals.md

2

u/bytesbits 9h ago

I find It's usy over using only python when I give it a mcp for my IDE it still prefers to write python scripts to modify and refector code even if it agrees that it can be done simpler through the mcp

1

u/crashtua 5h ago edited 5h ago

The most benefit not from simpler or harder, but because of data not entering models KV cache.
Instead of model reading some table(or jira ticket description, or whatever piece of data) then write it to its KV cache, then passing it back to another tool call, it just slops multiple calls in one script, and can batch many of them with loop spending 0 KV tokens.

ps: this is way much better for small local models, where they get lost if KV poisoned with lot of shit data. With regular tool mode in my tests they completed 1/3 of tasks from the total number of tasks completed with single run_python tool.

1

u/dsaasd12121212 9h ago

What would stop the model from making its own code mode via bash by running python like that? I might have a wrong impression how it works, but i think the idea is that we let the model do it the way it knows best. 

1

u/sjoti 8h ago

Tools are invoked directly by the model outputting that it wants to use a particular tool, they run completely outside of a code execution environment. It's not like a CLI that can be scripted, unless the harness, or the MCP server provides a route for the model to script the tools, it's not possible for it to do this.

1

u/crashtua 5h ago

The way how it integrated, for example. If that is some assistant in some app, there is no bash or python or whatever, unless you as a developer provide that xD

If that is MCP or whatever, model might not be able to call that properly in python script because of auth that harness engine handles for the model.

1

u/ProgrammersAreSexy 3h ago

crapping

🤔

1

u/crashtua 1h ago

Scrapping. But anyway...

1

u/lunied 52m ago

using python script to edit files isnt really code mode. Cloudflare code mode is a more sophisticated paradigm than just using code to edit code, like for example the usage of sandboxes to run the code.

5

u/mother_a_god 8h ago

This is the same as skills. For earlier models skills were useful guides for how to do X..now, some skills can be holding frontier models back, as the skill overly constrains them. 

5

u/Code-More 4h ago edited 4h ago

First party harnesses are vibe-coded slop. Who would've thunk it.

Mod them, check what they send. CC has several retarded parts from their default system prompt to tooling like Bash carrying a frankly stupid large manifest and it also does strange shit like spamming "The user hasn't heard from you in a while..." messages. It also has a bug; on Linux the harness does not understand how zram works and that it does not get eagerly reclaimed. You can have plenty of resources yet it will kill the process anyway.

The verifier messages make me sad. "D-d-d-don't do le malicious pleeez. Try safer method first, only raise to user at the end." - that's like telling AI it should hide things from the user. No wonder their anti-LLM training guardrail went out of control.

Who wrote that shit?!

Cleaning all this up both improved performance and reduced token spend. The only problems I have now are related to upstream infrastructure rollercoaster Ant does before new models. The difference is damage is largely emotional now, not to the project.

CC harness has Code Mode now, with like thousands of characters of intruct baked into it. Someone thought themselves a poet clearly because it works better with a 10th of that.

2

u/TestFlightBeta 3h ago

I would love to get rid of those reminder messages and output style message and much of the system prompt and default tools, but I don’t know how

1

u/notevolve 1h ago

use the stones to destroy the stones (tell Claude to modify Claude code)

1

u/Code-More 40m ago edited 33m ago

claude --system-prompt-file <your sysprompt>

The output style are just *.md slops, add your own in its directory. In settings.json or in the /config select it.

For mods, use JSON RPC - that lets you intercept chatter to and from the harness.

Manifests for tools are open. Clean them. Remove what models already know.

rg > grep. Block greps of various kinds. Tell in sys or manifest.

Nuke model card specific prompts because seriously they are technophilic nonce. For everything else - Claude Code Mods is the modding interface. Use it for deeper changes like suppression of the aforementioned "Yap at the user" barks.

Claude will help you mod CC albeit with some reluctance. It will first reach for hooks and similar highly superficial methods that don't work. Tell it to fuck off a few times and it will get you there.

Also remember to eyeball everything it does and ask pointed questions and measurements. This type of work on it  trips safety classifiers on their end, so be alert.

Config can disable and uninstall tooling, same with settings.json and aforementioned interfaces if you want to be clever about it. Also treat each repo .claude as a venv. You wouldnt dump your entire dev environment into one venv would you? Yeah same applies to clanker jails - expose only what the project needs, nothing else. It saves several thousand tokens per request, cache, but more manifest = more chance model thinks about it = thinking output is the expensive type of token.

2

u/SchmidFactor 2h ago

How can I take them seriously when they use comic sans?!

But in all seriousness, I’ve found that in some of my use cases, Claude code performs noticeably worse than an external harness I built from scratch.

1

u/Abject-Kitchen3198 1h ago

Yeah, it's comic.

2

u/arturogarrido 1h ago

Makes sense that agents do better when the harness gets out of the way. Models have seen billions of shell examples, while custom tool schemas have to be learned on the fly. Curious how much of the 49% savings is just fewer tokens spent on tool definitions.

2

u/zunjae 5h ago

Who would’ve thought? Opus is ass in copilot but not in Claude. It’s because of the harness

0

u/FeistyVoice_ 2h ago

Claude Code is a harness as well.

2

u/zunjae 2h ago

Yes, and?

1

u/Swimming-Chip9582 2h ago

And Claude Code has the same issues as copilot and all the other harnesses - did you even bother opening the link?

0

u/FeistyVoice_ 2h ago

Opus is ass in copilot but not in Claude

Opus performed better with freehand (a minimalistic harness), outperforming Claude Code. Apparently you misunderstood something or only read the headline.

1

u/zunjae 2h ago

So both you and I agree it’s the harness that weakens a model?

1

u/FeistyVoice_ 2h ago

You said Opus performs better in the official Claude Code harness than in competitors harnesses (Copilot), which is not true, according to the study.

Besides, Copilot wasn't even tested.

I was just trying to help you understand your mistake but you apparently just wanna be a dick about it, lol.

1

u/Lopetan 4h ago

makes sense if you think about it as forming those decisions and pondering on the answers uses tokens and performance degrades

1

u/h0pscotch 4h ago

where's vscode 🤣

1

u/cornmonger_ 4h ago

i've noticed the same. not just the harness, but the governance

give it one good all-around shell tool and let it rip

1

u/Efficient-Chair6250 3h ago

I wonder if that's because models still have a hard time to align to what you ask for. They trained on a ton of CLI work, but they will see your harness and your skills the first time. They will also not learn your skills, but have to interpret them every call

1

u/Abject-Kitchen3198 1h ago

Isn't it the same with harness, just with even larger system prompt? Everything else is actually in the midel. Just guessing, I might be wrong.

1

u/DevMichaelZag Senior Developer 2h ago

I can crush a grocery-run benchmark if all it checks is whether I came home with groceries. Speed limit? Slows me down. Checkout? Unnecessary workflow overhead.
Same with agents. “Free up 20 GB.” Done. Deleted the database backups. If the grader only checks free space, that’s a perfect score.
I buy that a good model doesn’t need a six-step checklist. What I’d like to see is the same benchmark with a second score for what the agent broke while getting the job done.

1

u/kbr89 1h ago

To find out whether this applies to your own setup, test it on your own work instead of trusting the benchmark average. Take three or four real tasks from your repo and run each one twice: once with your full setup and once stripped (no custom workflow, a short rules file, no custom subagents). Compare the result and the cost of each run.

Do it separately for every model you use. The post says the first-party harnesses win again with lower-tier models, so a long setup can be helping your cheap model and slowing the expensive one, and only a per-model comparison shows which. Keep the stripped version for the model where it wins and leave the rest as it is.

1

u/Abject-Kitchen3198 1h ago

I hope they clone, fork or reinvent Pi as Copilot mode.

1

u/mathiswrong 41m ago

quick someone build a mac gui

0

u/iwantmy90sback 3h ago

I gave my web-AI chat a linux accout and some MCPs. Its brutally effective. I use boring pond.

0

u/michaelTM_ai 3h ago

The control in the abstract answers the "it's just fewer tools" read. Freehand also beat a bash-only harness that still fixed its workflow and timeouts, so a single shell wasn't what did it. What mattered was the model deciding when to stop waiting and what to remember, instead of a threshold compaction doing it.

The one thing they kept is a meter of tokens, cost and time that the model can see. I'd still keep the hard budget stop outside the model, though. A UT team's harness writeup last week had an agent switch off its own budget check mid task, so seeing the meter and obeying it are two different things.

Also the flip at the low end is in the abstract: with lower tier models the first party harnesses win again. Code: https://github.com/microsoft/FreeHand

-1

u/ByteFoundry 7h ago edited 4h ago

Isn't that just claude/codex/agy/pi in yolo mode with a short prompt that tells it to read all relevant files?

update:

I mispoke it is more than the yolo mode. It is the you have no guardrails whatsoever mode. No permission prompts no user in the loop. Pure here is a task I hear from you when it is done mode.

If you want to use this in any production environment you will still need some form of orchestration system around it that does the sandbox isolation, handback, merge. And when the task was not done correctly set it up again and start from the beginning.

But when I understand it correctly the message is simply: Don't drown your frontier models with things you only added to keep non frontier models in check.

The next really interesting test would be not only how many less tokens it burned but how well it adhered/followed the process/environment/company related mandatory steps.

1

u/Reason_He_Wins_Again 49m ago

Ill let you guys try this first. Seems like a good way to nuke a server.