Skip to content
Development
Command

/search-code

Hybrid code search — semantic + keyword + BM25

From plugin
beacon
438 skills1 agent8 commands4 hooks
Install
> /plugin marketplace add sagarmk/beacon-plugin
> /plugin install beacon@claude-code-beacon-plugin

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/search-code

Context preview

What this command does when you run it.

Hybrid code search — semantic + keyword + BM25

Command definition

search-code.md
description: "Hybrid code search — semantic + keyword + BM25"
argument-hint: <query> [query2] [--top-k N] [--threshold F]
allowed-tools: [Bash, Read, Glob]

/search-code

Search the codebase using Beacon hybrid search (semantic embeddings + BM25 keyword matching + identifier boosting).

Single query

1. Run `node ${CLAUDE_PLUGIN_ROOT}/scripts/search.js "$ARGUMENTS"` 2. Parse the JSON results — each match has `file`, `lines`, `similarity`, `score`, and `preview` 3. Review the `preview` field first — it often contains enough context to answer the query 4. Only read the actual source files if the preview is insufficient to answer the question 5. Summarize findings and cite file:line references

Multi-query batch

Pass multiple quoted queries for a single HTTP round-trip:

node ${CLAUDE_PLUGIN_ROOT}/scripts/search.js "auth flow" "session handling"

Returns `[{query, matches}, ...]` grouped by query.

Options

  • `--top-k N` — number of results (default: 10)
  • `--threshold F` — minimum score cutoff (default: 0.35)
  • `--path <prefix>` — scope results to files under a directory (e.g. `--path src/middleware/`)
  • `--no-hybrid` — disable hybrid scoring, use pure vector search

Result fields

  • `file` — file path
  • `lines` — matched line range (e.g. "45-78")
  • `similarity` — vector cosine similarity
  • `score` — final hybrid score (semantic + BM25 + identifier boost)
  • `preview` — first 300 chars of matched code chunk
Read more
Ships withbeacon

Semantic code search plugin for Claude Code using hybrid vector search + BM25. 98% accuracy, 5x faster than grep.

Get the whole plugin
Stats
44
Stars
5
Forks
Active
Maintenance
JavaScript
Language
MIT
License
6d ago
Last commit
6mo ago
Created

Repo: sagarmk/beacon-plugin

Other commands on beacon.