Skip to content

[OpenCode Plugin] Add turn-level cursor to memory_transcript for precise L3 retrieval #505

@InSciTech

Description

@InSciTech

Problem

Problem

The OpenCode L3 memory_transcript path can only retrieve a tail window of a session (--limit) or the last turn (--last-turn). It cannot jump to an arbitrary turn in a long session,
so transcript drill-down becomes coarse and inefficient as sessions grow.

Current behavior

  • plugins/opencode/scripts/parse-transcript.py loads messages by session_id ordered by time_created.
  • The script exposes --limit and --last-turn, but no stable turn/message cursor.
  • The OpenCode capture flow stores daily markdown summaries, but does not persist a reusable turn anchor for later drill-down.

Why this matters

For long sessions, L3 recall often needs to land on the exact turn that introduced a decision, error, or code snippet. Without a turn-level cursor, the tool has to scan too much
surrounding text and can return more irrelevant context than needed.

Reference

The Claude Code plugin already writes turn-level anchors and supports drilling into a specific turn with surrounding context via memsearch transcript ... --turn ... --context ....

Proposed solution

Proposed change

Add a stable cursor to the OpenCode capture/transcript flow, for example:

  • store a turn/message identifier in the anchor
  • allow memory_transcript to accept --turn or --message-id
  • add a --context option so the tool can return the target turn plus surrounding messages

The exact cursor field can match OpenCode's schema, as long as it reliably identifies a turn and its nearby context.

Expected result

memory_transcript can jump directly to the relevant turn instead of only reading a session tail.

Alternatives considered

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions