skill-retrieval

skill-retrieval is a skill for Claude Code from moonlight-lupin/agent-skills. It costs 81 tokens per session (1,749 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 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 1,749 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.01749
Opus 5 $0.00041 $0.00874
Sonnet 5 $0.00016 $0.00350
Haiku 4.5 $0.00008 $0.00175

Measured 2d ago against content hash 546368feb9b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 2d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (__init__.py, scripts/bm25_retriever.py, tests/conftest.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 · 176 lines

How it starts

The opening of the file, as written. The whole thing — 176 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. Developed against Hermes Agent >=0.20.0.

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 (session start): Monkey-patches build_skills_system_prompt so the <available_skills> block lists skill names only (descriptions stripped). All skills remain discoverable by name (~2K tokens instead of ~11.5K).

  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 above the user message.

Architecture

Session start
    │
    ▼
Phase 1: patch build_skills_system_prompt
    └── <available_skills> → names only (~2K tokens)

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 once at plugin load from standalone skills (~/.hermes/skills) and plugin-bundled skills (~/.hermes/plugins/*/skills). Retrieval uses a pure-stdlib inverted index (term → posting list of precomputed BM25 weights) and is sub-millisecond for ~200 skills.

Token savings

Stage Tokens (approx.)
Before (full skill list in system prompt) ~11.5K
After — names-only system prompt ~2.0K
After — per-turn top-K descriptions ~0.3K
Net per turn ~2.3K (~9K saved)

Measured on a Hermes install with ~300 skills; savings scale with skill count.

Read the full file on GitHub · 176 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. 2d ago Changed 546368feb9b4
  2. 10d 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 (60 stars, last pushed 3d ago), licensed MIT. It adds 81 tokens to every session and 1,749 once invoked, about $0.0004 per session on Opus 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.