Loading...
Loading...
Compare original and translation side by side
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 fileQuery 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 |
| 工具 | 输出大小 | 适用场景 |
|---|---|---|
| AST-grep | ~50 tokens | 函数/类定义、导入语句、装饰器 |
| LEANN | ~100 tokens | 概念性问题、架构、模式 |
| Grep | ~200-2000 | 精确标识符、正则表达式、文件路径 |
| Read | ~1500+ | 找到目标文件后全面理解内容 |
grep-to-leann.shgrep-to-leann.shundefinedundefinedundefinedundefined1. AST-grep: "Find async functions" → 3 file:line matches
2. Read: Top match only → Full understanding
3. Skip: 4 irrelevant files → 6000 tokens saved1. AST-grep: "Find async functions" → 3个file:line匹配结果
2. Read: 仅读取排名靠前的匹配文件 → 全面理解内容
3. 跳过: 4个无关文件 → 节省6000+ Tokens