OpenCode
Why ?
I am using zoo code as my default AI development tool, but similar to my services, where i regularily check what other options are out there (which led to my recent switch from bifrost to litellm and my research plan for dify and LangGraph), i try to look what alternatives i have for AI- and agent-driven development.
I tried Zed (definitely not for my workflow. Or i am too dumb to use it properly.), kilo code (not yet there after the rewrite) and the opencode-TUI (nice, but restricted) in the past, but i could not find anything that more fits my style than zoo code. After all, i still want to see what the AI does with the code.
One major downside of Zoo Code is that it gets into trouble when heavily using autospawned subagents while working on multiple projects in parallel. There are already tickets for that and from what i have seen they are actively working on that, but the current (as of 2026-09-26) version still breaks parent-child agent relations too often for my liking. I mean … what’s the point in haveing a mostly hands-free workflow, if you are not able to run multiple in parallel.
So i took a closer look at opencode again, including the opencode GUI - i hoped to have a better view of what happens with the code.
How ?
I try to make clear what i configured why, but for some of the settings to fully make sense you have to know my litellm configuration. I think i will cover that in a future post, for now just take it as given.
Installation
That was straightforward. As i am an arch user, a yay -S opencode-desktop-bin was sufficient.
Configuration
For opencode and opencode-desktop the configuration is the same. The global opencode directory is ~/.config/opencode/ and the file opencode.json contains nearly all the settings that are of interest.
Take note that all actual settings are in this file in json format, while things that have (more or less) prosa-text like agents, rules, skills are in markdown files in the respective directories.
litellm - models
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"<< provider name >>": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "http://<< litellm host and port >>/v1",
"apiKey": "<< virtual api key >>"
},
"models": {
"deepseek-v4-pro": {
"id": "deepseek-v4-pro",
"name": "DeepSeek v4 Pro",
"tool_call": true
},
"deepseek-v4-flash": {
"id": "deepseek-v4-flash",
"name": "DeepSeek v4 Flash",
"tool_call": true
},
{
...
},
"qwen3.8-flash": {
"id": "qwen3.8-flash",
"name": "Qwen 3.8 Flash",
"tool_call": true
},
}
},
}
}Pretty clear. The id has to be the name on litellm, in my case i have no prefixes - if you are directly using Opencode Go or Zen you propably have to prefix them.
The name can be whatever you want and the tool_call tells if the model is allowed/supports tool calling.
I left the fields that you have to fill yourself with << placeholders >>.
litellm - MCPs
Similarily the MCPs:
{
"mcp": {
"litellm": {
"type": "remote",
"url": "http://<< litellm host and port >>/mcp",
"headers": {
"Authorization": "Bearer << virtual api key >>"
},
"enabled": true
},
"filesystem": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/home", "/etc", "/srv", "/opt"],
"enabled": true
},
"memory": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-memory"],
"enabled": true,
"env": {
"MEMORY_FILE_PATH": "~/.config/opencode/memory.jsonl"
}
}
}
}Take note that the authorization works a little different with this one, but it should not be of any problem.
Also - be aware that in reality that enables a lot more MCPs, as the litellm mcp proxy condenses them together, just like bifrost does.
misc
{
"experimental": {
"subagent_depth": 3
},
}See Problems
Problems
By default opencode has a subagent maximum depth of 1.
This is for my workflow pretty useless. The bad thing is, i spent quite some time searching for the correct setting, because this is NOT yet in the documentation of opencode v2 and all online sources point to a not working solution from v1. On top of that, if there is a single non-schema setting in the json, it does not load the whole settings file and you have a “naked” opencode.
The good thing is, i found the correct setting: experimental -> subagent_depth. I had to set it to three (captain -> lieutenant -> coder -> verifier). I am not sure if i want to give it an extra “just to be sure” layer, but if it encounters any problems, the error message is pretty clear anyway.
Summary
For now it behaves like expected. I can fire some tasks into it and let it “blindly” execute it’s work. I am not sure if i like that, but perhaps it is just something to get used to. At least i can work on multiple projects in parallel this way.
I still like haveing the full overview with vscode. Perhaps i’ll try to hijack copilot next, but i really, really don’t trust it.
