OpenCode Plugin
nexus-session-guard
v1.2.0PublishedEnforces session append discipline: detects code-changing tool completions with no matching nexus_session_append and injects a reminder.
Overview
Agents frequently skip nexus_session_append after completing work, leaving gaps in the session audit trail. This plugin tracks user-turn and append-turn indices, detects when a code-changing tool (Edit, Write, MultiEdit, non-read-only Bash, nexus_task_create, nexus_adr_create, nexus_adr_decide) completes without a session entry recorded since the last user instruction, and injects a system reminder into that tool's output. In Claude Code, it also adds one line at session start when no open Nexus session matches the current staging/release-X.Y.Z branch (NEXUS_SESSION_GUARD_RELEASE_NUDGE=off disables it).
Registered Hooks
Events this plugin listens to in the OpenCode runtime.
tool.execute.afterDetects trigger tools (Edit/Write/MultiEdit/non-read-only Bash/nexus_task_create/nexus_adr_create/nexus_adr_decide) and injects a session-append reminder when no entry was recorded since the last user turn.
event (message.created)Tracks the user-turn index used to determine whether a session append is still owed.