leann-search
Semantic search across codebase using LEANN vector index
适合你,如果经常需要在大型代码库中查找特定逻辑或模式
/ 下载安装
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code
~/.claude/skills/(项目级 .claude/skills/)Codex CLI
~/.codex/skills/Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add parcadei/continuous-claude-v3/leann-search/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- parcadei/continuous-claude-v3/leann-search/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify parcadei/continuous-claude-v3/leann-search安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
3859GitHub stars
~387上下文体积 · 单文件
镜像托管
怎么用
商店整理自技能原文 · 版本 d07ff4b · 表述以原文为准它做什么
安装后,Claude 能根据语义搜索代码库,找到概念相似但关键词不同的代码片段,并返回排名结果。
什么时候触发
当你想理解代码概念(如“认证如何工作”)或寻找相关实现(如“流式处理”)时触发。
装好后可以这样说
返回语义匹配的代码片段
返回概念相似的代码
返回相关实现
技能原文 SKILL.md
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" |
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…