code-search-selector
БесплатноБез исполняемых скриптовНе проверен💡 Tool selector for code search tasks. Helps choose between semantic search (claudemem) and native tools (Grep/Glob) based on query type. Semantic search…
Об этом скилле
Code Search Tool Selector
This skill helps choose the most effective search tool for your task.
When Semantic Search Works Better
Claudemem provides better results for conceptual queries:
| Query Type | Example | Recommended Tool |
|---|---|---|
| "How does X work?" | "How does authentication work?" | claudemem search |
| Find implementations | "Find all API endpoints" | claudemem search |
| Architecture questions | "Map the service layer" | claudemem --agent map |
| Trace data flow | "How does user data flow?" | claudemem search |
| Audit integrations | "Audit Prime API usage" | claudemem search |
When Native Tools Work Better
| Query Type | Example | Recommended Tool |
|---|---|---|
| Exact string match | "Find 'DEPRECATED_FLAG'" | Grep |
| Count occurrences | "How many TODO comments?" | Grep -c |
| Specific symbol | "Find class UserService" | Grep |
| File patterns | "Find all *.config.ts" | Glob |
Why Semantic Search is Often More Efficient
Token Efficiency: Reading 5 files costs ~5000 tokens; claudemem search costs ~500 tokens with ranked results.
Context Discovery: Claudemem finds related code you didn't know to ask for.
Ranking: Results sorted by relevance and PageRank, so important code comes first.
Example: Semantic Query
User asks: "How does authentication work?"
Less effective approach:
grep -r "auth" src/
# Result: 500 lines of noise, hard to understand
More effective approach:
claudemem status # Check if indexed
claudemem search "authentication login flow JWT"
# Result: Top 10 semantically relevant code chunks, ranked
Quick Decision Guide
Classify the Task
| User Request | Category | Recommended Tool |
|---|---|---|
| "Find all X", "How does X work" | Semantic | claudemem search |
| "Audit X integration", "Map data flow" | Semantic | claudemem search |
| "Understand architecture", "Trace X" | Semantic | claudemem map |
| "Find exact string 'foo'" | Exact Match | Grep |
| "Count occurrences of X" | Exact Match | Grep |
| "Find symbol UserService" | Exact Match | Grep |
Step 2: Check claudemem Status (MANDATORY for Semantic)
# ALWAYS run this before semantic search
claudemem status
Interpret the output:
| Status | What It Means | Next Action |
|---|---|---|
| Shows chunk count (e.g., "938 chunks") | ✅ Indexed | USE CLAUDEMEM (Step 3) |
| "No index found" | ❌ Not indexed | Offer to index (Step 2b) |
| "command not found" | ❌ Not installed | Fall back to Detective agent |
Step 2b: If Not Indexed, Offer to Index
AskUserQuestion({
questions: [{
question: "Claudemem is not indexed. Index now for better semantic search results?",
header: "Index?",
multiSelect: false,
options: [
{ label: "Yes, index now (Recommended)", description: "Takes 1-2 minutes, enables semantic search" },
{ label: "No, use grep instead", description: "Faster but less accurate for semantic queries" }
]
}]
})
If user says yes:
claudemem index -y
Step 3: Execute the Search
IF CLAUDEMEM IS INDEXED (from Step 2):
# Get role-specific guidance first
claudemem ai developer # or architect, tester, debugger
# Then search semantically
claudemem search "authentication login JWT token validation" -n 15
IF CLAUDEMEM IS NOT AVAILABLE:
Use the detective agent:
Task({
subagent_type: "code-analysis:detective",
description: "Investigate [topic]",
prompt: "Use semantic search to find..."
})
Tool Recommendations by Use Case
| Use Case | Less Efficient | More Efficient |
|---|---|---|
| Semantic queries | grep -r "pattern" src/ |
claudemem search "concept" |
| Find implementations | Glob → Read all |
claudemem search "feature" |
| Understand flow | find . -name "*.ts" | xargs... |
claudemem --agent map |
Native tools (Grep, Glob, find) work well for exact matches but provide no semantic ranking.
When Hooks Redirect to Claudemem
If a hook provides claudemem results instead of native tool output:
- Use the provided results - They're ranked by relevance
- For more data - Run additional claudemem queries
- Bypass available - Use
_bypass_claudemem: truefor native tools when needed
The hook system provides claudemem results proactively when the index is available.
Task-to-Tool Mapping Reference
| User Request | Native Approach | Semantic Approach (Recommended) |
|---|---|---|
| "Audit all API endpoints" | grep -r "router|endpoint" |
claudemem search "API endpoint route handler" |
| "How does auth work?" | grep -r "auth|login" |
claudemem search "authentication login flow" |
| "Find all database queries" | `grep -r "prisma|query" |
Установить code-search-selector в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadAskUserQuestionFAQ
Что делает скилл code-search-selector?
💡 Tool selector for code search tasks. Helps choose between semantic search (claudemem) and native tools (Grep/Glob) based on query type. Semantic search recommended for: 'how does X work', 'find all', 'audit', 'investigate', 'architecture'.
Как установить скилл code-search-selector?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл code-search-selector запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic