Separate file viewing, patch writing, and test repair for code edits
Code-assistant teams should split repository editing into three measured steps: a viewer that returns only task-relevant code blocks, an editor that applies a high-level patch request, and a verifier that runs the real tests and feeds structured failures back into repair. This is a buildable change for IDE assistants, CI repair bots, and internal coding agents that already call file-read, grep, edit, and test tools.
SWE-Edit gives a practical shape to the read and write split. Its Viewer receives a path plus a natural-language query and returns relevant blocks; its Editor receives a path plus an edit instruction and applies the change. On SWE-bench Verified, the paper reports resolved rate rising from 69.9% to 72.0%, edit success from 93.4% to 96.9%, and inference cost falling 17.9%. SAFEdit adds the test loop for instructed edits: a Planner writes the edit plan, an Editor changes the code, and a Verifier runs unit tests with up to three repair rounds. It reports 68.6% EditBench task success, above a GPT-4.1 ReAct baseline at 60.0%.
A cheap adoption test is to wrap an existing coding agent without changing its base model. Route reads through a block-returning viewer, route edits through a patch executor, run the project’s tests after each patch, and compare edit success, unrelated diff size, resolved tasks, and token cost on a fixed issue set. The Claude Code regression report adds one implementation warning: repeated safety reminders inside Read and Grep results can cause subagents to refuse ordinary refactors and waste context. Safety text in the file-read path needs its own regression tests, including parallel subagent runs on benign repositories.