// This skill should be used when the user asks to "find code", "search codebase", "locate functions", "understand architecture", "find implementations", or needs intelligent code discovery using MorphLLM's AI-powered search tools.
| name | code-search |
| description | This skill should be used when the user asks to "find code", "search codebase", "locate functions", "understand architecture", "find implementations", or needs intelligent code discovery using MorphLLM's AI-powered search tools. |
| version | 1.0.0 |
Discover and understand code using MorphLLM's intelligent search tools. These tools use AI and semantic search to find code by meaning, not just keywords.
Use this skill when:
DO NOT use for:
Best for: Finding code when you don't know where it is
mcp__plugin_morphllm_morphllm-mcp__fast_context_search(
repoPath="/absolute/path/to/repository",
query="Where is JWT token validation implemented?"
)
How it works:
Example queries:
Output format:
Best for: Natural language semantic code search
mcp__plugin_morphllm_morphllm-mcp__codebase_search(
repoId="your-repo-identifier",
query="JWT validation logic",
limit=10,
branch="main",
target_directories=["src", "lib"]
)
How it works:
Requirements:
Example queries:
Output format:
| Use Case | Tool | Why |
|---|---|---|
| Don't know where code is | fast_context_search | AI agent explores |
| Know general area | codebase_search | Faster, semantic |
| Complex architecture | fast_context_search | Deeper analysis |
| Quick lookup | codebase_search | Sub-second results |
| No git setup | fast_context_search | Works locally |
| Git repo ready | codebase_search | Uses indexed code |
Good queries (specific):
- "Where is user password hashing implemented?"
- "Find the middleware that handles authentication"
- "Where are database migrations run?"
- "How does the API rate limiting work?"
Bad queries (too vague):
- "Find code"
- "Show me the app"
- "Where is everything?"
- "All the functions"
Find implementation:
"Where is [functionality] implemented?"
"How does [feature] work?"
"Find the [component] logic"
Understand architecture:
"How are [components] connected?"
"What is the flow for [operation]?"
"Where are [entities] defined?"
Locate patterns:
"Find all [pattern] usage"
"Where is [technology] configured?"
"Show [pattern] implementations"
Results include:
Next steps after search:
Must first push code to Morph git:
# Initialize Morph repo
morph init
# Push code for indexing
git add .
git commit -m "Initial commit"
morph push
Once pushed, code is indexed for semantic search.
Required:
query: Natural language queryrepoId: Repository identifierOptional:
limit: Max results (default: 10)branch: Branch to search (default: latest)commitHash: Specific commit hashtarget_directories: Filter to specific dirsSearch specific areas:
codebase_search(
repoId="myapp",
query="authentication logic",
target_directories=["src/auth", "src/middleware"]
)
Search entire codebase:
codebase_search(
repoId="myapp",
query="authentication logic",
target_directories=[] # Empty = all directories
)
Relevance scores:
Focus on high-relevance results first.
Code chunks:
1. Find entry points
- fast_context_search: "Where is the main entry point?"
2. Understand architecture
- fast_context_search: "How are components organized?"
3. Find key features
- codebase_search: "authentication", "database", "api"
4. Read important files
- Use file-operations to read found files
5. Map dependencies
- fast_context_search: "What dependencies does [component] use?"
1. Find error location
- codebase_search: "error handling [feature]"
2. Understand context
- fast_context_search: "How does [feature] work?"
3. Find related code
- codebase_search: "similar patterns"
4. Read full context
- file-operations: read_multiple_files
5. Make fix
- code-editing: edit_file
1. Find similar features
- codebase_search: "existing [similar feature]"
2. Understand patterns
- fast_context_search: "How is [pattern] implemented?"
3. Locate integration points
- fast_context_search: "Where should [feature] be added?"
4. Read related files
- file-operations: read_multiple_files
5. Implement feature
- code-editing: edit_file
1. Find all usage
- codebase_search: "[component] usage"
2. Understand dependencies
- fast_context_search: "What depends on [component]?"
3. Identify patterns
- fast_context_search: "How is [component] used?"
4. Plan changes
- Review search results
5. Apply refactor
- code-editing: edit_file (multiple files)
Narrow the scope:
# Specific: Faster
"Where is user email validation in the auth module?"
# Generic: Slower
"Find validation code"
Be precise:
# Good: Clear target
"Find JWT token generation function"
# Bad: Too broad
"Find security code"
Use appropriate limit:
# Quick check: limit=5
# Thorough search: limit=20
# Default: limit=10
Filter directories:
# Faster: Specific directories
target_directories=["src/auth"]
# Slower: Entire codebase
target_directories=[]
Search recent work:
# Faster: Specific branch
branch="feature-branch"
# Slower: Main branch
branch="main"
1. Search: fast_context_search(query="auth middleware")
2. Get file paths from results
3. Read: read_multiple_files(paths=[...])
4. Analyze complete files
1. Search: codebase_search(query="password hashing")
2. Review relevance scores
3. Filter high-relevance results (>0.7)
4. Read top results
1. Fast search: fast_context_search(query="how auth works")
2. Get overview and key files
3. Semantic search: codebase_search(query="authentication")
4. Find related implementations
5. Read and analyze all results
1. Find main component: fast_context_search
2. Find usage: codebase_search with component name
3. Map dependencies
4. Understand architecture
Repository not found:
Error: Path does not exist
Solution:
- Verify repoPath is absolute
- Check path exists
- Ensure path is correct
Query too vague:
Result: No relevant results found
Solution:
- Make query more specific
- Add context to query
- Try different phrasing
Repository not indexed:
Error: Repository not found in Morph
Solution:
1. Initialize Morph: morph init
2. Commit code: git commit
3. Push to Morph: morph push
4. Retry search
No matches:
Result: No code chunks found
Solution:
- Broaden query
- Check branch/commit
- Verify target_directories
- Try fast_context_search instead
✅ DO:
❌ DON'T:
AI-powered search: fast_context_search
Semantic search: codebase_search
For advanced techniques:
references/query-patterns.md - Effective query patternsreferences/search-strategies.md - Search workflow strategiesWorking examples in examples/:
search-workflow.sh - Complete search workflowsemantic-search.sh - Semantic search examplesUse these tools to intelligently discover code. Combine with file-operations and code-editing for complete workflows.