Search Router

parcadei/continuous-claude-v3/.claude/skills/search-router

作者 parcadeid07ff4b06b62無授權條款3.9K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫8 個月前更新

Choose the right search tool for each query type

AI 產生的概覽

將程式碼搜尋查詢導向最省 token 的工具,例如 TLDR、AST-grep、Grep 或 Read。

功能
此技能提供一棵決策樹,依查詢類型選擇搜尋工具,涵蓋程式碼探索、結構化 AST 模式、語意問題、字面文字與完整脈絡閱讀。它包含 token 效率比較表以及各工具的範例指令。它只產出指引建議,不產出搜尋結果或檔案。
適用情境
適用於搜尋程式碼模式、找出某功能的實作位置、尋找特定識別字,或理解程式碼如何運作的情境。當 token 成本重要時,它協助在多個工具之間做選擇。
執行需求
不含指令碼,僅為說明性指示。其指引引用了外部工具與指令,例如 tldr search、tldr semantic search、AST-grep、Grep 與 Read,這些需另行具備。

Search Tool Router

Use the most token-efficient search tool for each query type.

When to Use

  • Searching for code patterns
  • Finding where something is implemented
  • Looking for specific identifiers
  • Understanding how code works

Decision Tree

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

Token Efficiency Comparison

ToolOutput SizeBest For
TLDR~50-500DEFAULT: Code symbols, call graphs, data flow
TLDR Semantic~100-300Conceptual queries (P6, embedding-based)
AST-grep~50 tokensFunction/class definitions, imports, decorators
Grep~200-2000LAST RESORT: Non-code text, regex
Read~1500+Full understanding after finding the file

Examples

bash
# CODE EXPLORATION → TLDR (DEFAULT)tldr search "spawn_agent" .tldr search "redis" . --layer call_graph
# STRUCTURAL → AST-grep/ast-grep-find "async def $FUNC($$$):" --lang python
# SEMANTIC → TLDR Semantictldr semantic search "how does authentication work"
# LITERAL → Grep (LAST RESORT - prefer TLDR)Grep pattern="check_evocation" path=opc/scripts
# FULL CONTEXT → Read (after finding file)Read file_path=opc/scripts/z3_erotetic.py

Optimal Flow

1. AST-grep: "Find async functions" → 3 file:line matches2. Read: Top match only → Full understanding3. Skip: 4 irrelevant files → 6000 tokens saved

Related Skills

  • /tldr-search - DEFAULT - Code exploration with 95% token savings
  • /ast-grep-find - Structural code search
  • /morph-search - Fast text search

來源與署名

來源:parcadei/continuous-claude-v3位於.claude/skills/search-router提交d07ff4b

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架