Overview
Code Search provides a powerful interface to explore your codebase:- Natural language queries - Search by describing what you’re looking for
- Pattern matching - Find exact code patterns and text
- Repository filtering - Narrow results to specific repositories
- Split-view results - Browse files on the left, view code on the right
- AI explanations - Optional AI-powered analysis of search results
Accessing Code Search
There are two ways to access Code Search:From a Product
This limits search results to repositories associated with that Product.
Standalone Code Search
Navigate directly to/code-search in your browser to search across all indexed repositories in your organization.
The Search Interface
Search Bar
The search bar at the top accepts your query:- Type your search query
- Press Enter or click the search button to execute
- A loading spinner appears while searching
Settings Panel
Click the gear icon next to the search bar to open the settings panel:Repository Filter
Select which repositories to include in your search:- Check/uncheck individual repositories
- Use Select All / Deselect All for bulk selection
- Repositories not yet indexed show a warning icon
Advanced Options
Generate Search Explanation - Enable this to get AI-powered analysis of your search results. When enabled, the AI will explain:- Why results were ranked the way they were
- How it interpreted your query
- Key factors that influenced each result’s score
Generating explanations adds 10-20 seconds to search time. Results appear first, then the explanation loads.
Search Results
Results display in a split-view layout:File List Sidebar
The left panel shows matching files:- File path with syntax-highlighted icon
- Match count showing number of results in each file
- Repository name when searching multiple repositories
- Click a file to view its matches
Code Preview Panel
The right panel displays the actual code:- Syntax highlighting for your code
- Line numbers for easy reference
- Match highlighting showing where your query matched
- File path header with copy and GitHub link buttons
Result Summary
When results load, a summary bar shows:- Query understanding - How the AI interpreted your search
- Search strategy - The approach used to find results
- Result count - “Showing X of Y results in Z files”
Search Examples
Finding Functions by Description
Query: “authentication middleware that checks JWT tokens” Results: Functions related to JWT validation, auth middleware, token verificationLocating Error Handling
Query: “try catch blocks with database errors” Results: Error handling code around database operationsPattern Matching
Query: “import from” Results: Files with specific React imports (exact text match)Understanding Architecture
Query: “main entry point application startup” Results: Bootstrap files, main functions, app initialization codeTips for Better Results
Search History
Your recent searches are saved for quick access:- Click in the search box to see your search history
- Click any previous search to run it again
- History shows your most recent queries
Understanding Results
Semantic vs Pattern Matching
Kasava uses structural search by default, which finds exact text patterns. The semantic capabilities from indexed embeddings help with ranking and understanding.| Search Type | Best For |
|---|---|
| Exact patterns | Finding specific function names, imports, constants |
| Natural language | Describing what code does conceptually |
Match Quality Indicators
Results are sorted by relevance. Higher-ranked results typically:- Match more of your query terms
- Have stronger semantic similarity
- Appear in more relevant code contexts (functions, classes vs. comments)
Working with Results
Copying Code
Click the copy button in the code preview header to copy the displayed code to your clipboard.Opening in GitHub
Click the GitHub icon to open the file directly in your GitHub repository.Navigating Between Files
Click different files in the sidebar to switch between results without running a new search.Combining with AI Chat
For deeper exploration:- Search to find relevant code sections
- Chat to understand how they work (press
Cmd+Jto open chat) - Search again based on what you learned
Troubleshooting
No Results Found
If your search returns no results:- Check repository selection - Ensure repositories are selected in the settings
- Verify indexing - Unindexed repositories show a warning icon; they need to be indexed first
- Broaden your query - Try more general terms
- Check for typos - Exact pattern matches are case-sensitive
Results Don’t Seem Relevant
- Be more specific - Add more context to your query
- Try different phrasing - Describe the same thing in a different way
- Enable explanations - See how the AI interpreted your query
Search is Slow
- Reduce repository scope - Search fewer repositories at once
- Disable explanations - Turn off AI explanations for faster results
- Check repository size - Very large repositories take longer to search
Limitations
- Only searches indexed repositories
- Results are based on last index time
- Very large result sets may be paginated
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Enter | Execute search |
Cmd/Ctrl + K | Open command palette (then search) |