/stockroom:sr-semanticfrom stockroom
Meaning-based (vector) search over your local warehouse of agentic-coding history. Reach for this when the question is about content or concepts you can describe but not name exactly — "conversations about flaky tests", "where did we debug the deadlock" — including a harness or speaker scope. Not exact ids, counts, dates, or projects (that is sr-query).
Ships in stockroom. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
sr-semantic runs pure vector search against the stockroom warehouse — the single-file DuckDB database of your captured agentic coding harness history. It embeds your natural-language query and returns a ranked list of the most semantically similar messages. The surface is read-only by construction: you cannot corrupt anything by searching.
Reach for sr-semantic when the question is about meaning — content you can describe but not name exactly:
Do not use sr-semantic for exact or structured lookups — a known session_id/message_id, counts, GROUP BY, joins, date ranges, or a project. Those have a known shape and belong to the sr-query skill (raw read-only SQL). When you are not sure which is right, that judgement belongs to the sr-search skill.
Two scopes are part of this surface, because they change which messages are nearest:
| Question | Flag |
|---|---|
| Where I talked about it | --role user |
| Where you talked about it | --role assistant |
| Where we talked about it | omit --role |
In one harness (today cursor or claude; later harnesses are the same flag) | --harness <name> |
The flags combine. Omit a flag to leave that dimension open. --role accepts only user and assistant. --harness is an exact string; an unknown name is an empty result, not an error. An empty scoped result means nothing in that scope matched — drop the flag before concluding the topic is absent.
Phrase the query as a description of the content you want, in natural language: a short phrase or sentence naming the topic, activity, or concept ("incremental re-embed of new content", "fixing the REUSE licensing layout"). Do not add any instruction preamble — the model's query prefix is applied automatically; hand-adding it would double it.
stockroom semantic "how does the warehouse locking work"
If command -v stockroom fails, the machine isn't set up yet: tell the user to run the sr-initialize skill, and don't attempt any other invocation.
One runtime note: the model loader may print weight-loading progress to stderr — stdout stays clean for pipes; ignore the noise. The Hub's unauthenticated-request notice is suppressed; stockroom does not use a token for the local model.
-k, --format, and --detailThe defaults are already safe for an agent, so reach for the flags only when a situation calls for it.
-k / --limit — result count, default 10Lower it (-k 3) when you expect one obvious winner; raise it when you're casting wide before narrowing. Must be a positive integer.
--format — output shape, default tsv| Value | Shape | Use it when |
|---|---|---|
tsv (default) | Header rank score harness session_id message_id role preview + tab-separated rows, no count trailer | Default. Stream-friendly for you and for unix pipes. session_id and message_id are on every row, so you can hand a hit to sr-query without changing format. |
json | A single {"results": [...]} object — each result carries the same identifiers plus a numeric score and a text field | A user asks for structured output, or you want jq. |
table | Column-aligned ASCII with a (N results) trailer | A user asks for something human-readable / a copy-paste command to look at. |
Lead with the default tsv. Offer --format table or --format json when the user asks for human-readable or structured output.
score is cosine similarity (higher = closer, ~0–1). Scores are relative quality within this corpus and query — read the previews to judge relevance; don't threshold on an absolute score.
--detail — preview width, default snippetThe preview/text field is truncated at read time so ranked previews can't flood your context. Truncation is display-only — full text is always retrievable.
| Value | Budget | Use it when |
|---|---|---|
compact | ~40 chars | Scanning many candidates cheaply before picking one. |
snippet (default) | ~120 chars | Default. Enough to recognize a hit without dumping it. |
full | unbounded, single-line | Almost never here — prefer the sr-query handoff below for whole text. |
raw | unbounded, exact whitespace | Exact stored text (newlines intact). Prefer with --format json; almost never on a large -k. |
An over-budget preview is elided with a marker reporting how many characters were hidden, e.g. …(+2539). That marker is your signal that more exists.
These are the failure modes this skill exists to prevent:
--detail full/raw with a large -k — ten untruncated messages can be tens of thousands of characters. Scan at the default snippet (or compact), pick the hit you want, then fetch just that one message's whole text via the sr-query handoff using the message_id already printed:stockroom query --format json --detail raw \
"SELECT text FROM messages WHERE message_id = '<message_id-from-the-results>'"
stockroom query "SELECT
(SELECT count(DISTINCT owner_id) FROM embeddings WHERE owner_table = 'messages') AS embedded_messages,
(SELECT count(*) FROM messages) AS total_messages"
# lagging badly? -> stockroom embed (incremental; needs torch)
sr-query keyword ILIKE, or the coverage check above) instead of thrashing.Each failure is a clean stderr message + exit code — read it and take the matching action, don't loop.
If stderr says restoring torch from the hashed freeze, torch was missing and a usable freeze exists. The command restores it and retries. Wait for it to finish.
| Message | Exit | What it means / next action |
|---|---|---|
error: empty query (…) | 2 | No search text was passed. Provide a query. |
error: --limit must be a positive integer | 2 | Bad -k. Fix the number. |
error: no warehouse found at … — run \stockroom ingest` first` | 1 | The warehouse hasn't been built. Tell the user to run stockroom ingest (or sr-initialize if the machine was never set up); don't retry. |
error: torch is not installed in the engine environment at … | 1 | Torch is missing and there is no usable freeze to restore. Re-run sr-initialize. Do not retry the query. |
error: torch restore failed (…) | 1 | The command tried to restore torch from the freeze and that restore failed. Re-run sr-initialize. Do not retry the query. |
error: encoder check failed (…) | 1 | The encoder did not load. Re-run sr-initialize. Do not retry the query. |
All verified against a real warehouse.
# Default: top 10, bounded previews (tsv). "Where we talked."
stockroom semantic "how does the warehouse locking work"
# Where I talked about it, in one harness:
stockroom semantic --harness claude --role user "flaky dashboard tests"
# Expecting one obvious winner — keep it tight:
stockroom semantic -k 3 "incremental re-embed of new content"
# Structured output, or a user asked for JSON:
stockroom semantic --format json -k 2 "flock sidecar lock"
# Human-readable, terse previews, for a user to eyeball:
stockroom semantic --format table --detail compact -k 3 "REUSE licensing layout"
And the full-text handoff pair (scan semantically, then fetch one whole message with sr-query):
stockroom semantic -k 5 "flock sidecar lock"
# ...pick the winning message_id from the results, then:
stockroom query --format json --detail raw \
"SELECT text FROM messages WHERE message_id = 'fcf35cbe-…#51'"
You are the tool's operator, not its display. Run the search, read the previews, and answer the user in natural language — cite the relevant hit(s), fetch full text only when the answer needs it. Don't paste raw tsv at a human unless they asked to see it. When they do want the raw output — or a command to run themselves — hand them a --format table (to read) or --format json (to process) variant.
To understand why these contracts look the way they do — the torch contract, the embedding pipeline and its staleness model, read-only-by-construction, the truncation doctrine — read the shared system model: ../sr-search/references/system-model.md.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/sr-dashboardOpen the local stockroom dashboard — a read-only, fully offline at-a-glance view of cross-harness agentic-coding history. Reach for this when you (or the user) want the metrics UI URL, not SQL or semantic search./sr-initializeSet up stockroom on this machine — check prerequisites, provision the per-machine torch build, smoke-test the embedding path, put the `stockroom` command on PATH, schedule the nightly ingest+embed, and run the first full ingest. Run this on a new machine, after a "run sr-initialize" error from a sibling skill, or any time the setup seems broken; it re-probes and only does what is still missing./sr-queryRun read-only SQL against your local warehouse of agentic-coding history (sessions, messages, tool calls, embeddings). Reach for this on exact or structured lookups — known ids, WHERE filters, counts, GROUP BY, joins, aggregations — not meaning-based search (that is sr-semantic)./sr-searchSearch your local warehouse of agentic-coding history — the friendly default entrypoint. Reach for this when you are unsure whether the question is an exact/structured lookup (sr-query) or meaning-based recall (sr-semantic), or when it needs both — it routes the question, runs the right surface(s), and synthesizes one answer.stockroom@txrk9-agent-plugins is listed by texarkanine/txrk9-agent-plugins — review the source before installing
npx claudepluginhub texarkanine/txrk9-agent-plugins --plugin stockroom