mcpbeat

Leann Search

parcadei/leann-search

Semantic search across codebase using LEANN vector index

458 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
3880
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/parcadei/Continuous-Claude-v3 --skill leann-search

The instruction itself

8 sections, as written by the author

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" |

How to use it

Copy the folder

Take parcadei/leann-search from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.