agentleFS
BostonOrangeBostonOrange/claude-code-framework/skills/search/SKILL.md

search

Skill2 starsChanged 6 months agoMITView on GitHub

Semantic search across the indexed codebase. Returns top-K matching chunks with file:line + similarity score. Requires `/index` to have been run first. Useful for "where do we handle X?" questions that grep can't answer because there's no exact-string match

33 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use fetch, browser and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • vibesurf-aiSkill

    fetch

    Use when user asks to fetch URL content, read documentation from a URL, get webpage content as markdown, or extract structured content from any web page URL.

    Also in 5 projects that use this

  • vibesurf-aiSkill

    browser

    Use when user needs direct browser control like navigating to URLs, clicking elements, typing text, scrolling, switching tabs, taking screenshots, or inspecting page state.

    Also in 3 projects that use this

  • ffsshhttiikkSkill

    i18n

    Internationalization and localization

    Also in 3 projects that use this

  • raven-souravSkill

    ingest

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When you need to find code by *meaning* rather than exact text — "where do we generate invoice numbers?", "what handles rate limiting?", …

    line 8
  2. Very specific:

    If no index, halt with: "Run /index first to build the codebase index.

    line 39
  3. Distinctive:

    After showing results, suggest next steps based on the query type:

    line 65

“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Search — Semantic Codebase Query

When you need to find code by meaning rather than exact text — "where do we generate invoice numbers?", "what handles rate limiting?", "is there existing logic for tax calculation?" — /search queries the vector index built by /index and returns the most semantically relevant chunks.

/search complements /impact and Grep:

  • Grep for exact strings ("find all uses of requireAuth")
  • /impact for precise call-site cascades on a known target
  • /search for semantic neighborhood ("find code about authentication" without knowing the function names)

Usage

/search "<natural language query>"
/search "<query>" --top-k=20            return top 20 (default 10)
/search "<query>" --include=apex        filter by extension/type

Examples:

/search "where do we generate unique invoice numbers"
/search "rate limit logic for API endpoints"
/search "session timeout handling" --top-k=5
/search "after-insert trigger handler" --include=apex

Process

Phase 1: Verify index exists

bash .claude/hooks/codebase-index.sh stats

If no index, halt with: "Run /index first to build the codebase index. See /index skill for setup."

Phase 2: Run the search

bash .claude/hooks/codebase-index.sh search "<query>" [--top-k=N]

The script:

  1. Embeds the query via the configured provider (must match what /index used)
  2. Computes cosine similarity against every chunk in the DB
  3. Returns top-K results: <score>\t<file>:<line_start>-<line_end>\t<snippet>

Phase 3: Render results

Show the user a ranked table:

| # | Score | File:Lines | Snippet |
|---|-------|------------|---------|
| 1 | 0.847 | lib/billing/invoice.ts:23-62 | "function generateInvoiceNumber(account: Account)..." |
| 2 | 0.792 | lib/billing/sequence.ts:8-40 | "// Atomic counter for invoice numbers..." |

Phase 4: Hand-off

After showing results, suggest next steps based on the query type:

  • Exploration ("where do we handle X?"): "Top hit is <file>:<line>. Read that to confirm it's the right entry point."
  • Duplicate check ("is there existing logic for Y?"): "Found N similar chunks. Highest scoring is <file>:<line> — review before adding new logic."
  • Pre-change context ("rate limit code"): "These chunks are the rate-limiting surface. Run /impact <file>:<symbol> on each before modifying."

State Files

/search is stateless — reads .claude/state/codebase.db (built by /index) and writes nothing.

When to Use What

Query typeTool
Exact string ("requireAuth")Grep
Symbol cascade ("what calls requireAuth?")/impact
Semantic neighborhood ("auth-related code")/search
Architectural question ("how is auth structured?")Read .claude/state/architecture.md

Tradeoffs vs Grep

/search returns semantically similar code, not exact matches. Implications:

  • Recall is wider: finds code with synonyms, related concepts, similar shape.
  • Precision is lower than grep: top-1 may be a near-miss. Always read the snippet.
  • Confidence is approximate: similarity score is a heuristic. 0.8+ is usually relevant; <0.5 is often noise.
  • Dependent on index freshness: stale index returns stale results. /index runs incrementally on subsequent calls; commit hooks (Phase 2.5) auto-refresh.

Edge Cases

ScenarioBehavior
No indexHalt; tell user to run /index
Provider mismatch (index built with voyage, search with openai)Halt; tell user to either re-index with current provider OR switch back
Empty results"No relevant matches above threshold" — suggest broader query or /index --full if index is suspected stale
Top scores all <0.5Warn user that results may not be relevant; suggest grep instead
Very specific query (exact symbol name)Suggest Grep instead — it'll be faster and more precise
Salesforce-specific queryUse --include=apex to filter to Apex chunks only; reduces noise from LWC/HTML

Related

  • /index — must run first to build the index
  • /impact — for precise per-symbol analysis (grep-based, no vector index needed)
  • .claude/state/architecture.md — broad architectural map
  • templates/hooks/codebase-index.sh — the bash engine

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.