Focused file viewing and patch application tools for repository agents
Repository agents need a thinner interface between exploration and editing. SWE-Edit gives a practical design: a Viewer returns only task-relevant code blocks for a file and query, while an Editor applies a patch from a natural-language edit instruction. The main agent keeps the bug reasoning and fix plan, with less file-search residue in its context and fewer brittle find-and-replace failures.
The reported gains are modest on issue resolution and more concrete on cost and edit reliability. On SWE-bench Verified, SWE-Edit raises resolved rate from 69.9% to 72.0%, cuts inference cost by 17.9%, and raises edit success from 93.4% to 96.9%. The Viewer returns 39.7% of requested file content on average, which is a direct way to test whether the interface is reducing code surface without hiding the needed lines.
A team running coding agents on an internal monorepo can test this without changing the model: add a file-view endpoint that takes a path and query, add a patch endpoint that accepts an edit instruction, and compare agent runs on recent bugs. Track resolved issues, failed patches, non-cached input tokens, and reviewer complaints about unrelated edits.