Code Search Selector logo

Code Search Selector

Organization
MadAppGang
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'.

Overview

PublisherMadAppGang
Repositoryclaude-code
Skill namecode-search-selector
Stars
281
Forks
26
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions β€” no extra files to sync.

  • Open source

    Published by MadAppGang on GitHub. Read the source before you install it.

Installation

Install the Code Search Selector AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder β€” it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins β†’ Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins β†’ Skills β†’ Add skill β†’ From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill β€” copy the folder into that agent's skills directory.

Claude Code β€” .claude/skills
git clone --depth 1 https://github.com/MadAppGang/claude-code.git /tmp/claude-code
mkdir -p .claude/skills
cp -r /tmp/claude-code/plugins/code-analysis/skills/code-search-selector .claude/skills/code-search-selector
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Code Search Selector in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself β€” you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Code Search Selector on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Code Search Selector is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself β€” all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it β€” the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing β€” a skill is instructions your model will follow.

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

bash
grep -r "auth" src/
# Result: 500 lines of noise, hard to understand

More effective approach:

bash
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 RequestCategoryRecommended Tool
"Find all X", "How does X work"Semanticclaudemem search
"Audit X integration", "Map data flow"Semanticclaudemem search
"Understand architecture", "Trace X"Semanticclaudemem map
"Find exact string 'foo'"Exact MatchGrep
"Count occurrences of X"Exact MatchGrep
"Find symbol UserService"Exact MatchGrep

Step 2: Check claudemem Status (MANDATORY for Semantic)

bash
# ALWAYS run this before semantic search
claudemem status

Interpret the output:

StatusWhat It MeansNext Action
Shows chunk count (e.g., "938 chunks")βœ… IndexedUSE CLAUDEMEM (Step 3)
"No index found"❌ Not indexedOffer to index (Step 2b)
"command not found"❌ Not installedFall back to Detective agent

Step 2b: If Not Indexed, Offer to Index

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

bash
claudemem index -y

Step 3: Execute the Search

IF CLAUDEMEM IS INDEXED (from Step 2):

bash
# 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:

typescript
Task({
  subagent_type: "code-analysis:detective",
  description: "Investigate [topic]",
  prompt: "Use semantic search to find..."
})

Tool Recommendations by Use Case

Use CaseLess EfficientMore Efficient
Semantic queriesgrep -r "pattern" src/claudemem search "concept"
Find implementationsGlob β†’ Read allclaudemem search "feature"
Understand flowfind . -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:

  1. Use the provided results - They're ranked by relevance
  2. For more data - Run additional claudemem queries
  3. Bypass available - Use _bypass_claudemem: true for native tools when needed

The hook system provides claudemem results proactively when the index is available.


Task-to-Tool Mapping Reference

User RequestNative ApproachSemantic 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"claudemem search "database query SQL prisma"
"Map the data flow"grep -r "transform|map"claudemem search "data transformation pipeline"
"What's the architecture?"ls -la src/claudemem --agent map "architecture"
"Find error handling"grep -r "catch|error"claudemem search "error handling exception"
"Trace user creation"grep -r "createUser"claudemem search "user creation registration"

When Grep IS Appropriate

βœ… Use Grep for:

  • Finding exact string: grep -r "DEPRECATED_FLAG" src/
  • Counting occurrences: grep -c "import React" src/**/*.tsx
  • Finding specific symbol: grep -r "class UserService" src/
  • Regex patterns: grep -r "TODO:\|FIXME:" src/

❌ Never use Grep for:

  • Understanding how something works
  • Finding implementations by concept
  • Architecture analysis
  • Tracing data flow
  • Auditing integrations

Integration with Detective Skills

After using this skill's decision tree, invoke the appropriate detective:

Investigation TypeDetective Skill
Architecture patternscode-analysis:architect-detective
Implementation detailscode-analysis:developer-detective
Test coveragecode-analysis:tester-detective
Bug root causecode-analysis:debugger-detective
Comprehensive auditcode-analysis:ultrathink-detective

Quick Reference Card

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    CODE SEARCH QUICK REFERENCE                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  1. ALWAYS check first:  claudemem status                       β”‚
β”‚                                                                  β”‚
β”‚  2. If indexed:          claudemem search "semantic query"       β”‚
β”‚                                                                  β”‚
β”‚  3. For exact matches:   Grep tool (only this case!)            β”‚
β”‚                                                                  β”‚
β”‚  4. For deep analysis:   Task(code-analysis:detective)          β”‚
β”‚                                                                  β”‚
β”‚  ⚠️ GREP IS FOR EXACT MATCHES, NOT SEMANTIC UNDERSTANDING       β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pre-Investigation Checklist

Before ANY code investigation task, verify:

  • Ran claudemem status to check index
  • Classified task as SEMANTIC or EXACT MATCH
  • Selected appropriate tool based on classification
  • NOT using grep for semantic queries when claudemem is indexed

Multi-File Read Optimization

When reading multiple files, consider if a semantic search would be more efficient:

ScenarioOptimization
Read 3+ files in same directoryTry claudemem search first
Glob with broad patternsTry claudemem --agent map
Sequential reads to "understand"One semantic query may suffice

Quick check before bulk reads:

  1. Is claudemem indexed? (claudemem status)
  2. Can this be one semantic query instead of N file reads?

Interception Examples

❌ About to do:

Read src/services/auth/login.ts
Read src/services/auth/session.ts
Read src/services/auth/jwt.ts
Read src/services/auth/middleware.ts
Read src/services/auth/types.ts
Read src/services/auth/utils.ts

βœ… Do instead:

bash
claudemem search "authentication login session JWT middleware" -n 15

❌ About to do:

Glob pattern: src/services/prime/**/*.ts
Then read all 12 matches sequentially

βœ… Do instead:

bash
claudemem search "Prime API integration service endpoints" -n 20

❌ Parallelization trap:

"Let me Read these 5 files while the detective agent works..."

βœ… Do instead:

Trust the detective agent to use claudemem.
Don't duplicate work with inferior Read/Glob.

Efficiency Comparison

ApproachToken CostResult Quality
Read 5+ files sequentially~5000 tokensNo ranking
Glob β†’ Read all matches~3000+ tokensNo semantic understanding
claudemem search once~500 tokensRanked by relevance

Tip: Claudemem results include context around matches, so you often don't need to read full files.


Recommended Workflow

  1. Check index: claudemem status
  2. Search semantically: claudemem search "concept query" -n 15
  3. Read specific code: Use results to target file:line reads

This workflow finds relevant code faster than reading files sequentially.


Maintained by: MadAppGang Plugin: code-analysis v2.16.0 Purpose: Help choose the most efficient search tool for each task

Frequently asked questions

What does the Code Search Selector AI skill do?

πŸ’‘ 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'.

Why use Code Search Selector on TypingMind?

Because you install it once and use it with any model. Code Search Selector is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model β€” and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Code Search Selector in TypingMind?

Open Plugins β†’ Skills β†’ Install from GitHub in TypingMind and paste https://github.com/MadAppGang/claude-code/tree/main/plugins/code-analysis/skills/code-search-selector. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Code Search Selector?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Code Search Selector?

As many as you like. As long as a model supports skills, you can use Code Search Selector with it β€” GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more β€” all on TypingMind with your own API keys.

Is the Code Search Selector AI skill free?

Yes. It is published on GitHub by MadAppGang under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call β€” code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter πŸ‘‡