Skip to content

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):

Model ID containsPromptEffect
gpt and astramodel-gpt-astra.mdreplaces the base prompt
gptmodel-gpt.mdreplaces the base prompt
kimimodel-kimi.mdreplaces the base prompt
trinity (Arcee)model-trinity.mdreplaces the base prompt
muse (Meta)model-meta.mdreplaces the base prompt; {{MODEL_NAME}} becomes the model’s name
claudemodel-anthropic.mdadded after the base prompt

The plugin skips agents that have their own system prompt.

Files

FileUse
agent-explore.mdsystem prompt of the read-only Explore subagent
agent-title.mdhidden agent that names sessions
agent-summary.mdhidden agent that summarizes a session
claude-code-append.mdadded to Claude Code’s own prompt when OpenCode runs a model through the Claude Code harness; the agent’s role follows under # Agent role (from OpenCode)
goal-kickoff.md, goal-reminder.md, goal-continuation.md, goal-judge.mdthe goal feature: starting a goal, reminding the model of it, continuing it, and judging whether it is met
command-initialize.mdbuilt-in command that creates or updates AGENTS.md
command-review.mdbuilt-in code review command
command-schedule.mdbuilt-in command for scheduled prompts
tool-patch.md, tool-todowrite.mdtool descriptions kept in text 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.