llm_edit
Route code-edit tasks to a budget model and receive exact old_string/new_string instructions to apply with the Edit tool.
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task": "<task>",
"files": "<files>"
},
"name": "llm_edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | ||
| files | Yes | ||
| context | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |