Repository navigation
feat(plugins): add ov-usage cards showing OpenViking sources per answer - #5653
Merged
Merged
Conversation
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 was referenced Oct 6, 2026
fix(ov-usage): tolerate literal % in source titles; warn installer users about the marketplace
#5662
Closed
t0saki
pushed a commit
that referenced
this pull request
Oct 6, 2026
…nswers (#5663) Move the ov-usage cards (#5653) into openviking-memory as a Claude Code hooks module, so there is one plugin to install instead of two. The module lives in mods/usage/ and is registered through `modules` in hooks/hooks.json, next to the existing command hooks. Cards stay collapsed by default; `/openviking-usage expand|collapse` and the card button are unchanged. This includes #5662's fix for titles with a literal "%". Claude Code ignores the module when it has no hooks modules or has them switched off, and the command hooks run as before. On modules-capable builds older than 2.1.286, the module fails to load (it uses `session.append`), Claude Code logs it, and the command hooks still register. - Remove examples/claude-code-usage-plugin and its marketplace and version-bump entries. - Bump openviking-memory to 0.7.0. - The archive check follows a hooks module's .ts/.tsx entry and its extensionless imports. - The shared-runtime sync emits .d.mts copies only for targets whose TypeScript imports them, so the module doesn't add declaration files to the memory plugin. - Rewrite the docs sections and add a "Source cards" section to the plugin READMEs. Co-authored-by: zhou.wong <zhou.wong@bytedance.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chaucerj
added a commit
to chaucerj/OpenViking
that referenced
this pull request
Oct 6, 2026
volcengine#5653/volcengine#5663/volcengine#5664 moved claude-code to 0.7.1; this PR's shared-lib change still requires a bump relative to the new base, so it lands on 0.7.2. No content conflicts — the usage-card work touches different files than the recall exclude fallback.
1 task
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, an opt-in Claude Code plugin at
examples/claude-code-usage-plugin. Under each answer it draws a card listing the OpenViking sources that answer drew on: what auto-recall injected for the prompt, plus what Claude searched for and read itself through the OpenViking MCP tools or theovCLI.OV · 14 sources · 6 past events · 5 work memories · 2 team docs · 1 skill · 1 read in full [Expand].[Expand]/[Collapse]button, and/openviking-usage expand|collapseapplies to every card.Human Involvement
The maintainer (@ZaynJarvis) set the scope for this first release. @wongzw wrote #5652 and agreed to this co-authored version.
Related Issue
Supersedes #5652 by @wongzw. The commit is co-authored with him and builds on his plugin. Its parsing, lookup classification and card idea come from #5652.
These were cut from #5652, as agreed with the maintainer, to keep the first release small:
$.ui.status)⚠prefixconfig.mjsthroughnodelast-capture.json, lifetime store)+N moreThese #5652 issues are fixed here:
ov find/searchcall through the CLI was counted as "read in full", along with every result. Now onlyread,cat,abstractandoverview, via CLI or MCPread, count as read in full. Search hits are listed as found.viking://resourcesshowed up as fake sources. URIs ending in/or in a scope or top-level directory are dropped.ovCLI wraps long URIs onto the next line, which truncated titles (web版本instead ofweb版本未更新排查请求). Wrapped URIs are now joined.claude --continuebecause the last answer's row mapping was never saved. Each session's cards are now saved at the end of every turn and restored on resume. Verified live.Type of Change
Changes Made
examples/claude-code-usage-plugin/hooks/register.tsx:classic.UserPromptSubmitfor the recall block,tool.callfor lookups,session.appendfor the row the card attaches to,turn.completeto save.ui.renderonAssistantMessage.$.store.examples/claude-code-usage-plugin/hooks/sources.ts: pure parsing of recall blocks, tool output URIs, lookup classification, and what an answer consulted.examples/claude-code-usage-plugin/tests/sources.test.ts: pure-function tests.README.mdandREADME_CN.md. They state which openviking-memory output the plugin depends on: the<openviking-context>block itsUserPromptSubmithook returns..claude-plugin/marketplace.json: adds theov-usageentry..github/scripts/check-plugin-version-bumps.sh: registers the plugin.docs/{en,zh}/agent-integrations/02-claude-code.md: a short optional section.The whole PR is +722 lines (#5652 was +4312). The plugin code is 223 + 193 lines.
Testing
Commands run:
claude plugin validate examples/claude-code-usage-plugin(Claude Code 2.1.289): passed. The validator lists the calls as$.command.register,$.session.id,$.state.*,$.store.*and$.ui.resolve. There is no$.ui.status,$.fs,$.processor$.env.claude plugin test examples/claude-code-usage-plugin: 5 pass, 0 fail.tsc -p examples/claude-code-usage-plugin: no errors..github/scripts/check-plugin-version-bumps.sh origin/main: passed.node --test examples/claude-code-memory-plugin/scripts/marketplace.test.mjs: 8 pass.release-marketplace.test.mjsfails the same 5 cases on a cleanmainon this machine, because there is nozipbinary. Not related to this PR.Live run: a real Claude Code 2.1.289 session with openviking-memory 0.5.2, auto-capture off and no OpenViking writes.
OV · 14 sources · 6 past events · 5 work memories · 2 team docs · 1 skill · 1 read in full. Claude ran twoov findcalls and oneov read, so only the read counted as read in full./openviking-usage expandandcollapseworked.claude --continue.Checklist
Screenshots (if applicable)
Screenshots of the live run (the same answer card, collapsed and then expanded) were taken locally. They can be added on request.
Additional Notes
The plugin depends on the format of openviking-memory's
<openviking-context>recall block. If that format changes, auto-recalled items stop showing. Claude's own lookups keep working.🤖 Generated with Claude Code