Repository navigation
feat(plugins): add ov-usage, an opt-in Claude Code plugin showing OpenViking sources per answer - #5652
Closed
wongzw wants to merge 5 commits into
Closed
feat(plugins): add ov-usage, an opt-in Claude Code plugin showing OpenViking sources per answer#5652wongzw wants to merge 5 commits into
wongzw wants to merge 5 commits into
Conversation
…nViking sources per answer OV-Usage shows which OpenViking sources each Claude Code answer consulted: what auto-recall added and what Claude searched for and read on its own, in a sidebar or as cards under each answer, with a status line. It is opt-in: listed in the root Claude marketplace as ov-usage@openviking, not installed by the installer, and not added to the installer's directory marketplace, whose archive does not ship this folder. It reads openviking-memory's own state files and runs its config loader from the install Claude Code's plugin registry names. The plugin README documents this dependency and the plugin's other limits. Tests run on Claude Code's plugin test runner (claude plugin test), not the repository's Node CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the code that never touches Claude Code's engine handle into its own modules: labels (strings.ts), parsing of recall blocks, the startup context, URIs, redaction and fingerprints (parse.ts), what a source is and what an answer consulted (sources.ts), and the formats of openviking-memory's settings and the totals across sessions (openviking.ts). Everything that uses $ stays in register.tsx: Claude Code traces $ only within the module hooks.json names and refuses a module that passes it to an imported function. The sidebar render moves out of its hook into renderPane. Removes code nothing used: LAYER_COLOR, headline() and an unused read in the sidebar. Behavior is unchanged; the 88 plugin tests pass as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n one owner - Settings now reads commitTokenThreshold and says "saves to memory every 20,000 tokens". openviking-memory's Claude Code capture commits by tokens; the commitTurnThreshold it showed before is not used there. - classifyToolCall in sources.ts decides whether a tool call is an OpenViking lookup or write (MCP tool or `ov` CLI), replacing checks spread across parse.ts, sources.ts and register.tsx. - replyFor moves to parse.ts, beside the fingerprints it matches on. - tool.call reads the Bash command through Claude Code's narrowed type, not a cast; MCP arguments are read by name, since the tool names vary by install. - Turn.lookups and the saved-session fields are required: there are no earlier saved formats to fall back for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…READMEs Settings shows openviking-memory's commitTokenThreshold, and the Development section names classifyToolCall in sources.ts and the transcript-row matching in parse.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 of 21 tasks
t0saki
pushed a commit
that referenced
this pull request
Oct 6, 2026
…er (#5653) OV-Usage is an opt-in Claude Code plugin. Under each answer it draws a one-line card with the OpenViking sources the answer drew on: what auto-recall injected, and what Claude searched for and read itself. The card expands to the full source list and Claude's lookups, with a button or /openviking-usage expand|collapse. It reads only the <openviking-context> block openviking-memory's UserPromptSubmit hook returns, and Claude's OpenViking MCP and `ov` CLI calls. Only real reads count as "read in full"; search hits do not. Cards are kept per session in the plugin store, so they survive `claude --continue`. This is a slimmer first release of #5652: conversation cards only, no sidebar, status line, settings panel, cross-session totals or mute. Co-authored-by: zhou.wong <zhou.wong@bytedance.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds OV-Usage (
examples/claude-code-usage-plugin/), an opt-in Claude Code plugin that shows which OpenViking sources each answer consulted: what auto-recall added for the prompt, and what Claude searched for and read on its own. It shows this in a sidebar or as cards under each answer, plus a status line, with totals for the session and across sessions.It's opt-in: listed in the root Claude marketplace as
ov-usage@openviking, not installed by the installer, and it doesn't change how openviking-memory recalls or captures (apart from memories a user mutes for the current session).Human Involvement
Related Issue
None opened yet. Happy to open one if maintainers prefer to agree the design first (see Additional Notes).
Type of Change
Changes Made
examples/claude-code-usage-plugin/: hooks module (hooks/register.tsx) plus pure modules (parse.ts,sources.ts,openviking.ts,strings.ts), state contract (types/index.d.ts), 88 tests, and README / README_CN covering requirements, what it reads and stores, and limitations..claude-plugin/marketplace.json: adds theov-usageentry (git-subdir,examples/claude-code-usage-plugin)..github/scripts/check-plugin-version-bumps.sh: registers the plugin so later changes must bump its version.docs/{en,zh}/agent-integrations/02-claude-code.md: short "Optional: OV-Usage" section with the install command.examples/.claude-plugin/marketplace.json: that file ships in the installer archive, which doesn't include this folder, so it would point at a missing directory.Testing
Commands run:
claude plugin validate examples/claude-code-usage-plugin: passesclaude plugin test examples/claude-code-usage-plugin: 88 passtsc -p examples/claude-code-usage-plugin --noUnusedLocals(after Claude Code generates its types): passesnode --test examples/claude-code-memory-plugin/scripts/marketplace.test.mjs: 8 passbash .github/scripts/check-plugin-version-bumps.sh upstream/main: passesgit diff --check: cleanThe plugin's tests run on Claude Code's plugin test runner (
claude plugin test), notnode --test, so the repository's Node CI doesn't run them.Checklist
Screenshots (if applicable)
Text examples of the sidebar, cards and status line are in the plugin README.
Additional Notes
Points for reviewers (area: Integration / agent plugins, cc @t0saki @ZaynJarvis):
hooks.jsonwithmodules), which need Claude Code 2.1.286+ and are still early access. On older versions the plugin installs but shows nothing.last_inject.md,last-recall.json,last-capture.json) and runs itsscripts/config.mjs, located through Claude Code's plugin registry. These aren't a published interface; the README says so. If maintainers prefer, a follow-up could have openviking-memory publish one documented, versioned snapshot for tools like this to read.recallExcludeUris.$stays inregister.tsx, because Claude Code traces$only within the modulehooks.jsonnames and refuses a module that passes it to an imported function. Pure code is split into the other modules.