kb-search

kb-search is a command for Claude Code from eddiebelaval/squire. It costs 0 tokens per session (559 once invoked), scanned A, original, MIT.

A search command for finding existing articles in one or more knowledge bases. A knowledge base is an organised collection of notes and reference material.

In plain words
What is it for?
Use it to search by term, limit results to one knowledge base, or filter results by concepts, sources, or connections.
Why use it?
It helps you quickly find what has already been documented instead of searching files manually or asking a separate tool to compose an answer.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to search by term, limit results to one knowledge base, or filter results by concepts, sources, or connections.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/eddiebelaval/squire/kb-search
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.

Clone the repo
git clone --depth 1 https://github.com/eddiebelaval/squire

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/eddiebelaval/squire/kb-search.svg)](https://agentmods.dev/commands/eddiebelaval/squire/kb-search)
Your own site
<a href="https://agentmods.dev/commands/eddiebelaval/squire/kb-search"><img src="https://agentmods.dev/badge/commands/eddiebelaval/squire/kb-search.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 559 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.00000 $0.00559
Opus 5 $0.00000 $0.00280
Sonnet 5 $0.00000 $0.00112
Haiku 4.5 $0.00000 $0.00056

Measured 5d ago against content hash 657e840ba38d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

kb-search 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 5d 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.

commands/kb-search.md · 75 lines

How it starts

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

You search across id8Labs knowledge bases for articles matching a query. Faster than /kb-query -- this finds what exists, not synthesizes answers.

Arguments: $ARGUMENTS


Route by Arguments

Parse $ARGUMENTS:

Input Action
<term> Search all KBs for articles matching the term
<term> --kb <name> Search a specific KB only
<term> --type <concepts|sources|connections> Filter by article type
(empty) Show KB stats (article counts per KB)

Setup

  1. Read ~/Development/id8/knowledge/manifest.json
  2. For each target KB, read wiki/_index.md

Search Process

Step 1: Load Indexes

For each target KB:

  • Read {kb}/wiki/_index.md
  • Parse all article entries (the [[wikilinks]] and their descriptions)
  • Build a flat list of: {kb_name, article_path, display_name, description, type}

Step 2: Fuzzy Match

Search the flat list against the query term:

  • Match against display name, description, and article type
  • Case-insensitive substring matching
  • Also search frontmatter tags if articles have them (read the first 10 lines of each matching candidate)
  • Rank by relevance: exact title match > title contains > description contains > tag match

Step 3: Deep Search (if few results)

If fewer than 3 matches from index search:

  • Use Grep to search inside wiki/**/*.md for the term
  • Report files that contain the term with a snippet of context
  • This catches content that isn't surfaced in the index descriptions

Step 4: Report

Display results grouped by KB:

## Search: "{term}"

### research (N matches)
- [[concepts/constraint-as-consciousness|Constraint as Consciousness]] -- F-005, write-protection as precondition
- [[registries/findings|Findings Registry]] -- contains 2 mentions

### design (N matches)
- [[concepts/shadow-as-border|Shadow-as-Border]] -- Vercel's 0px 0px 0px 1px pattern
- [[sources/vercel|Vercel]] -- shadow-as-border technique

### memory (N matches)
- (none)

Total: N articles across M knowledge bases

Read the full file on GitHub · 75 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. 5d ago First seen · 75 lines · 0 tokens per session scan A 657e840ba38d

Subscribe to this mod's changes

kb-search is a command published in the GitHub repository eddiebelaval/squire (21 stars, last pushed 23d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 559 tokens. 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.