Improving 15 LLMs at Coding in One Afternoon. Only the Harness Changed
TL;DR Highlight
Tagging each line with a hash for edits beat patch in 14 of 16 models
Who Should Read
A developer building or customizing a coding agent who keeps hitting edit failures like 'string to replace not found'
Core Mechanics
- The harness is the bottleneck, not the model
- The harness is the tool layer between the model and your workspace: tool schemas, error messages, state management.
- The author says most real-world failures happen between 'the model knows what to change' and 'the issue is resolved'.
- Existing edit formats all have limits
- Codex's apply_patch fails a lot on other models; in the benchmark Grok 4 had a 50.7% patch failure rate and GLM-4.7 46.2%.
- str_replace, used by Claude Code and others, needs exact character reproduction including whitespace, and 'String to replace not found' is very common.
- Cursor fine-tuned a separate 70B model just to merge edits.
- Hashline tags every line with a 2-3 char hash
- Reads and greps return lines like '2:f1|' with a line number plus a content hash.
- The model edits by referencing tags: 'replace 2:f1', 'replace 1:a3 through 3:0e', 'insert after 3:0e'.
- If the file changed since the last read, hashes won't match and the edit is rejected before corruption.
- The benchmark injects bugs into React code
- Random React files get mechanical mutations like operator swaps, boolean flips and off-by-one errors, plus a plain-English description.
- It ran 180 tasks, 3 runs each, fresh session every time, on 16 models.
- Weaker models gain the most
- Grok Code Fast 1 went from 6.7% with patch to 68.3% with Hashline, nearly 10x.
- Hashline beat patch in 14 of 16 models.
- Grok 4 Fast's output tokens fell 61% because it stopped retry loops.
- GPT-5.1 Codex Mini went from 60.0% to 77.5% with the v2 revision.
- Not every model improved
- In the table DeepSeek V3.2 was −5 points vs patch.
- GPT-5.2 Codex was +4.6 points.
- Against replace, Grok 4 Fast, Qwen Turbo, GPT-5.2 Codex and DeepSeek V3.2 were negative.
Community Reactions
- Codex already uses a schema for constrained sampling
- A commenter pointed out Codex uses schema-based constrained sampling for apply_patch.
- They argued a more realistic benchmark should enable constrained sampling for the apply test.
- Pushback that the result is oversold
- One commenter said a 5% gain on a narrow self-made find-and-replace benchmark was framed like a 5-14 point boost.
- They calculated that if editing is under 1/3 of tokens, the overall efficiency gain is under 1%.
- Another noted it is worse than replace for 8 of 16 models, and models are already tuned for replace.
- Experience implementing similar hash or AST approaches
- A commenter built tree-sitter node-hash tools (list/get/update) in Emacs gptel and said it worked like a charm.
- Another implemented hash read and edit in tilth.
- Another used Damerau-Levenshtein similarity thresholds for edits and said it works even with 4B models.
- Experience that fuzzy matching won earlier
- A commenter who maintained a harness around Claude 3.5 said they tried hash and line-number prefixes, and fuzzy string matching won.
- Another cited a paper where an unfamiliar token-saving format (TOON) made LLMs spend more tokens deciphering it.
How to Apply
- Measure your agent's edit failure rate first
- Count 'not found' and patch-apply errors in today's logs against total edit calls.
- Also record retries and token usage right after failures.
- Add per-line hashes to read output
- Prefix each line in read and grep results with 'lineno:2charhash|'.
- Change the edit tool to accept tags for locations instead of old text.
- Reject edits on hash mismatch with a clear fix
- Compare current file hashes right before applying and refuse if they differ.
- Put a concrete remedy like 'Reread the file' in the error message.
- A/B test formats per model
- Run patch, replace and hashline on the same task set at least 3 times for each model you use.
- Hashline can lose to replace on some models, so compare pass rate and output tokens together.
Try It
# Paste into Claude Code or ChatGPT (simplified version of the article's method: mimics hash-tag editing via prompt)
The file below has a 'lineno:hash|' tag on every line.
Rules:
1. Specify edits only by tag. Examples: 'replace 2:f1', 'replace 1:a3-3:0e', 'insert after 3:0e'.
2. Do not rewrite the existing code. Write only the new content.
3. If a tag is unclear, don't guess; answer 'reread needed'.
Bug description: {{bug description}}
File:
{{code with lineno:hash| tags}}
Output format: output only the list of edit commands.Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques