feat: allow custom system prompts in global, project or custom directories #7264
+45
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature Request: #7101
This PR adds support for a priority overrule of the opencode bundled system prompts in global, project or custom directory (via Env Setting)
Why is it helpful?
In a reddit post, someone started creating very compact system-prompts to free up capacity in the context window. This patch allows using tailored system prompts instead of the bundled prompts.
I hope this will increase creative and productive evolution on the system prompts for opencode and make it even more awesome.
How does it works:
opencode (currently) uses the following system prompt files:
Modelname -> Filename
anthropic / claude -> anthropic.txt
gpt-5 -> codex.txt
gpt-, o1, o3 -> beast.txt
gemini- -> gemini.txt
Fallback, if nothing matches -> qwen.txt
With this PR, opencode codes will load the matching system prompt file in following order (highest priority to lowest priority):
Q&A:
Why not use AGENTS.md?
Why are the prompts under the /prompt/ directory?
How to start with a custom system prompt?