skill-retrieval

skill-retrieval is a skill for Claude Code from moonlight-lupin/agent-skills. It costs 81 tokens per session (2,882 once invoked), scanned A, original, MIT.

A skill-selection plugin for Hermes Agent, an AI agent framework. It keeps a short list of skill names and retrieves relevant skill descriptions for each user request using BM25, a text-matching method.

In plain words
What is it for?
Use it to make Hermes Agent sessions use less prompt space and to select relevant skills automatically. It does not work in Claude Code.
Why use it?
It reduces the amount of skill information placed in each prompt while still providing descriptions related to the current request.

Skill for Claude Code

Written for Claude Code: UserPromptSubmit hook event. Also seen: mentions .claude-plugin; mentions Claude Code.

Good fit Use it to make Hermes Agent sessions use less prompt space and to select relevant skills automatically. It does not work in Claude Code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/moonlight-lupin/agent-skills/skill-retrieval
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add moonlight-lupin/agent-skills --skill skill-retrieval
Clone the repo
git clone --depth 1 https://github.com/moonlight-lupin/agent-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for skill-retrieval

README.md
[![agentmods](https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/skill-retrieval/github.svg)](https://agentmods.dev/skills/moonlight-lupin/agent-skills/skill-retrieval)
Your own site
<a href="https://agentmods.dev/skills/moonlight-lupin/agent-skills/skill-retrieval"><img src="https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/skill-retrieval/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for skill-retrieval

Your own site · 80×15
<a href="https://agentmods.dev/skills/moonlight-lupin/agent-skills/skill-retrieval"><img src="https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/skill-retrieval.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,882 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.02882
Opus 5.5 $0.00032 $0.01153
Sonnet 5.5 $0.00016 $0.00576
Haiku 4.5 $0.00008 $0.00288

Measured 8d ago against content hash fed0b466aa74, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

skill-retrieval scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 25 executable files (__init__.py, scripts/__init__.py, scripts/bm25_retriever.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/skill-retrieval/SKILL.md · 248 lines

How it starts

The opening of the file, as written. The whole thing — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill Retrieval

This is a Hermes Agent plugin. It is not a Claude Code plugin and will not load in Claude Code — that runtime has no pre_llm_call event, no Python register() entry point, and reads .claude-plugin/plugin.json rather than plugin.yaml. Requires Hermes Agent >=0.21.1 (requires_hermes in plugin.yaml).

BM25-based progressive disclosure for Hermes Agent skills. Instead of dumping every skill description into the system prompt (~11.5K tokens), this plugin keeps a compact names-only index and injects only the top-K relevant descriptions per turn.

What it does

Two-phase progressive disclosure:

  1. Phase 1 — System prompt compaction (an llm_request middleware): Rewrites the outgoing request's <available_skills> block so it lists skill names only (descriptions stripped). All skills remain discoverable by name (~2K tokens instead of ~11.5K). The system prompt Hermes builds is never modified — prompt caching is unaffected.

  2. Phase 2 — Per-turn BM25 retrieval (pre_llm_call hook): Tokenizes the user message, ranks active skill descriptions with BM25 Okapi, and injects the top-K matches (~300 tokens) as context appended after the user message.

Architecture

Each turn (llm_request middleware)
    │
    ▼
Phase 1: rewrite <available_skills> → names only (~2K tokens, request only)

Each turn (pre_llm_call)
    │
    ▼
Phase 2: BM25Index.retrieve(user_message, top_k)
    └── inject "## Retrieved Skills ..." into user message (~300 tokens)

The BM25 index is built lazily on the first turn from standalone skills (~/.hermes/skills) and plugin-bundled skills (~/.hermes/plugins/*/skills), then cached per Hermes home, tool capability snapshot, session platform and resolved disabled-skill set (the same inputs Hermes keys its own skills prompt cache on). The cache is rebuilt without a restart when Hermes clears its skills prompt cache (skill_manage create/patch/delete, hub install, skill toggles) or when a cheap on-disk manifest changes (skill root and category dir mtimes, top-level SKILL.md files, config.yaml). Retrieval uses a pure-stdlib inverted index (term → posting list of precomputed BM25 weights) and is sub-millisecond for ~200 skills.

Read the full file on GitHub · 248 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago Changed · +13 lines fed0b466aa74
  2. 12d ago Changed efc06a840f8a
  3. 22d ago Changed · +12 lines 5a46a8c0355c
  4. 23d ago Changed · +20 lines f40f880186ca
  5. 29d ago Changed · +25 lines ad10bbfa3875
  6. 1mo ago Changed · +2 lines 0b8b57a1c3f3
  7. 1mo ago Changed 546368feb9b4
  8. 1mo ago First seen · 176 lines · 81 tokens per session scan A 6d6fd9dafedd

Subscribe to this mod's changes

skill-retrieval is a skill published in the GitHub repository moonlight-lupin/agent-skills (112 stars, last pushed 4d ago), licensed MIT. It adds 81 tokens to every session and 2,882 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.