You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I understand correctly, you'd like more control over what goes into an agent's prompt in v2:
a per-agent instructions list that replaces the global instructions and AGENTS.md discovery (with [] meaning no instruction files);
a per-agent switch to turn off the built-in system/environment prompt;
agents defined in code (~/.config/opencode/agents/myagent.ts / .js).
Right now, v2 loads instructions the same way for every agent. The agent config can change system, model, permissions and so on, but not which instruction files are included. Configured instruction globs are already sorted after matching, so that part should already hold.
The third point can mostly be done today with a plugin: plugins can create and change agents in code through ctx.agent.transform(...), for example to set system from project files. The first two can't be done from a plugin yet, because plugins can't filter the instructions that are added to a session's prompt.
Maintainers will consider this request. I couldn't search for related issues this time, so a duplicate may turn up later.
Activity
github-actions commentedon Oct 5, 2026
This issue might be a duplicate of existing issues. Please check:
instructionsarray.AGENTS.mdinstructions.opencodejr commentedon Oct 27, 2026
Thanks for the detailed proposal, @Roffild!
If I understand correctly, you'd like more control over what goes into an agent's prompt in v2:
instructionslist that replaces the globalinstructionsandAGENTS.mddiscovery (with[]meaning no instruction files);~/.config/opencode/agents/myagent.ts/.js).Right now, v2 loads instructions the same way for every agent. The agent config can change
system, model, permissions and so on, but not which instruction files are included. Configured instruction globs are already sorted after matching, so that part should already hold.The third point can mostly be done today with a plugin: plugins can create and change agents in code through
ctx.agent.transform(...), for example to setsystemfrom project files. The first two can't be done from a plugin yet, because plugins can't filter the instructions that are added to a session's prompt.Maintainers will consider this request. I couldn't search for related issues this time, so a duplicate may turn up later.