LE

leann-search

Uses LEANN vector embeddings to perform meaning-based code search across your codebase.

Install

mkdir -p .claude/skills/leann-search && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2673" && unzip -o skill.zip -d .claude/skills/leann-search && rm skill.zip

Installs to .claude/skills/leann-search

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Semantic search across codebase using LEANN vector index
56 charsno explicit “when” trigger
Beginner

Key capabilities

  • Perform vector search on codebase tokens
  • Match code by conceptual intent
  • Execute semantic ranking of search results
  • Identify architectural pattern implementations
  • Rebuild embedding index from source code

How it works

Utilizes pre-computed sentence embeddings to map natural language queries to vector-space representations of codebase snippets.

Inputs & outputs

You give it
Natural language query about code functionality
You get back
Ranked list of relevant code snippets

When to use leann-search

  • Searching for architectural patterns
  • Finding implementation examples by concept
  • Querying codebase by natural language

About this skill

LEANN Semantic Search

Use LEANN for meaning-based code search instead of grep.

When to Use

  • Conceptual queries: "how does authentication work", "where are errors handled"
  • Understanding patterns: "streaming implementation", "provider architecture"
  • Finding related code: code that's semantically similar but uses different terms

When NOT to Use

  • Exact matches: Use Grep for class Foo, def bar, specific identifiers
  • Regex patterns: Use Grep for error.*handling, import.*from
  • File paths: Use Glob for *.test.ts, src/**/*.py

Commands

# Search the current project's index
leann search <index-name> "<query>" --top-k 5

# List available indexes
leann list

# Example
leann search rigg "how do providers handle streaming" --top-k 5

MCP Tool (in Claude Code)

leann_search(index_name="rigg", query="your semantic query", top_k=5)

Rebuilding the Index

When codebase changes significantly:

cd /path/to/project
leann build <project-name> --docs src tests scripts \
  --file-types '.ts,.py,.md,.json' \
  --no-recompute --no-compact \
  --embedding-mode sentence-transformers \
  --embedding-model all-MiniLM-L6-v2

How It Works

  1. LEANN uses sentence embeddings to understand meaning
  2. Searches find conceptually similar code, not just text matches
  3. Results ranked by semantic similarity score (0-1)

Grep vs LEANN Decision

Query TypeToolExample
Natural languageLEANN"how does caching work"
Class/function nameGrep"class CacheManager"
Pattern matchingGreperror|warning
Find implementationsLEANN"rate limiting logic"

When not to use it

  • Exact literal string matching
  • Regex-based log analysis
  • File path manipulation and pattern finding

Prerequisites

LEANN vector index configured

Limitations

  • Semantic search misses exact identifiers
  • Requires index updates after major changes
  • Computationally intensive to rebuild index

How it compares

It ignores variable naming and exact syntax in favor of retrieving code that solves the same logical problem.

Compared to similar skills

leann-search side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
leann-search (this skill)27moReviewBeginner
using-serena-for-exploration98moReviewIntermediate
cursor-explorer-mcp68moNo flagsIntermediate
react-expert86moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

using-serena-for-exploration

seanGSISG

Use when exploring codebases with Serena MCP tools for architectural understanding and pattern discovery - guides efficient symbolic exploration workflow minimizing token usage through targeted symbol reads, overview tools, and progressive narrowing

9127

cursor-explorer-mcp

sepiabrown

Use for token-expensive operations requiring multi-file analysis - codebase exploration, broad searches, architecture understanding, tracing flows, finding implementations across files. Uses MCP cursor-agent server (company pays) with clean async interface. Do NOT use for single-file analysis, explaining code already in immediate context, or pure reasoning tasks.

699

react-expert

reactjs

Use when researching React APIs or concepts for documentation. Use when you need authoritative usage examples, caveats, warnings, or errors for a React feature.

823

analyzing-projects

CloudAI-X

Analyzes codebases to understand structure, tech stack, patterns, and conventions. Use when onboarding to a new project, exploring unfamiliar code, or when asked "how does this work?" or "what's the architecture?"

327

cartographer

kingbootoshi

Maps and documents codebases of any size by orchestrating parallel subagents. Creates docs/CODEBASE_MAP.md with architecture, file purposes, dependencies, and navigation guides. Updates CLAUDE.md with a summary. Use when user says "map this codebase", "cartographer", "/cartographer", "create codebase map", "document the architecture", "understand this codebase", or when onboarding to a new project. Automatically detects if map exists and updates only changed sections.

37

consult-zai

centminmod

Compare z.ai GLM 4.7 and code-searcher responses for comprehensive dual-AI code analysis. Use when you need multiple AI perspectives on code questions.

15

Search skills

Search the agent skills registry