Independent AI intelligence Two editions daily · ET
Fervor AI

Analysis · December 3, 2026 · concept

Agent harnessClaude CodeFreehandagent-harnessclaude-codeagent-security

Your Agent's Old Rules Are Slowing It Down. Claude Code Now Audits Them.

Claude Code now ships an audit for stale agent code, and a Microsoft study says the rules you wrote last year may be slowing your agent down

Every coding agent carries a pile of rules its builders wrote for a weaker model. Stop after 30 turns. Summarize the conversation when it hits 80% of the context window. Remind the model, every few steps, to run the tests. Each rule made sense the week someone added it.

Then the model underneath got better, and the rules stayed.

This week two releases made that pile visible.

Anthropic's Claude Code 2.1.335 added a command that looks specifically for "agent harness code written for older models." And a Microsoft Research team published Freehand, an agent that strips nearly all of those rules out and, in the authors' own tests, beat Claude Code, Codex and Gemini CLI on score and cost at the same time.

The result is an uncomfortable idea for anyone who has built an agent: some of the code you wrote to keep the model on track is now the thing holding it back. The fix is not to delete everything. It is to know which rules were crutches and which were guardrails, because only one kind should go.

What a harness actually is

An agent harness is everything around the model that turns it into an agent. The model only predicts text. The harness decides what the model sees, which tools it can call, how long a command may run, when to stop, and what to forget when the conversation gets too long.

Claude Code, Codex and Gemini CLI are harnesses. So is the 400-line Python loop you wrote to make an agent triage support tickets.

Most harnesses share the same furniture:

  • A long system prompt that tells the model how to approach work ("plan first, then run the tests, then summarize").
  • A tool suite, often 20 or more purpose-built tools for reading files, editing, searching and running commands.
  • Fixed timeouts for how long a command may run before the harness kills it.
  • Automatic compaction, which means summarizing older conversation to free up room once the context window (the model's working memory, measured in tokens) passes a set threshold.
  • Injected reminders, extra messages the harness slips in mid-task to keep the model on track.

Every one of those is a decision made before the model has seen the task. That is the part that ages.

The evidence that old rules cost you

Freehand's paper is titled "The Bitter Lesson Comes to Agent Harnesses," a nod to the old AI-research observation that hand-built knowledge helps at first and then gets outgrown by more general methods. The arXiv preprint went up on December 1.

Freehand's design is almost aggressively bare. Before a task starts, the model sees about 0.35K tokens (roughly 200 words) describing its runtime and exactly one tool: a bash shell. It sets its own timeout on each command. It prunes its own history instead of waiting for automatic compaction. After every turn it sees a meter of context size, tokens, cost and elapsed time, and it decides what to do with that information.

According to the project README, across 11 settings (five benchmarks, three model families) Freehand scored higher than each model's own first-party harness (the one its maker ships) in every one, by 5.1 points on average at 49% lower cost. With Claude Opus 5.5 on Terminal-Bench 4, it scored 61.9% at $3.38 per task, against Claude Code's 54.9% at $4.91.

These are the authors' own benchmark runs. Nobody independent has reproduced them yet. But the same README contains the detail that makes the whole idea useful instead of just provocative.

With weaker models, the order flips. On Terminal-Bench 4, Codex beats Freehand with GPT-6 Sol (34.9% to 29.2%), Claude Code beats it with Claude Sonnet 5.5 (41.6% to 34.9%), and DeepSeek's own harness wins with DeepSeek V4.1 Flash. The authors put it in one line: for weaker models these presets are a crutch, for frontier models they become a cage.

That is the insight worth keeping. Your harness rules are not right or wrong. They are tuned to a specific model's weaknesses. Upgrade the model and the tuning goes stale.

Anthropic is telling you the same thing

The more interesting signal came from a vendor that ships one of the harnesses Freehand beat.

Claude Code 2.1.335, published to npm on December 2, added /claude-api harness-audit. The changelog describes it in one sentence: it finds "agent harness code written for older models (loop limits, sub-agents, context management, injected reminders, session-start code) and propose[s] fixes as a diff."

Read that list again. Loop limits, context management, injected reminders. It is close to the same list of presets Freehand argues against.

The changelog does not say how aggressive those diffs are or what model assumptions the audit checks against. That is all the public description there is right now. But a vendor building a tool to find stale agent code tells you that agent code has a shelf life, and that the vendor expects most teams never to revisit it on their own.

What a stale rule looks like in practice

Compaction is the clearest example, because it fails loudly.

A UT Austin team working on a research harness called ext ran a demonstration with Opus 5.5 building a Mastodon-style server under a 100K-token context budget. Vanilla Claude Code compacted, ran out of room, compacted again, and stopped after 22 tool calls with 0 of 150 tests passing. The authors note that Claude Code ends a session when the context refills right after compaction three times in a row. Their version, which let the agent set its own compaction policy within verified limits, ran 128 calls and passed 147 of 150.

That is one run per setup, in a research post, so treat it as an illustration rather than a benchmark. The same post reports a broader result too: a reusable policy lifted Opus from 14 to 22 of 27 coding tasks at the same cost.

The pattern is the point. A fixed threshold that was sensible for a model that rambled becomes a trap for a model doing long, careful work. Nobody changed the threshold because nothing visibly broke until the task got hard.

Deleting rules moves the risk, it does not remove it

Here is where the Freehand story gets less fun.

Some of the rules in your harness are not crutches. They are guardrails, and they look identical in the code.

Freehand's own security doc is blunt about what it gives up. There is no sandbox and no approval prompt. Every command the model runs can read and write any file your account can, use your network, and use your SSH keys and cloud credentials. A hostile file or web page can try to steer the model, and "without a sandbox, a steered model can do anything a command can."

So "let the model decide" includes letting it decide things you would have blocked.

There is a subtler cost as well. The ext authors tried handing Claude Haiku 5.5 harness tools and a live context meter in a minimal bash-only loop, on five long tasks under a 32K-token budget. As the model neared the limit, it rushed to submit unfinished work, and success fell from 92% to 52%. They compare it to the "context anxiety" reported earlier for Claude Sonnet 4.5. Freehand's design leans on exactly that kind of meter. It worked for the frontier models and tasks the Freehand authors tested. It backfired for a small model on a tight budget. Nobody yet knows where the line sits for your agent.

That is why the useful question is not "how much scaffolding can I delete?" It is "for each rule, what was it protecting, and what protects that now?"

Put this into practice

None of this needs a rewrite. It needs an afternoon and one honest list.

1. Inventory your rules. Open your harness code and the system prompt and write down every decision that happens before the model sees a task. You are looking for five things: turn or loop limits, fixed timeouts, compaction thresholds, injected reminders, and instructions that tell the model how to work rather than what the task is. Next to each one, write the model you were running when you added it. Most teams find at least one rule older than their current model.

2. Sort each rule into crutch or guardrail. A crutch compensates for a model weakness (it forgot to run tests, it wandered off task, it rambled until the context filled). A guardrail protects you from the model's mistakes (it must not touch production, must not spend more than $5, must not read ~/.ssh). Crutches are candidates for deletion. Guardrails stay, though they might move.

3. If you build on Claude, run the audit. Update Claude Code to 2.1.335 or later (npm install -g @anthropic-ai/claude-code@latest), open your agent's repository, and run /claude-api harness-audit. You should get a list of findings and a proposed diff. Review it like a pull request from a new teammate who is smart but has never seen your production incidents. Accept the crutch removals. Push back on anything that touches a guardrail.

4. Test one task with almost no harness. Pick a real task your agent handles today and run it once through Freehand, inside a container. The project's container guide has a Dockerfile; the short version is:

pip install freehand-ai        # Python 3.10+, macOS or Linux
freehand login                 # ChatGPT Plus or Pro sign-in, or an OpenAI or Anthropic API key
freehand -p "fix the failing test"

Run that last line inside the container, not on your laptop. The container keeps commands away from your home folder and keys, but it still has network access, so anything in the mounted project folder can leave the machine. Compare score, cost and time against your own harness on the same task. You are not deciding whether to switch. You are finding out how much of your scaffolding the current model actually needs.

5. Replace every deleted guardrail with something enforced outside the prompt. If you remove "never touch the production database" from the prompt, the replacement is not trust. It is a container that cannot reach the database, a credential the agent does not have, or a hook that refuses the command. Freehand's version is a pre_bash hook in ~/.freehand/config.json, a small script of yours that runs before every shell command: it sees each command first, and a non-zero exit blocks it. Its shell_environment_policy setting can be configured to strip any environment variable with KEY, SECRET or TOKEN in the name before commands inherit it (by default, commands inherit everything). The rule of thumb: crutches can live in the prompt, guardrails cannot.

Honest limitations

The headline numbers are the Freehand authors' own. They ran the benchmarks, they chose the settings, and the paper is days old. Treat 49% cheaper as a reason to test, not a forecast.

The reversal matters more than the headline. If you run a smaller or cheaper model, which plenty of production agents do for cost reasons, your existing scaffolding may be doing real work. Freehand's own README says a smaller model's first-party harness "may serve you better."

Claude Code's audit is one changelog line. Its behavior, its false-positive rate and what it considers "older models" are not documented beyond that sentence.

Do not apply its diff blind.

The ext results come from a research post with single runs on some demos, and its code is not released yet. The authors offer a waitlist.

And a minimal harness is not a free lunch on safety. Freehand is MIT-licensed but labeled alpha, has no sandbox, and says so on the first screen of its README.

The rule you should delete first

Go find the oldest compaction threshold or loop limit in your agent and ask who chose that number, and for which model. If nobody remembers, that rule is a crutch for a model you stopped running.

Delete it on a branch, run your hardest real task, and watch what the model does with the room. If it does better, keep going down the list. If it does something you would never allow, you just found a guardrail, and it belongs in a container or a hook, not in a sentence the model can ignore.

Sources: Claude Code CHANGELOG, 2.1.335 · Freehand paper, arXiv 2612.02442 · Freehand README · Freehand security model · Freehand container guide · Freehand config reference · ext: Agent Harnesses Need Their eBPF. Reviewed December 3, 2026; Freehand at v0.1.1 (Alpha), Claude Code at 2.1.335.