Skip to main content
skill CX Codex

search-router — Claude Code skill: pick the right search tool

Tells the agent which search tool fits a query: TLDR, AST-grep, semantic search or Grep. Saves tokens on codebase recon.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add parcadei/Continuous-Claude-v3 --skill search-router -a claude-code
Open on GitHub

What search-router does

The skill lays out a decision tree keyed to query type. For code exploration — symbols, call chains, data flow — it points to tldr search "query" . and marks that as the default instead of Grep. Structural patterns like def foo, class Bar or import X go to /ast-grep-find; conceptual questions go to tldr semantic search "query"; Grep is left as a last resort for exact text and regex.

Inside there is a token-cost table plus command examples. TLDR returns roughly 50–500 tokens, AST-grep about 50, Grep 200 to 2000, and Read 1500 or more. That ordering drives the suggested flow: find matches first, open only the top hit, skip the rest.

The skill is marked user-invocable: false, so you cannot call it yourself — it acts as guidance the agent reads. The commands in the tree only pay off if tldr and /ast-grep-find are actually available on your machine; otherwise you are left with advice and nothing to run. Worth adding when searching a large repo is already eating your context.

What it helps with

  • locate where a symbol is defined without reading whole files
  • trace a call chain and data flow
  • pull out functions and classes by AST pattern
  • ask how authentication works in plain words
  • cut token spend while exploring an unfamiliar repo

Example prompts for the agent

  • find where spawn_agent is used, use tldr
  • list every async def in the project with ast-grep
  • how is error handling done here? search semantically

How to install search-router

1Skills CLI (Vercel)

npx skills add parcadei/Continuous-Claude-v3 --skill search-router -a claude-code

2Manually: put the files in place

~/.claude/skills/search-router/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/search-router/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about search-router

How do I install search-router in Claude?

Run npx skills add parcadei/Continuous-Claude-v3 --skill search-router -a claude-code. The skill file lands at ~/.claude/skills/search-router/SKILL.md.

What does search-router do?

It gives the agent rules for matching a search tool to a query type: TLDR for code exploration, AST-grep for structural patterns, semantic search for conceptual questions, Grep as a last resort.

Can I invoke search-router manually?

No. It is marked user-invocable: false, so it works as guidance for the agent rather than a slash command.

Source text

SKILL.md · MIT
---
name: search-router
description: Choose the right search tool for each query type
user-invocable: false
---

# 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

| 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 |

## 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 Semantic
tldr 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 matches
2. Read: Top match only → Full understanding
3. 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 · MIT · parcadei/Continuous-Claude-v3

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set69

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor