SelfSearch: a coding agent rewrites its own harness, claims Codex parity for $4.03
A research method where coding agents edit their own prompts, tools and procedures without task rewards, for builders who maintain their own agent harness.
Picture a platform engineer at a 30-person SaaS company. She runs a coding agent on a cheap open-weight model to clear CI chores: bumping dependencies, fixing flaky tests, writing small migrations. The model is fine. The harness around it is the problem: the system prompt, the tool definitions, the "run tests before you commit" procedure. It's a pile of edits she made one Friday at a time. Each tweak means rerunning a batch of tasks to see if anything moved, which costs tokens and an afternoon. Worse, every improvement is tuned to whichever tasks she happened to test. Three weeks later, nobody remembers why the shell tool has that odd timeout flag.
That's the gap a new paper is aimed at: SelfSearch: Reward-Free Search for Self-Improving Agents, posted to arXiv on 2026-09-29. The idea is to let the agent edit its own instructions, tools and execution procedures. It learns from a written record of its earlier edit attempts, not from repeated benchmark runs.
The headline claim, highlighted by @omarsar0 on 2026-10-05, is that $4.03 of search produced a harness that solves 82.0% of Terminal-Bench 2.1 with DeepSeek V4 Flash. That matches Codex, the top harness in a public nine-harness comparison. The claim is interesting. It also needs context.
What it is
SelfSearch is a research method described in an arXiv paper. It is not a shipped tool. Per the authors' abstract, it has three moving parts, and each maps to a pain in the scenario above.
- Self-modification. The agent inspects and modifies its own instructions, tools and execution procedures. This replaces the Friday-afternoon hand edits.
- Experience records. Each earlier modification attempt is recorded with its reasoning, tool actions and outcomes. The records become "concrete experience" for the next round. @omarsar0's summary adds that the modified agent then becomes the next improver. This targets the "why is that timeout flag there?" problem, because the rationale is written down.
- Reward-free search. No downstream reward signal is used during the search. The authors argue that searching by repeated downstream evaluation "incurs substantial costs and ties the search to the evaluated tasks." This targets both the eval bill and the drift toward whatever you happened to test.
The results below are the authors' claims, from the abstract:
- Population-mean success improved over the initial agent in all six model–benchmark settings.
- Individual agents gained up to 11.2 percentage points on Terminal-Bench 2.1.
- On SWE-bench Multilingual, one agent gained 5.0 points and cut execution cost by 38.5%. The cost figure covers only tasks that both the initial and evolved agents solved.
- Task success was "competitive" with evaluation-guided search baselines, at lower search cost.
- A $4.03 search produced the 82.0% Terminal-Bench 2.1 harness on DeepSeek V4 Flash, under the settings of a public nine-harness comparison.
The alternatives, each with its trade-off:
- Eval-guided harness search (the paper's own baselines, per the abstract). You score candidate harnesses on downstream tasks. The signal is direct. The authors' case against it is higher search cost and coupling to the evaluated tasks.
- Switch to a stronger off-the-shelf harness. DeepSeek's model card says it runs its code-agent benchmarks in the Minimal mode of DeepSeek Harness. Its changelog lists V4.1 Flash at 90.6 on Terminal-Bench 2.1. No search is needed. The catch is that these are vendor-run numbers, on a newer model, with the vendor's own harness.
Who it's for
Pick this up if you maintain a custom harness of your own: your own prompt, tool layer and agent loop around a cheap model. It also fits if you already treat that harness as code you iterate on, and you're comfortable reimplementing an idea from a paper. This is the vibe-coding-to-vibe-engineering move applied to the agent itself. The scaffolding is something you improve on purpose, with a record, not by feel.
Skip it in three cases:
- You use Claude Code or Codex as shipped. No source shows SelfSearch applied to either.
- You need something you can install this week. No code release was found.
- Your harness choice is already settled and your bottleneck is elsewhere.
Before and after
Before (hand-tuned harness):
- Notice the agent failing a class of task.
- Edit the system prompt or a tool definition by hand.
- Rerun an eval batch and pay for it.
- Keep or revert the change. The reasoning lives in your head or a terse commit message.
- Repeat. Over time the harness bends toward the tasks you happened to test.
After (SelfSearch, as the abstract describes it):
- Start from an initial agent.
- The agent modifies its own instructions, tools and procedures.
- Each modification attempt is recorded with its reasoning, tool actions and outcomes.
- The modified agent, with those records, becomes the next improver. No task reward is consulted during this loop.
- The result is a population of evolved agents. The abstract reports their downstream success after the fact.
Our reading: step 5 still implies some evaluation to choose which evolved harness you actually ship. The abstract doesn't say how that selection works, or whether its cost is part of the $4.03.
Try it
The sources don't describe a way to run SelfSearch today. Research found nothing beyond the arXiv abstract: no released code and no published evolved harness. The smallest real step is to read the paper (PDF and HTML versions are on the arXiv page).
You can borrow the core idea without the paper's code. Start keeping a structured record of each harness change: what you changed, why, and what happened. That is our suggestion, not a procedure from the paper. Still, those records are the raw material SelfSearch's agents learn from.
If you want to experiment on DeepSeek models, three facts matter:
- The paper's model is gone. DeepSeek's changelog says V4 Flash has been retired. The
deepseek-v4-flashname temporarily routes to V4.1 Flash, and new configurations should usedeepseek-flash. You can't reproduce the paper's exact setup through the API. - DeepSeek's eval settings. It reports code-agent scores using DeepSeek Harness minimal mode, max effort, top_p 0.95 and temperature 1.0, per the changelog.
- Price. OmniaKey's review lists DeepSeek's direct V4.1 Flash rates at $0.15 per million uncached input tokens and $0.60 per million output tokens off-peak, doubling during peak hours. A few-dollar search budget is plausible at those rates, but no source confirms it.
Where it breaks
"Matches Codex" is a modest bar. DeepSeek's own changelog lists V4 Flash at 82.7 on Terminal-Bench 2.1 using its DeepSeek Harness minimal mode. Whether those settings match the paper's is unknown, so treat the comparison as rough. Still, it suggests 82.0% on that model is close to what a vendor harness already reported.
The model has also moved on. The same changelog lists V4.1 Flash at 90.6. Latent Space's AINews roundup counts DeepSeek V4.1 Flash among the open models that are generally ahead.
Harness noise is the same size as the claim. Distk's read of DeepSeek's scaffold table finds a five-point swing on the same model depending on the harness. Distk treats one- to two-point gaps as "ties, not wins." A harness that "matches" the top score sits inside that band.
The comparison isn't pinned down. We couldn't confirm which public nine-harness comparison the paper used. DeepSeek Agent's guide says DeepSeek evaluated V4.1 Flash across eight scaffolds, including Claude Code, Codex, OpenCode, Pi, mini-SWE and three DeepSeek Harness modes. Whether that is related to the paper's comparison is unknown. Also unconfirmed:
- Whether Codex's 82.0% was rerun or just cited.
- How many seeds were used.
- How much run-to-run variance there was.
The cost figures are narrower than they look. It's unclear whether $4.03 includes final evaluation or only the search. The 38.5% execution-cost cut applies only to tasks both agents solved.
Benchmark choice. Distk describes Terminal-Bench 2.1 as the "established set." It notes that V4.1 Flash trails by wide margins on the harder 3.0 and 4.0 versions. The SelfSearch abstract reports no results on those newer versions.
Unaddressed failure modes. No source we found covers:
- Overfitting to benchmark style.
- Regressions on tasks the original harness handled.
- Unsafe edits an agent might make to its own tools.
Our analysis: an agent that rewrites its own tool layer produces code you'd want to review like any other pull request. The abstract says nothing about guardrails.
Portability is unshown. Nothing in the sources demonstrates SelfSearch on Claude Code or Codex setups. We also found no sources comparing it with DSPy-style prompt optimization or skills-based approaches. For now, it's a promising argument for treating your harness as iterable code, backed by one abstract and vendor-reported baselines.
Sources
- SelfSearch: Reward-Free Search for Self-Improving Agents · arXiv.org
- [AINews] Reflection Beam - 501B-A23B American Open Model · Latent.Space
- Change Log | DeepSeek API Docs · api-docs.deepseek.com
- DeepSeek V4.1 Flash: API, Architecture, Benchmarks & Harness Guide | DeepSeek Agent · DeepSeek Agent
- DeepSeek V4.1 Flash Benchmarks in 2026: Where It Leads, Where It Trails, and What the Table Leaves Out · Distk
- DeepSeek V4.1 Flash Review: Price & Benchmarks · OmniaKey
- deepseek-ai/DeepSeek-V4.1-Flash · Hugging Face · Huggingface
- @omarsar0: Learn to optimize your own harness, folks. · @omarsar0