ollama_multi_file_refactor_propose
Propose multi-file refactor. REFACTOR. Coordinated multi-file refactor PLAN — NO WRITES. Server reads each file in files (1-20 paths, path validation via SOURCE_PATH_NOT_FOUND), hands the bodies + change_description to the Workhorse tier, and returns {per_file_changes:[{file, before_summary, after_summary, risk_level, change_kinds[]}], cross_file_impact, affected_imports:[{from, to, files[]}], verification_steps, weak}. change_kinds are normalized from {rename, signature-change, import-update, move, delete, new}. Files the model invents (not in input) are stripped. Thin output → weak=true. Use BEFORE touching files so Claude can see a coordinated plan. Pair with ollama_refactor_plan for sequencing and ollama_batch_proof_check for verification.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
files |
any | yes | — | Source file paths the refactor touches. Server reads them — Claude does not preload. Min 1, max 20. |
change_description |
string | yes | — | What the refactor should accomplish, in 20-2000 chars. Be specific — vague descriptions produce vague plans (likely weak=true). |
per_file_max_chars |
integer | no | — | Chars to read per file (default 60_000). |
backend |
"cloud" \ |
"local" |
no | — |
Full input schema
Section titled “Full input schema”The JSON Schema below is generated from the same zod schema the server validates against at the wire — it cannot drift from runtime behavior.
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "files": { "description": "Source file paths the refactor touches. Server reads them — Claude does not preload. Min 1, max 20." }, "change_description": { "type": "string", "minLength": 20, "maxLength": 2000, "description": "What the refactor should accomplish, in 20-2000 chars. Be specific — vague descriptions produce vague plans (likely weak=true)." }, "per_file_max_chars": { "description": "Chars to read per file (default 60_000).", "type": "integer", "minimum": 1000, "maximum": 200000 }, "backend": { "description": "Optional per-call backend directive (v2.9). 'cloud' escalates THIS call to Ollama Cloud — works in cloud standby (OLLAMA_API_KEY set, OLLAMA_CLOUD_PRIMARY unset) and cloud-primary modes; errors with CLOUD_NOT_CONFIGURED when no cloud is configured (never silently runs local while claiming escalation). 'local' pins the call to the local backend (zero egress) even under cloud-primary. Omit for the mode default. Escalated calls disclose egress loudly and carry backend provenance on the envelope. Synthesis quality on this tool scales sharply with model class — on a repo-scale job the local 8B is often the binding constraint, not the evidence. Tools where a local model is genuinely adequate (ollama_summarize_fast, ollama_classify, ollama_triage_logs, and every no-LLM tool) deliberately do NOT offer this field.", "type": "string", "enum": [ "cloud", "local" ] } }, "required": [ "files", "change_description" ]}Envelope
Section titled “Envelope”Every tool returns the standard envelope — tier_used, model, tokens_in/tokens_out, elapsed_ms, backend provenance, warnings. See Envelope & tiers.
Source
Section titled “Source”Schema + handler: src/tools/multiFileRefactorPropose.ts · registration: src/index.ts
Back to the Tool Reference.