codemap_find_relevant
Find files most relevant to a specific task or goal using AI-powered relevance ranking.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
task | string | ✅ Required | Description of the task or goal to find relevant files for |
maxResults | number | ❌ Optional | Maximum 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
Top Matches
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
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
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
✅ Instead: Be specific
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, andsummaryparameters — same category-search and landscape-scan support ascodemap_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;
searchandsearch_in_filesuse faster substring matching - 🆕AddedPagination — new
pageparam withtotalAvailable(full file count) andhasMorein the response - 🐛FixedPagination
hasMorebug —scoreFiles()was called with exactly the current page's count, makinghasMorealways 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
- 🆕AddedNew