Loading...
Loading...
Compare original and translation side by side
Query Type?
├── CODE EXPLORATION (symbols, call chains, data flow)
│ → TLDR Search - 95% token savings
│ DEFAULT FOR ALL CODE SEARCH - use instead of Grep
│ Examples: "spawn_agent", "DataPoller", "redis usage"
│ Command: tldr search "query" .
│
├── STRUCTURAL (AST patterns)
│ → AST-grep (/ast-grep-find) - ~50 tokens output
│ Examples: "def foo", "class Bar", "import X", "@decorator"
│
├── SEMANTIC (conceptual questions)
│ → TLDR Semantic - 5-layer embeddings (P6)
│ Examples: "how does auth work", "find error handling patterns"
│ Command: tldr semantic search "query"
│
├── LITERAL (exact text, regex)
│ → Grep tool - LAST RESORT
│ Only when TLDR/AST-grep don't apply
│ Examples: error messages, config values, non-code text
│
└── FULL CONTEXT (need complete understanding)
→ Read tool - 1500+ tokens
Last resort after finding the right file查询类型?
├── 代码探索(符号、调用链、数据流)
│ → TLDR Search - 节省95% Token
│ 所有代码搜索的默认工具 - 替代Grep使用
│ 示例:"spawn_agent"、"DataPoller"、"redis usage"
│ 命令:tldr search "query" .
│
├── 结构型(AST模式)
│ → AST-grep (/ast-grep-find) - 约50个Token输出
│ 示例:"def foo"、"class Bar"、"import X"、"@decorator"
│
├── 语义型(概念性问题)
│ → TLDR Semantic - 5层嵌入(P6)
│ 示例:"how does auth work"、"find error handling patterns"
│ 命令:tldr semantic search "query"
│
├── 字面量(精确文本、正则表达式)
│ → Grep工具 - 最后选择
│ 仅当TLDR/AST-grep不适用时使用
│ 示例:错误信息、配置值、非代码文本
│
└── 完整上下文(需要全面理解)
→ Read工具 - 1500+ Token
找到目标文件后的最后选择| Tool | Output Size | Best For |
|---|---|---|
| TLDR | ~50-500 | DEFAULT: Code symbols, call graphs, data flow |
| TLDR Semantic | ~100-300 | Conceptual queries (P6, embedding-based) |
| AST-grep | ~50 tokens | Function/class definitions, imports, decorators |
| Grep | ~200-2000 | LAST RESORT: Non-code text, regex |
| Read | ~1500+ | Full understanding after finding the file |
| 工具 | 输出大小 | 最佳适用场景 |
|---|---|---|
| TLDR | ~50-500 | 默认:代码符号、调用图、数据流 |
| TLDR Semantic | ~100-300 | 概念性查询(基于P6嵌入) |
| AST-grep | ~50 tokens | 函数/类定义、导入语句、装饰器 |
| Grep | ~200-2000 | 最后选择:非代码文本、正则表达式 |
| Read | ~1500+ | 找到文件后全面理解内容 |
undefinedundefinedundefinedundefined1. 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:"查找异步函数" → 3个文件:行匹配结果
2. Read:仅查看顶部匹配结果 → 全面理解内容
3. 跳过:4个无关文件 → 节省6000个Token/tldr-search/ast-grep-find/morph-search/tldr-search/ast-grep-find/morph-search