askill
search-interceptor

search-interceptorSafety 90Repository

πŸ’‘ Bulk file read optimizer. Suggests semantic search alternatives when reading multiple files. Helps reduce token usage by using claudemem's ranked results instead of sequential file reads.

224 stars
4.5k downloads
Updated 2/4/2026

Package Files

Loading files...
SKILL.md

Search Interceptor

This skill helps optimize bulk file operations by suggesting semantic search alternatives when they would be more efficient.

When Semantic Search is More Efficient

ScenarioToken CostAlternative
Read 5+ files~5000 tokensclaudemem search (~500 tokens)
Glob all *.ts files~3000+ tokensclaudemem --agent map
Sequential reads to understandVariableOne semantic query

When to Consider Alternatives

Multiple File Reads

If planning to read several files, consider:

# Instead of reading 5 files individually
claudemem search "concept from those files" -n 15
# Gets ranked results with context

Broad Glob Patterns

If using patterns like src/**/*.ts:

# Instead of globbing and reading all matches
claudemem --agent map "what you're looking for"
# Gets structural overview with PageRank ranking

File Paths Mentioned in Task

Even when specific paths are mentioned, semantic search often finds additional relevant code:

claudemem search "concept related to mentioned files"

Interception Protocol

Step 1: Pause Before Execution

When you're about to execute bulk file operations, STOP and run:

claudemem status

Step 2: Evaluate

If claudemem is indexed:

Your PlanBetter Alternative
Read 5 auth filesclaudemem search "authentication login session"
Glob all servicesclaudemem search "service layer business logic"
Read mentioned pathsclaudemem search "[concept from those paths]"

If claudemem is NOT indexed:

claudemem index -y

Then proceed with semantic search.

Step 3: Execute Better Alternative

# Instead of reading N files, run ONE semantic query
claudemem search "concept describing what you need" -n 15

# ONLY THEN read specific lines from results

Interception Decision Matrix

SituationIntercept?Action
Read 1-2 specific filesNoProceed with Read
Read 3+ files in investigationYESConvert to claudemem search
Glob for exact filenameNoProceed with Glob
Glob for pattern discoveryYESConvert to claudemem search
Grep for exact stringNoProceed with Grep
Grep for semantic conceptYESConvert to claudemem search
Files mentioned in promptYESSearch semantically first

Examples of Interception

Example 1: Auth Investigation

❌ Original plan:

I see the task mentions auth, let me read:
- src/services/auth/login.ts
- src/services/auth/session.ts
- src/services/auth/jwt.ts
- src/services/auth/middleware.ts
- src/services/auth/utils.ts

βœ… After interception:

claudemem status  # Check if indexed
claudemem search "authentication login session JWT token validation" -n 15
# Now I have ranked, relevant chunks instead of 5 full files

Example 2: API Integration Audit

❌ Original plan:

Audit mentions Prime API files:
- src/services/prime/internal_api/client.ts
- src/services/prime/api.ts
Let me just Read these directly...

βœ… After interception:

claudemem search "Prime API integration endpoints HTTP client" -n 20
# This finds ALL Prime-related code, ranked by relevance
# Not just the 2 files mentioned

Example 3: Pattern Discovery

❌ Original plan:

Glob("src/**/*.controller.ts")
Then read all 15 controllers to understand routing

βœ… After interception:

claudemem search "HTTP controller endpoint route handler" -n 20
# Gets the most relevant routing code, not all controllers

Why Semantic Search Often Works Better

Native ToolsSemantic Search
No rankingRanked by relevance + PageRank
No relationshipsShows code connections
~5000 tokens for 5 files~500 tokens for ranked results
Only explicitly requested codeDiscovers related code

Tip: For investigation tasks, try claudemem search first to get a ranked view of relevant code.


Integration with Other Skills

This skill works with:

SkillRelationship
code-search-selectorSelector determines WHAT tool; Interceptor validates BEFORE execution
claudemem-searchInterceptor redirects to claudemem; this skill shows HOW to search
deep-analysisInterceptor prevents bad patterns; deep-analysis uses good patterns
Detective skillsInterceptor prevents duplicate work by trusting detective agents

Hook System Integration

The hook system may provide claudemem results proactively when the index is available:

  • Grep queries β†’ May receive claudemem search results instead
  • Bulk reads β†’ May receive suggestion to use semantic search
  • Broad globs β†’ May receive map results

Using the Bypass Flag

When you specifically need native tool behavior:

{ "pattern": "exact string", "_bypass_claudemem": true }

This tells hooks you intentionally want native tool output.


Quick Reference

Before bulk Read/Glob operations, consider:

  1. Is claudemem indexed? β†’ claudemem status
  2. Can this be one semantic query? β†’ Often yes
  3. Do you need exact matches? β†’ Use native tools with bypass flag

General guideline: For understanding/investigation, try semantic search first. For exact matches, use native tools.


Maintained by: MadAppGang Plugin: code-analysis v2.16.0 Purpose: Help optimize bulk file operations with semantic search alternatives

Install

Download ZIP
Requires askill CLI v1.0+β–Ά

AI Quality Score

94/100Analyzed 2/12/2026

An exceptionally well-structured skill for optimizing token usage via semantic search. It features a clear decision matrix, step-by-step protocol, and concrete token-saving comparisons.

90
100
80
95
98

Metadata

Licenseunknown
Version-
Updated2/4/2026
PublisherMadAppGang

Tags

apipromptingsecurity