Repository navigation
Description
Tracking issue for the efficiency work prompted by a third-party benchmark.
Background
Harness efficiency, not quality tested nanocoder 1.29.0 against Pi, OpenCode and Claude Code with the model held constant (DeepSeek V4 Flash) across eight bug-fix tasks in a large codebase. Nanocoder got 64 runs, 8 per task, so it is the best-sampled harness in the study.
Results:
- Pi: 4 tools, 1,340 fixed overhead, 28.0 avg steps, 14,775 output tokens, 2.1m, grade 2.34
- OpenCode: 10 tools, 7,197 fixed overhead, 16.6 avg steps, 17,463 output tokens, 3.1m, grade 2.07
- Claude Code: 27 tools, 23,132 fixed overhead, 37.9 avg steps, 58,370 output tokens, 8.0m, grade 2.42
- Nanocoder: 15 tools, 6,121 fixed overhead, 37.4 avg steps, 55,844 output tokens, 5.2m, grade 2.25
Quality was statistically flat: every confidence interval overlaps every other. The author's conclusion is that harness choice is an efficiency decision, not a quality one.
The good news is our system prompt is the second leanest of the four, about a quarter of Claude Code's. That is the part we control most directly and we have done it well.
The bad news is all our cost sits in the agent loop. 37.4 steps and 55.8K output tokens to reach the same grade OpenCode reaches in 16.6 steps and 17.5K. Since the system prompt is re-sent every step, a lean prompt multiplied by 37 steps loses to a fat prompt multiplied by 17.
The author's specific criticism was that nanocoder was "re-reading the same files more than any other harness". An audit found that is not model behaviour, it is a designed-in forced round-trip.
Steps and latency
These are the ones that move step count, which is what the benchmark actually measured.
- read_file forces a metadata round-trip on every file over 300 lines #760 read_file forces a metadata round-trip on every file over 300 lines
- read_file metadata path skips markFileSeen, forcing an extra read before edits #761 read_file metadata path skips markFileSeen, forcing an extra read before edits
Tokens
These compound, because tool results persist in the conversation and are re-sent on every subsequent step.
- write_file echoes back the entire file the model just wrote #762 write_file echoes back the entire file the model just wrote — landed via fix: stop echoing full file contents back after write_file #776
- string_replace returns the entire file after every edit, uncapped #763 string_replace returns the entire file after every edit, uncapped — landed via fix: bound string_replace result context #784
- Bash output truncation is head-only, discarding the tail where build and test errors live #764 Bash output truncation is head-only, discarding the tail where build and test errors live — landed via fix: truncate LLM-facing command output head+tail instead of head-only #777
- Edit tools return line-number prefixes while read_file strips them #765 Edit tools return line-number prefixes while read_file strips them
- search_file_contents wastes tokens on multi-line result formatting #766 search_file_contents wastes tokens on multi-line result formatting — landed via fix: format search_file_contents results grep-style, one line per match #774 + fix: drop blank separator between context-free search matches #818
- list_directory emits byte sizes on every entry by default #767 list_directory emits byte sizes on every entry by default — landed via feat: make list_directory file sizes opt-in via showSizes #778
- toLocaleString() thousands separators leak into LLM-facing tool results #768 toLocaleString() thousands separators leak into LLM-facing tool results — landed on branch
- [Bug] diff_edit echoes back the entire file the model just edited #795 diff_edit echoes back the entire file the model just edited (found while reviewing fix: bound string_replace result context #784; the last uncapped file echo)
Structural
- No global cap on tool result size #769 No global cap on tool result size — landed as
MAX_TOOL_RESULT_CHARSinsource/constants.ts - git_diff truncation is head-only, dropping the end of large diffs #770 git_diff truncation is head-only, dropping the end of large diffs
Open design question
- Discussion: should subagent delegation be gated by task scope? #771 Discussion: should subagent delegation be gated by task scope?
Status (updated 2026-09-15)
All twelve wastage items have landed. #771, a design discussion, is the only thing still open under this issue.
Correction on step count. This section previously read "nothing merged so far has moved that number, every fix to date has been tokens, not steps", and described #760 and #761 as not yet started. That was written before both landed on 2026-08-09, and I never rewrote the prose after ticking the boxes. #760 is specifically a step-count fix: it raised the metadata threshold and made large reads return a preview, so an 800-line file went from five round-trips to one.
The accurate statement is that nobody has measured since the step-count fixes landed. We have no harness that reproduces the benchmark's step count, so we cannot currently say whether the 37.4 figure still holds. Anyone citing this issue as evidence that the step count is unchanged should cite that instead.
What this is waiting on. #1197 builds the evaluation harness (steps, tokens and cost per task) and publishes a baseline against current main. That baseline is the next real update to this issue.
Follow-on design. #1186 is the design record for the structural work, persistent repo map, cross-step deduplication of tool results, and index/LSP lookup tools. Phase 0 (#1197) is approved on its own and the later phases are held behind its numbers. The cross-step dedup mechanism lives in #793.
Caveats worth keeping in mind
The 2.25 vs 2.42 grade gap is not real. The author explicitly warns that run-to-run swing on a single harness can be a full grade, and that under about 10 runs per condition you are mostly measuring noise.
Grading was a single coarse 0-3 scale by one grader over bug-fix tasks only. It can detect "roughly equivalent" but cannot detect quality that exploration might buy on open-ended work. We should fix the mechanical waste, which is not in dispute, without assuming every behaviour the benchmark penalised is actually wrong.
Activity
AryanNandanwar commentedon Aug 3, 2026
Hey Will, I'd like to work on this issue
will-lamerton commentedon Oct 7, 2026
Every item tracked here has been closed. What's left is the subagent-scope discussion in #771 and the measurement harness in #1197, and both are tracked on their own. Closing the tracker.