anomalyco / anomalyco/opencode

[FEATURE]: opencode could automatically use different models based on task type

Open
#8,456 12 comments 51 reactions 1 assignee View on GitHub

@thdxr is already working on this.

Since Jan 14, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
What feature would you like to see?

Leading agentic coding tools enable configurable model selection for different task types executed by the agent; opencode would benefit from adopting a similar approach.

Enable configuration of defaults via environment variables:
- model_reasoning: the model for complex reasoning and architecture decisions (e.g. anthropic/claude-opus-4-20250514")
- model_execution: the model for code generation and implementation (e.g. anthropic/claude-sonnet-4-20250514)
- model_tool: the model for tool execution or background functionality (e.g. anthropic/claude-haiku-4-20250514)

By default, in plan mode, opencode would automatically use model_reasoning for complex reasoning and architecture decisions and use model_tool for efficient execution of tools (find, grep, etc.). By delegating tool execution to the more efficient model and reasoning to the stronger model, we get the best of all worlds for efficient, speed and cost.

Support hybrid settings (e.g., plan), which use a stronger model (model_reasoning) for planning (still using model_tool when appropriate), then switch to a more efficient model (model_execution) for execution (still using model_tool when appropriate).

So in ~/.config/opencode/config.json:

{
  "model": "anthropic/claude-opus-4-20250514",
  "model_reasoning": "anthropic/claude-opus-4-20250514",
  "model_execution": "anthropic/claude-sonnet-4-20250514",
  "model_tool": "anthropic/claude-haiku-4-20250514"
}

or for hybrid mode:

{
  "model": "codeplan",
  "model_reasoning": "anthropic/claude-opus-4-20250514",
  "model_execution": "anthropic/claude-sonnet-4-20250514",
  "model_tool": "anthropic/claude-haiku-4-20250514"
}

Similar issues:

Related issues:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.