Engineering
code-search-selector avatar

code-search-selector

Intelligent tool selector for code search. Routes queries between semantic (claudemem) and native tools (Grep/Glob) to optimize efficiency, token usage, and search accuracy.

Introduction

The code-search-selector skill serves as an intelligent decision-making layer for development workflows, designed to guide users toward the most effective search method for their specific task. By evaluating the intent behind a user's request, the skill determines whether a semantic search using claudemem is superior for high-level conceptual questions or if a native tool like Grep or Glob is more appropriate for exact pattern matching. This workflow optimization reduces unnecessary token consumption while ensuring high-quality, ranked search results.

  • Automatically differentiates between conceptual queries such as 'how does X work' or 'audit integration' and exact string or symbol lookups.

  • Provides a proactive decision tree that checks claudemem indexing status before execution, offering to index repositories when necessary to guarantee semantic accuracy.

  • Facilitates advanced semantic capabilities like architecture mapping via 'claudemem --agent map', data flow tracing, and implementation discovery across large codebases.

  • Integrates with native command-line utilities for scenarios requiring exact matches, such as finding specific flag constants, counting occurrences of TODOs, or filtering by file pattern.

  • Features a fallback mechanism that routes complex investigative tasks to the code-analysis:detective agent when semantic indices are unavailable.

  • Delivers ranked, relevant code chunks using PageRank and relevance scoring, which significantly outperforms standard raw text matching for large projects.

  • Always perform a 'claudemem status' check before attempting semantic queries; if the index is missing, initiate 'claudemem index -y' to ensure maximum performance.

  • Use semantic search for: architectural investigations, tracing data flow, finding implementations by concept, auditing API usage, and broad feature exploration.

  • Use native Grep for: exact string matches, regex patterns, counting symbol occurrences, and simple file pattern filters where relevance ranking is not required.

  • When the hook system provides proactive claudemem results, prioritize these over manual native tool searches to benefit from relevance ranking and token efficiency.

  • The tool is designed for software engineers and architects managing complex, evolving codebases who need to balance speed, cost (token usage), and depth of analysis.

Repository Stats

Stars
255
Forks
31
Open Issues
7
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
Apr 30, 2026, 09:26 AM
View on GitHub