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
I'd love the ability to edit the system prompt/toggle between system prompts. My main interest in this would be to be able to use the opencode interface for tasks other than coding. Like similar to toggling between PLAN and BUILD it'd be cool to toggle between CODE and CHAT or something like that.
Reacted by Gabriel Sams (PNNL), Md. Abu Taher, Sewer., Sushmanth Chintalapudi, avonar, David Codeco , Parth, hx507, Ivan Nikishev, ZheNing Hu and 12 more
I launch opencode in Build plan, send a hi, then I look at the text being sent, and I see a bunch of unrelated junk like:
hello world\\n# Your Model\\n- Name: local llm\\n- Provider ID: llamacpp\\n- Model ID: local\\n# Code Mode\\n\\nThe tools listed below cannot be called directly. I did write the "hello world" but why would I ever want to spend tokens on useless information like "Model ID: local".
There's a lot of content, none of which I want to see for my local coding agent and the solution suggested doesn't work.
Update from the linked issue — turns out, the text I see in the prompt isn't considered part of the prompt by OpenCode, but instead kinda an additional info. I guess that turns that into an RFE… Edited the issue accordingly.
Activity
adamdotdevin commentedon Jul 23, 2025
you can create custom modes with custom system prompts:
https://opencode.ai/docs/modes/
ChaseRensberger commentedon Jul 24, 2025
My fault for not checking the docs. Thanks for taking time out of your day to send that link.
docs: add empty system prompt to codex command for speed (#1300)
fix(security): keep orchestrator secrets off argv and logs (anomalyco…
cbarkinozer commentedon May 15, 2026
The link was broken, the correct one is: https://open-code.ai/en/docs/modes which says it is deprecated now. "Caution: Modes are now configured through the agent option in the opencode config. The mode option is now deprecated. Learn more.". As I understand we can now change our defined agent's system prompt:
{ "$schema": "https://opencode.ai/config.json", "agent": { "build": { "mode": "primary", "model": "anthropic/claude-sonnet-4-20250514", "prompt": "{file:./prompts/build.txt}", "tools": { "write": true, "edit": true, "bash": true } }, "plan": { "mode": "primary", "model": "anthropic/claude-haiku-4-20250514", "tools": { "write": false, "edit": false, "bash": false } }, "code-reviewer": { "description": "Reviews code for best practices and potential issues", "mode": "subagent", "model": "anthropic/claude-sonnet-4-20250514", "prompt": "**You are a code reviewer. Focus on security, performance, and maintainability.**", "tools": { "write": false, "edit": false } } } }Even though this example does not showcase, we should change the plan and the build agent's system prompts.
hpietukhin commentedon May 22, 2026
@cbarkinozer those are docs: https://opencode.ai/docs
Hi-Angel commentedon Nov 2, 2026
@cbarkinozer doesn't seem work in 2.2.4, unless I misconfigured something.
Have this
opencode.json:{ "$schema": "https://opencode.ai/config.json", "enabled_providers": ["llamacpp"], "provider": { "llamacpp": { "npm": "@ai-sdk/openai-compatible", "name": "llama-server (local)", "options": { "baseURL": "http://127.0.0.1:9931/v1" }, "models": { "local": { "name": "local llm" } } } }, "model": "llamacpp/local", "small_model": "llamacpp/local", "agent": { "build": { "mode": "primary", "model": "llamacpp/local", "prompt": "hello world", } } }I launch opencode in
Buildplan, send ahi, then I look at the text being sent, and I see a bunch of unrelated junk like:hello world\\n# Your Model\\n- Name: local llm\\n- Provider ID: llamacpp\\n- Model ID: local\\n# Code Mode\\n\\nThe tools listed below cannot be called directly. I did write the "hello world" but why would I ever want to spend tokens on useless information like "Model ID: local".There's a lot of content, none of which I want to see for my local coding agent and the solution suggested doesn't work.
Hi-Angel commentedon Nov 2, 2026
I'm assuming this functional has regressed, so I created an issue describing how to reproduce it
Hi-Angel commentedon Nov 2, 2026
Update from the linked issue — turns out, the text I see in the prompt isn't considered part of the prompt by OpenCode, but instead kinda an additional info. I guess that turns that into an RFE… Edited the issue accordingly.