Skip to main content
skill CX Codex

leann-search — Claude Code skill: what it does, how to install

leann-search runs semantic code queries against a LEANN vector index when exact keyword matches fall short.

MIT ★ 3,951 updated 2026-01-26

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add parcadei/Continuous-Claude-v3 --skill leann-search -a claude-code
Open on GitHub

What leann-search does

The skill adds meaning-based repository search to Claude Code. It interacts with the leann CLI via Bash or triggers the leann_search MCP tool, querying an index built with sentence-transformers and all-MiniLM-L6-v2. Search hits are scored by semantic similarity from 0 to 1.

It handles conceptual tasks such as locating authentication flows or streaming implementations across varied terminology. Exact identifiers and regex patterns stay reserved for grep and glob.

Searches fail if the project index has not been generated beforehand with leann build. Whenever code evolves heavily, rebuilding the vector index is necessary.

What it helps with

  • locate subsystem logic without knowing exact function or variable names
  • trace architectural concepts like error handling or streaming across files
  • retrieve semantically related implementations using natural language
  • check registered project indices with leann list

Example prompts for the agent

  • Search the rigg index using leann for how providers handle streaming
  • Run a semantic search for rate limiting logic in the project
  • List available leann vector indexes

How to install leann-search

1Skills CLI (Vercel)

npx skills add parcadei/Continuous-Claude-v3 --skill leann-search -a claude-code

2Manually: put the files in place

~/.claude/skills/leann-search/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/leann-search/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about leann-search

How to install leann-search in Claude Code?

Run npx skills add parcadei/Continuous-Claude-v3 --skill leann-search -a claude-code. Alternatively, copy the file to ~/.claude/skills/leann-search/SKILL.md.

What does leann-search do?

It performs vector-based codebase lookups through LEANN to identify relevant code by conceptual meaning rather than exact text strings.

When should Grep be used instead of LEANN?

Use Grep for exact class names, specific identifiers, and regex patterns. LEANN handles broader natural language questions such as how caching works.

Source text

SKILL.md · MIT
---
name: leann-search
description: Semantic search across codebase using LEANN vector index
allowed-tools: [Bash, Read]
---

# 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

```bash
# 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:

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

© parcadei · MIT · parcadei/Continuous-Claude-v3

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set161

The whole set →
propositional-logic Guides solving propositional logic problems using truth tables, Z3 proofs, and semantic tableaux. CX Codex +1 1installs predicate-logic A skill for tackling predicate logic in mathematical logic. Handles quantifier analysis, normal form conversion, proof construction, and countermodel search. CX Codex +1 1installs prime-numbers Skill for working with prime numbers in graph and number theory. Offers strategies for primality testing (trial division, Miller-Rabin, AKS), factorization, and applications of Fermat's and Wilson's theorems through Bash and Read tools. CX Codex +1 1installs matrices matrices — a skill for matrix operations: identifies types, performs arithmetic, solves linear systems. Includes decompositions like LU, QR, SVD and works across Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode. CX Codex +1 1installs natural-transformations This skill guides category-theory work on natural transformations, with Lean 4 notation for checking naturality and applying related constructions. CX Codex +1 ★ 3,951repo stars categories-functors categories-functors — a skill for solving category and functor problems in category theory. Validates axioms, checks functor properties, and verifies proofs in Lean 4 via compiler. CX Codex +1 ★ 3,951repo stars limits-colimits limits-colimits is a Claude Code skill that provides decision workflows for category theory limits and colimits, including Lean 4 proof formalization and SymPy calculations. CX Codex +1 ★ 3,951repo stars llm-tuning-patterns The llm-tuning-patterns skill recommends LLM settings for theorem proving, code generation, and creative work. Use it to choose token limits and temperature for a specific task. CX Codex +1 ★ 3,951repo stars

Project sponsors

Companies that keep this analytics open