[FEATURE] Hybrid local/cloud execution — route simple tasks to a local model, complex tasks to Claude
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
A significant portion of Claude Code's daily workload consists of low-complexity operations: trivial file edits, log parsing, simple regex/refactor work, boilerplate generation, lint fixes, commit message drafting, doc lookups, simple bash one-liners, and similar mechanical tasks. Today, every one of these round-trips to the cloud and consumes tokens at the same rate as deep architectural reasoning.
Meanwhile, many power users have substantial idle GPU capacity on their workstations. In my own setup I have 2x NVIDIA RTX 5090 (64 GB VRAM total) that could comfortably run modern open-weight coding models (Qwen2.5-Coder 32B, DeepSeek-Coder-V2, Llama 3.3 70B quantized, etc.) — but Claude Code currently has no way to leverage that hardware.
The result is: (1) avoidable token spend on tasks a 7B–32B local model would handle perfectly well, (2) higher latency on trivial ops than necessary, and (3) wasted local compute that the user already paid for.
Proposed Solution
A hybrid execution mode in Claude Code that intelligently routes work between a local model and the cloud Claude model based on task complexity, with the cloud model remaining the orchestrator and final authority.
Core components:
- Local hardware probe — on first run (or via
claude config detect-hardware), inspect available GPUs (CUDA/ROCm/Metal/MPS), VRAM, system RAM, and CPU. Recommend a suitable local model tier based on the result. - Guided local model setup — offer to download a right-sized open-weight coding model via Ollama, llama.cpp, vLLM, or LM Studio (let the user pick the runtime). Tiers could be roughly: ≤16 GB VRAM → 7B class, 24–32 GB → 14B class, 48 GB+ → 32B class, 64 GB+ → 70B quantized or MoE.
- Task classifier / router — before each tool turn, the orchestrator decides whether a sub-task is "local-eligible." Eligible examples: single-file edits under N lines, regex/string transforms, log filtering, formatting, simple commit messages, file summarization, simple shell command generation. Non-eligible: multi-file reasoning, architectural decisions, debugging across modules, security-sensitive changes, anything requiring full repo context.
- Cloud-as-supervisor pattern — Claude (cloud) defines the sub-task, hands it to the local model with a tight prompt + acceptance criteria, validates the result, and either accepts, retries, or escalates to itself. This keeps quality bounded by Claude's judgment, not the local model's.
- Transparent metrics — show per-session: tokens saved, tasks routed locally vs. cloud, local latency vs. cloud latency. Let users see the ROI.
- User controls —
claude config hybrid <off|conservative|aggressive>, plus per-task overrides (/local,/cloud) and a hard allowlist/denylist of task types.
Alternative Solutions
Alternatives Considered
- Pure local Claude Code via open-weights — quality gap is too large for non-trivial work; not a real substitute.
- External proxies that intercept and reroute — fragile, unsupported, and lose Claude's orchestration context.
- Manual model switching — places the routing burden on the user, defeats the point.
Why This Fits Claude Code Specifically
Claude Code already operates as an agent that decomposes work into sub-tasks and tool calls. Adding a "local executor" as just another tool in the orchestration layer is architecturally clean — the cloud model stays in charge, but gains a cheap local worker for the easy stuff. This is a natural extension of the existing agentic pattern, not a rewrite.
Environment
- Platform: Linux / Windows / macOS (all relevant)
- Hardware example: 2x NVIDIA RTX 5090 (64 GB VRAM)
- Use case: Oracle ERP consulting work + AI tooling development, multi-hour daily Claude Code sessions
Happy to provide more detail or help prototype the routing heuristics if useful.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
Use Cases
- Cost-sensitive heavy users — consultants, agencies, and indie developers running Claude Code 8+ hours/day who burn tokens on mechanical tasks.
- Workstations with idle high-end GPUs — RTX 4090/5090, dual-GPU rigs, Apple Silicon Ultra (256–512 GB unified memory), workstation Threadrippers with pro cards.
- Privacy-conscious environments — regulated industries where keeping certain file contents on-device (even just for trivial ops) is preferable.
- Low-bandwidth / offline-tolerant work — partial functionality when connectivity is poor.
Additional Context
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗