Skip to content

[FEATURE]: Ability to override tool prompts - create model toolsets #5728

Closed

Description

@conradkoh

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

I want to have the ability to configure the tool prompts and override them. The problem I am trying to solve is that the prompt for the tool skews the AI model's usage of other tools.

For example, I have a tool raggrep that does semantic search. But because of the way that the grep tool or bash tool are defined (e.g. to push the AI to use the grep tool over running grep via bash), the raggrep tool rarely gets executed.


Possible solutions

Solution 1: Model type as first-class citizen

Ideally, we recognize that the effectiveness of tools can be greatly dependent on the model that is using the tools. Instead of just patching over it, the whole initial system prompt + environment + tool prompts should be a first-class citizen. When the model changes, all of these should be able to change.

//opencode.jsonc
{
    "build": {
      "mode": "primary",
      "prompt": "{file:./prompts/build.md}", //existing functionality on system prompt override
      "tools": {
        "bash": {
          "description": "custom description"
        }
      }
    }
}

Solution 2: Dynamic prompts

To support dynamic switching of toolsets in a declarative configuration might be challenging to maintain. An alternative is to add hooks that may alter a prompt, or completely override it - this would provide flexibility without the maintenance burden.

Example:

import type { PromptHooks } from '@opencode-ai/prompt';
import { tool } from '@opencode-ai/plugin';
// hook/prompt.ts
const hooks: PromptHooks = (e, oc) => {
    if(e.next.model.includes('claude')) {
        oc.tool.updatePrompt({
            "description": "custom tool description",
            "args": {
                "arg1": tool.schema.string().describe("custom arg description")
            }
        });
    }
}

export default hooks;

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Dec 18, 2025
  2. rekram1-node commented on Dec 18, 2025

    @rekram1-node
    Collaborator

    that ability makes sense to have, would say tho if u have any suggestions for how we can tweak tools for different models we would prolly be happy to bake that in first party

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions