Skip to content

[FEATURE]: Add /dump-context command for inspecting inference context #14674

Closed

Description

@ualtinok

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

When debugging agent behavior or prompt engineering, there's no way to see the full context that gets sent to the provider — the assembled system prompt, message history, and provider options. You have to read the source code and mentally trace LLM.stream() to understand what the model actually receives.

A /dump-context slash command that writes the full inference context to a file would help. Two variants:

  • /dump-context — human-readable text with sections for system prompt, messages, and provider options
  • /dump-context-json — structured JSON for programmatic use

Output goes to .opencode/dumps/ in the project directory. Gated behind experimental.dump_context config flag, disabled by default.

Why would you possibly want this on your workflow?

  • Prompt debugging: see exactly what system prompt the model receives after all layers are assembled
  • Provider comparison: dump context, switch providers, compare what each one gets
  • Understanding compaction: see what the context looks like after compaction has run
  • Bug reports: attach the actual context when reporting unexpected model behavior

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 22, 2026
  2. github-actions commented on Feb 22, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or closely related to existing issues. Please check:

    If your request is meaningfully distinct from those, feel free to clarify the differences.

  3. ualtinok commented on Feb 22, 2026

    @ualtinok
    ContributorAuthor

    This issue might be a duplicate of or closely related to existing issues. Please check:

    If your request is meaningfully distinct from those, feel free to clarify the differences.

    Those issues request debug log lines, runtime telemetry metrics, or compaction diagnostics. This is different — it's a one-shot file dump of the full assembled inference payload (system prompt + messages + provider options) so you can inspect exactly what the model receives at any point.

  4. VictorTaelin commented on Mar 2, 2026

    @VictorTaelin

    this is a very important feature

  5. alesspalma commented on Mar 16, 2026

    @alesspalma

    any update on this?

  6. katsar0v commented on Mar 29, 2026

    @katsar0v

    I also want this

  7. Cold-sand commented on Apr 1, 2026

    @Cold-sand

    This feature is very importan for me

  8. jepachecoam commented on Apr 6, 2026

    @jepachecoam

    This feature is very importan for me X2

  9. tomasz-grz commented on Apr 17, 2026

    @tomasz-grz

    +1

  10. ualtinok commented on Apr 23, 2026

    @ualtinok
    ContributorAuthor

    Closing the issue as I published new plugin that does this in a better way:

    https://github.com/cortexkit/opencode-interceptor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions