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 have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
The system prompt provided to an AI model as part of a conversation is an important piece of context for understanding how it works behind the scenes, and to figure out approximately how many tokens were used and what can be done to reduce said usage.
I opened a narrower PR that may help with part of this use case: #39905
It does not persist system prompts into session exports and does not change transcript storage. Instead, it adds a lightweight local CLI debug command:
opencode debug prompt
The command prints the resolved effective system prompt for the current project/agent/model, including the model base prompt, environment block, instruction files, MCP instructions, available skills, and experimental.chat.system.transform plugin modifications.
This is intended as a smaller debugging primitive for verifying what prompt layers are active, without adding DB persistence or a full context/request dump.
This issue is not yet resolved. Even after switching to OpenCode v2 and using the export functionality provided in both the CLI and Desktop application, full visibility of what is being sent to AI models remains a problem. Users have no way of knowing what exactly is being sent to models other than the messages that are visible to them in the TUI (which are all that is included in exports).
Thanks for the suggestion, @jack5github! You're asking for session exports to include the system prompt the model was actually given, so it's easier to see what context the model had and roughly how many tokens it used.
Right now opencode session export only writes out the saved session messages. The system prompt is built separately for each request and isn't saved, so it can't appear in the export. Maintainers will consider this.
For reference, I already implemented a narrower debugging tool in #39905: opencode debug prompt prints the resolved system prompt for the current project, agent, and model. It does not persist per-request prompts or include them in session exports, but may be useful as a starting point. The PR was closed by automated age/reaction cleanup, not after a technical rejection.
Activity
github-actions commentedon Jul 27, 2026
This issue might be a duplicate of existing issues. Please check:
Please review these issues and let us know if your request is distinct or if it should be linked to one of them.
Rexarrior commentedon Jul 31, 2026
I opened a narrower PR that may help with part of this use case: #39905
It does not persist system prompts into session exports and does not change transcript storage. Instead, it adds a lightweight local CLI debug command:
The command prints the resolved effective system prompt for the current project/agent/model, including the model base prompt, environment block, instruction files, MCP instructions, available skills, and
experimental.chat.system.transformplugin modifications.This is intended as a smaller debugging primitive for verifying what prompt layers are active, without adding DB persistence or a full context/request dump.
jack5github commentedon Sep 29, 2026
This issue is not yet resolved. Even after switching to OpenCode v2 and using the export functionality provided in both the CLI and Desktop application, full visibility of what is being sent to AI models remains a problem. Users have no way of knowing what exactly is being sent to models other than the messages that are visible to them in the TUI (which are all that is included in exports).
opencodejr commentedon Oct 28, 2026
Thanks for the suggestion, @jack5github! You're asking for session exports to include the system prompt the model was actually given, so it's easier to see what context the model had and roughly how many tokens it used.
Right now
opencode session exportonly writes out the saved session messages. The system prompt is built separately for each request and isn't saved, so it can't appear in the export. Maintainers will consider this.Related issues you may want to follow:
Rexarrior commentedon Oct 29, 2026
For reference, I already implemented a narrower debugging tool in #39905:
opencode debug promptprints the resolved system prompt for the current project, agent, and model. It does not persist per-request prompts or include them in session exports, but may be useful as a starting point. The PR was closed by automated age/reaction cleanup, not after a technical rejection.