SE

Decision tree for choosing the most efficient search tool for codebase investigation based on intent.

Install

mkdir -p .claude/skills/search-tools && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1577" && unzip -o skill.zip -d .claude/skills/search-tools && rm skill.zip

Installs to .claude/skills/search-tools

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Search Tool Hierarchy
21 charsno explicit “when” trigger
Beginner

Key capabilities

  • Perform embedding-based semantic search for conceptual queries
  • Find structural code patterns using AST-grep
  • Execute fast text searches across a codebase with Morph
  • Conduct literal pattern matching with the built-in Grep tool
  • Identify function calls and class usages for refactoring
  • Search for specific text mentions in files

How it works

The skill directs queries to specific search tools based on the type of search needed: LEANN for conceptual, AST-grep for structural, Morph for fast text, and Grep for literal patterns.

Inputs & outputs

You give it
A search query and optionally a target codebase or index
You get back
Search results from the selected tool (LEANN, AST-grep, Morph, or Grep)

When to use search-tools

  • Searching for conceptual patterns
  • Finding structural code usage
  • Performing codebase-wide text search
  • Selecting search method for refactoring

About this skill

Search Tool Hierarchy

When searching code, use this decision tree:

Decision Tree

Need CONCEPTUAL/SEMANTIC search?
  (how does X work, find patterns, understand architecture)
  → Use LEANN (/leann-search) - embedding-based semantic search
  → PreToolUse hook auto-redirects semantic Grep queries

Need to understand code STRUCTURE?
  (find function calls, class usages, refactor patterns)
  → Use AST-grep (/ast-grep-find)

Need to find TEXT in code?
  → Use Morph (/morph-search) - 20x faster
  → If no Morph API key: fall back to Grep tool

Simple one-off search?
  → Use built-in Grep tool directly

Tool Comparison

ToolBest ForRequires
LEANNSemantic search: "how does caching work", "error handling patterns", conceptual queriesIndex built
AST-grepStructural patterns: "find all calls to foo()", refactoring, find usages by typeMCP server
MorphFast text search: "find files mentioning error", grep across codebaseAPI key
GrepLiteral patterns, class/function names, regexNothing (built-in)

Examples

LEANN (semantic/conceptual):

  • "how does authentication work"
  • "find error handling patterns"
  • "where is rate limiting implemented"

AST-grep (structural):

  • "Find all functions that return a Promise"
  • "Find all React components using useState"
  • "Refactor all imports of X to Y"

Morph (text search):

  • "Find all files mentioning 'authentication'"
  • "Search for TODO comments"

Grep (literal):

  • class ProviderAdapter
  • def __init__
  • Regex patterns

LEANN Commands

# Search with semantic query
leann search opc-dev "how does blackboard communication work" --top-k 5

# List available indexes
leann list

# Rebuild index (when code changes)
leann build opc-dev --docs dir1 dir2 --no-recompute --no-compact --force

Prerequisites

LEANN index built for semantic searchMCP server for AST-grepMorph API key for fast text search

How it compares

This skill provides a decision tree to select the most appropriate search tool for a given query, rather than using a single, generic search method.

Compared to similar skills

search-tools side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
search-tools (this skill)57moReviewBeginner
semtools09moReviewIntermediate
exa-search02moNo flagsBeginner
priorart01moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry