codemap_find_relevant

Find files most relevant to a specific task or goal using AI-powered relevance ranking.

searchrelevanceairanking

Parameters

NameTypeRequiredDescription
taskstring✅ RequiredDescription of the task or goal to find relevant files for
maxResultsnumber❌ OptionalMaximum number of results to return (default: 5)

Usage Examples

MCP Usage (for AI Agents like Claude)

json
{
  "name": "codemap_find_relevant",
  "arguments": {
    "task": "implement user authentication",
    "maxResults": 5
  }
}

Example Output

JSON Response

json
{
  "success": true,
  "results": [
    {
      "path": "src/features/auth.ts",
      "score": "0.92",
      "breakdown": {
        "domain": "0.95",
        "usage": "0.88",
        "policy": "0.90",
        "symbols": "0.94",
        "path": "0.96",
        "wordMatch": "0.89"
      }
    },
    {
      "path": "src/api/auth-routes.ts",
      "score": "0.87",
      "breakdown": {
        "domain": "0.90",
        "usage": "0.85",
        "policy": "0.88",
        "symbols": "0.86",
        "path": "0.92",
        "wordMatch": "0.82"
      }
    }
  ],
  "count": 2
}
ℹ️When to Use This Tool
  • AI-powered file discovery for tasks
  • Find starting points for features
  • Locate relevant code for bug fixes
  • Discover related functionality
  • Navigate unfamiliar codebases
💡Common Patterns
Task-Based Discovery
const results = await codemap.search.findRelevant({
task: 'implement feature X'
});


Top Matches
const top3 = await codemap.search.findRelevant({
task: 'fix bug',
maxResults: 3
});
💡Pro Tips
Be specific - Detailed task descriptions yield better results
Check scores - Files >0.8 are highly relevant
Review breakdown - Understand why files ranked high
Use for exploration - Great for unfamiliar codebases
Best Practices
Start broad - Use general task descriptions first
Refine as needed - Add specifics if results aren't relevant
Check top 5-10 - Best matches usually in top results
Combine with other searches - Use results as starting points
⚠️Common Mistakes
Mistake: Vague task descriptions
await codemap.search.findRelevant({ task: 'code' });

Instead: Be specific
await codemap.search.findRelevant({
task: 'implement user registration with email verification'
});

Changelog

1 release
    • 🆕AddedNew categories, categoryMaxResults, and summary parameters — same category-search and landscape-scan support as codemap_search
    • 🆕AddedToken-based relevance scoring for non-file categories (camelCase/snake_case splitting, multi-word matching, frequency weighting) — only this tool uses scored category search; search and search_in_files use faster substring matching
    • 🆕AddedPagination — new page param with totalAvailable (full file count) and hasMore in the response
    • 🐛FixedPagination hasMore bug — scoreFiles() was called with exactly the current page's count, making hasMore always false; now requests one extra page worth so the next-page existence is detectable
    • 🐛FixedNon-file category searches now correctly use scored relevance ranking instead of plain substring matching