lexical-kb

lexical-kb is a skill for Claude Code, Codex from oaustegard/claude-skills. It costs 95 tokens per session (1,464 once invoked), scanned A, original, MIT.

A bundled knowledge base that finds answers using matching words and an indexed search method rather than an AI embedding model.

In plain words
What is it for?
It is for answering questions from a packaged document collection through lexical search.
Why use it?
It requires search terms to be expanded with synonyms and related words, helping the agent find relevant passages despite different wording.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for answering questions from a packaged document collection through lexical search.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/oaustegard/claude-skills/bundle
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 oaustegard/claude-skills --skill bundle
Clone the repo
git clone --depth 1 https://github.com/oaustegard/claude-skills

Made for: Claude Code, Codex.

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 lexical-kb

README.md
[![agentmods](https://agentmods.dev/badge/skills/oaustegard/claude-skills/bundle/github.svg)](https://agentmods.dev/skills/oaustegard/claude-skills/bundle)
Your own site
<a href="https://agentmods.dev/skills/oaustegard/claude-skills/bundle"><img src="https://agentmods.dev/badge/skills/oaustegard/claude-skills/bundle/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 lexical-kb

Your own site · 80×15
<a href="https://agentmods.dev/skills/oaustegard/claude-skills/bundle"><img src="https://agentmods.dev/badge/skills/oaustegard/claude-skills/bundle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,464 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.
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.00095 $0.01464
Opus 5 $0.00048 $0.00732
Sonnet 5 $0.00019 $0.00293
Haiku 4.5 $0.00010 $0.00146

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

Security

Grade A, and why

lexical-kb 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.

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.

creating-kb/scripts/bundle_SKILL.md · 121 lines

How it starts

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

lexical-kb — query an embedding-free knowledgebase

This KB has no semantic search and no embedding model. Retrieval is pure lexical BM25 over a precomputed inverted index. That design moves one job onto you: bridging the gap between how the user phrases a question and how the corpus phrases the answer. An embedding model would do this with a vector; here you are the semantic layer — you expand the query into terms before searching.

Corpus: {{SOURCE}} ({{CHUNK_COUNT}} chunks).

The retrieval protocol — follow every step

A raw user question fed straight to BM25 underperforms: it matches only the exact words the user happened to use. The expansion step is what makes lexical retrieval competitive with embeddings. Do not skip it.

  1. Read the question. Extract core terms — the essential nouns, proper nouns, and identifiers the answer MUST contain. These carry full weight.

  2. Generate expand terms — synonyms, morphological variants (plural/verb forms), acronym expansions and contractions, and adjacent concepts. These carry lower weight. This is the work the missing embedding model would have done. Be generous: 5–15 expansion terms is normal.

  3. Run the searcher. It ships in this bundle in two equivalent runtimes — node search.js or python3 search.py, identical flags and identical results. Use whichever your environment has. Pass the user's original question via --query AND your term groups — expansion is additive, it never replaces the user's words:

    node search.js \
      --query "how does centered simhash differ from random projection?" \
      --core "simhash" --core "centered" \
      --expand "random projection" --expand "hyperplane" --expand "LSH" \
      --expand "binary quantization" --expand "hamming distance" \
      --k 5
    

    --core/--expand are repeatable; pass phrases, the searcher tokenizes them. The --query terms contribute at a low floor weight so a curated synonym can lift a result but can never drop a doc the literal question would have matched. Defaults: core 1.0, expand 0.4, query-floor 0.25, top-k 5. Keep expansion targeted — terms too generic ("system", "process") leak into unrelated chunks and blur the ranking. A precise word can mislead too if it is polysemous: prefer the disambiguating phrase as one --core term (e.g. --core "centered simhash") over a bare ambiguous word (--core "centered", which also matches "centered around …" in unrelated chunks). The passage extractor is lexical too, so it will highlight the wrong sense rather than correct it.

Read the full file on GitHub · 121 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 First seen · 121 lines · 95 tokens per session scan A da6bbe950665

Subscribe to this mod's changes

lexical-kb is a skill published in the GitHub repository oaustegard/claude-skills (148 stars, last pushed yesterday), licensed MIT. It adds 95 tokens to every session and 1,464 once invoked, about $0.0005 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-09-03.

Related

Other skills, from other repositories

superdesign

Design or redesign frontend UI, presentations, and graphics on the Superdesign canvas with a choice of leading AI models. Use whenever the user wants to design a page, feature, flow, slide deck, or brand-new product; improve or reproduce existing UI; compare design results across top models; explore visual variants…

superdesigndev/superdesign-skill · 115 tokens

Linear

Managing Linear issues, projects, and teams. Use when working with Linear tasks, creating issues, updating status, querying projects, or managing team workflows.

wrsmith108/linear-claude-skill · 32 tokens

chanlun-engine-skill

A Chinese-language stock-analysis skill based on Chan theory, a method for interpreting price-chart structures such as turning points and trading ranges.

adsorgcn/chanlun-engine-skill · 128 tokens

youtube-summary

Summarize a YouTube video into structured notes — TL;DR, key takeaways, chapter-by-chapter breakdown, and reference links. Use when the user shares a YouTube URL (or invokes /youtube-summary ) and wants a summary, takeaways, transcript notes, or a write-up of a talk, lecture, or tutorial. Fetches the transcript and…

ParthGanatra/agent-skills · 137 tokens

plangate

Use for any non-trivial task with 2+ open decisions/tradeoffs OR multiple implementation steps — instead of deliberating one question at a time in chat, write a structured plan to a file and let the user review it inline in vim with > Q: / > A: blockquote markers, then revise until agreed before touching any code.…

ParthGanatra/agent-skills · 131 tokens

coinmarketcap

Expert assistant for CoinMarketCap Pro API — price quotes, listings, historical OHLCV, market metrics, Fear & Greed Index, CMC100/CMC20 indices, exchange data, DEX data, airdrops, trending, community sentiment. Covers 10+ endpoint categories across REST + MCP + x402 pay-per-call modes. Use when the user wants: current…

Vo1ganin/crypto-claude-skills · 183 tokens