search-hierarchy by parcadei/continuous-claude-v3
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill search-hierarchy根据查询类型使用最节省令牌的搜索工具。
Query Type?
├── 结构型 (代码模式)
│ → AST-grep (~50 个令牌输出)
│ 示例: "def foo", "class Bar", "import X", "@decorator"
│
├── 语义型 (概念性问题)
│ → LEANN (~100 个令牌,如果仅路径)
│ 示例: "身份验证如何工作", "查找错误处理模式"
│
├── 字面型 (精确标识符)
│ → Grep (输出变量)
│ 示例: "TemporalMemory", "check_evocation", 正则表达式模式
│
└── 完整上下文型 (需要完全理解)
→ Read (1500+ 个令牌)
在找到正确文件后的最后手段
| 工具 | 输出大小 | 最适合 |
|---|---|---|
| AST-grep | ~50 个令牌 | 函数/类定义、导入、装饰器 |
| LEANN | ~100 个令牌 | 概念性问题、架构、模式 |
| Grep | ~200-2000 | 精确标识符、正则表达式、文件路径 |
| Read | ~1500+ | 找到文件后的完全理解 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
grep-to-leann.sh 钩子自动执行以下操作:
# 结构型 → AST-grep
ast-grep --pattern "async def $FUNC($$$):" --lang python
# 语义型 → LEANN
leann search opc-dev "身份验证如何工作" --top-k 3
# 字面型 → Grep
Grep pattern="check_evocation" path=opc/scripts
# 完整上下文型 → Read (找到文件后)
Read file_path=opc/scripts/z3_erotetic.py
1. AST-grep: "查找异步函数" → 3 个 文件:行号 匹配
2. Read: 仅读取最佳匹配 → 完全理解
3. 跳过: 4 个不相关文件 → 节省 6000 个令牌
每周安装量
193
代码仓库
GitHub 星标数
3.6K
首次出现时间
2026年1月22日
安全审计
安装于
opencode187
codex184
gemini-cli183
cursor182
github-copilot180
amp177
Use the most token-efficient search tool for each query type.
Query Type?
├── STRUCTURAL (code patterns)
│ → AST-grep (~50 tokens output)
│ Examples: "def foo", "class Bar", "import X", "@decorator"
│
├── SEMANTIC (conceptual questions)
│ → LEANN (~100 tokens if path-only)
│ Examples: "how does auth work", "find error handling patterns"
│
├── LITERAL (exact identifiers)
│ → Grep (variable output)
│ Examples: "TemporalMemory", "check_evocation", regex patterns
│
└── FULL CONTEXT (need complete understanding)
→ Read (1500+ tokens)
Last resort after finding the right file
| Tool | Output Size | Best For |
|---|---|---|
| AST-grep | ~50 tokens | Function/class definitions, imports, decorators |
| LEANN | ~100 tokens | Conceptual questions, architecture, patterns |
| Grep | ~200-2000 | Exact identifiers, regex, file paths |
| Read | ~1500+ | Full understanding after finding the file |
The grep-to-leann.sh hook automatically:
# STRUCTURAL → AST-grep
ast-grep --pattern "async def $FUNC($$$):" --lang python
# SEMANTIC → LEANN
leann search opc-dev "how does authentication work" --top-k 3
# LITERAL → Grep
Grep pattern="check_evocation" path=opc/scripts
# FULL CONTEXT → Read (after finding file)
Read file_path=opc/scripts/z3_erotetic.py
1. AST-grep: "Find async functions" → 3 file:line matches
2. Read: Top match only → Full understanding
3. Skip: 4 irrelevant files → 6000 tokens saved
Weekly Installs
193
Repository
GitHub Stars
3.6K
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode187
codex184
gemini-cli183
cursor182
github-copilot180
amp177
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
150,000 周安装