llm_edit
Reduce code editing costs by routing reasoning to efficient models. Returns structured JSON instructions with exact old_string→new_string pairs for mechanical application during refactoring and bug fixes.
Instructions
Route code-edit reasoning to a cheap model and return exact edit instructions.
Instead of Opus reasoning about what to change (expensive), a cheap model
reads the files, figures out the edits, and returns JSON ``{file, old_string,
new_string}`` pairs that Claude can apply mechanically via the Edit tool.
**How to use the result**: After calling this tool, apply each edit instruction
using the Edit tool with the exact old_string → new_string pairs provided.
Best for: refactoring, bug fixes, adding small features to existing files.
Args:
task: Natural-language description of what to change (e.g.
"Add type hints to all public functions in router.py").
files: List of file paths to read and include in the prompt.
Relative paths are resolved from the current working directory.
Files larger than 32 KB are truncated with a note.
context: Optional conversation context to help the model understand the task.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | ||
| files | Yes | ||
| context | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |