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.zipInstalls 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 indexKey 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
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
- LEANN uses sentence embeddings to understand meaning
- Searches find conceptually similar code, not just text matches
- Results ranked by semantic similarity score (0-1)
Grep vs LEANN Decision
| Query Type | Tool | Example |
|---|---|---|
| Natural language | LEANN | "how does caching work" |
| Class/function name | Grep | "class CacheManager" |
| Pattern matching | Grep | error|warning |
| Find implementations | LEANN | "rate limiting logic" |
When not to use it
- →Exact literal string matching
- →Regex-based log analysis
- →File path manipulation and pattern finding
Prerequisites
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| leann-search (this skill) | 2 | 7mo | Review | Beginner |
| using-serena-for-exploration | 9 | 8mo | Review | Intermediate |
| cursor-explorer-mcp | 6 | 8mo | No flags | Intermediate |
| react-expert | 8 | 6mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by parcadei
View all by parcadei →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
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.
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.
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?"
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.
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.