OpenCode system prompts
Copied by ../extract.py from https://github.com/anomalyco/opencode, commit d759c548aa (2026-11-14). The prompts live in packages/core/src/.
Source and license
OpenCode is licensed under the MIT License. A copy is in LICENSE.
Changes from the original: the prompts were copied into Markdown files, the tool guidance lines were filled in (see below), and placeholders and tags such as <system-reminder> were wrapped in backticks so that Markdown shows them. The wording was not changed.
How OpenCode builds the system prompt
Every session starts from base.md. Its ${OPENCODE_TOOL_GUIDANCE} slot gets one line per tool for the shell, write and edit tools, and only for tools the session has. The files here show all three lines.
A plugin then picks a prompt by model ID (plugin/optimize.ts):
The plugin skips agents that have their own system prompt.
Files
The Build and General agents use the base prompt. A subagent started by another session gets “You are a subagent spawned by another session.” before its task.
Not copied: the built-in skills in plugin/skill/, the patch grammar in tool/patch-grammar.txt, and tool descriptions written inside TypeScript files.