image-analysis-routing
Image Analysis Routing: Vision Role First
Section titled “Image Analysis Routing: Vision Role First”For ANY image to analyse (pasted, attached, or a file path), run the router’s vision role instead of native vision:
bun <claudeDir>/scripts/mr-role.cjs call --role vision --file <path> --prompt "<question>"
--file repeats (up to 4). The UserPromptSubmit hook image-routing-role.cjs injects this command with the paths filled in for a main-session prompt with an image marker or absolute image path.
Cases the hook does NOT cover (route by hand): a mid-turn message or sub-agent turn (no hook fires: run the command yourself) · no mr-role.cjs (router absent or older: native Read is correct) · Exit 4 or 5 (chain exhausted, no auth: native Read for that image, tell the user once, do not retry the role for later images) · Exit 2 or 3 (usage error, bad file: fix the command or file, then native Read) · PDF (images only: Rasterise pages first, pass the PNGs). Scope: image analysis only, not generation; features.imageAnalysisRouting: false disables the hook. Details: docs/image-analysis-routing.md.