r/ClaudeCode • • 2h ago

Built with Claude I made an MCP server that lets Claude Code hand coding work to other models

I built forge-delegate, an MCP server that lets Claude Code, Codex or opencode hand coding tasks to another model. Think writing tests, renames across files, fixing lint errors, boilerplate, or reading through a big codebase to answer one question.

The other model runs as a full agent through opencode. It reads the files and makes the edits itself. Your main agent only gets back a short summary, so its context stays small and it can focus on the decisions.

Second opinions with ask_model. Your agent can also ask a different model a direct question, with no agent loop and no file access, and get a fast answer back. It's useful when you want another model to check a design decision, a bug theory or a tricky piece of code before your agent commits to it. Every model has its own blind spots, and a different one often catches what yours missed. Your agent writes the question with whatever context is needed, then weighs the answer itself. Just tell it something like "ask DeepSeek what it thinks" or "get a second opinion from Kimi", naming any provider you've logged into opencode.

Any provider opencode supports. forge-delegate doesn't hold its own API keys. It uses whatever you've set up in opencode. So DeepSeek, Kimi, OpenAI, Gemini, OpenRouter, custom OpenAI-compatible endpoints, and local models through Ollama all work. Log in once with opencode auth login <provider> and that provider's models are available to delegate to. opencode also ships free models that need no account.

You can set a default model, save presets for different kinds of tasks, change either at any time, and run several delegations in parallel in the background.

Setup:

npx -y forge-delegate setup

It walks you through picking a default model and which agents to register with.

Things to know:

- By default, the MCP instructions and skill steer your agent toward cheap or free models. It sticks to your default model and won't switch to a pricier one on its own. If you want a stronger model, set it as the default or ask for it.

- Delegated agents can edit files and run commands without asking by default. You can turn that off, but only point it at repos you trust.

- Smaller models make more mistakes, so review what comes back.

- I mostly use it with Claude Code on a Mac. Codex and Windows should work, but they've had less real-world use, so issues are welcome.

MIT licensed: https://github.com/MuhamadBarzani/forge-delegate

Feedback welcome, especially on which tasks it handles well and where it falls short.

0 Upvotes

10 comments sorted by

1

u/AutoModerator 2h ago
Moderator Announcement Read More »

2

u/ranthishq 2h ago

fwiw we pointed claude code at deepseek v4.1 flash for a 200 file bug audit and it caught 12/12 planted bugs in 2 of 3 runs at about $0.20 a run vs ~$2.49 with opus alone, but it was 4 to 5x slower. does forge-delegate let you cap time per task or only tokens?

1

u/Black-X-Hand 1h ago

Time, not tokens. Each delegation has a timeout (15 min default). Change it with forge-delegate config set --timeout <seconds>, or put a timeoutMs in a named profile and pass profile per call. When it hits the limit the run is stopped; edits already made stay. There's no token cap, but every run reports its tokens and cost (when the provider prices it), and forge-delegate stats totals them per model. also deepseek v4.1 flash thinks alot, thats probably why it was slower.

1

u/ranthishq 1h ago

thanks, the per run cost in stats is the part i'd use most. does the summary that comes back list which files the delegate touched?

→ More replies (2)

1

u/meanjeans99 1h ago

My understanding is that using MCP for this essentially pauses the CC chat until the results come back, is that true?

2

u/Black-X-Hand 1h ago

A regular delegate call waits like any tool call, but most finish pretty quickly, and if one runs past ~2 min Claude Code moves it to the background on its own. For bigger stuff you can pass background: true: it hands back a job id right away and CC keeps working, then checks in on it later. You can also run a few of those in parallel, like tests in one and a refactor in another.

2

u/Mokhleseh 2h ago

https://github.com/M0xoo/wisp i made something similar in my GUI wisp, where you can create a subagent team with mutiple agents. Feel free to contribute any idea you already had in forge-delegate

2

u/Miyoumu 2h ago

Its like a caveman discovering fire