smgrep
Semantic code search for Claude Code. High-performance Rust implementation with automatic project indexing.
View on GitHubTable of content
Semantic code search for Claude Code. High-performance Rust implementation with automatic project indexing.
Installation
npx claude-plugins install @can1357/smgrep/smgrep
Contents
Folders: skills
Files: hooks.json
Included Skills
This plugin includes 1 skill definition:
smgrep
Semantic code search using natural language queries. Use when users ask “where is X implemented”, “how does Y work”, “find the logic for Z”, or need to locate code by concept rather than exact text. Returns file paths with line numbers and code snippets.
View skill definition
When to Use
Use this to find code by concept or behavior (e.g., “where is auth validated”, “how are plugins loaded”). Note: This tool prioritizes finding the right files and locations in the code. Snippets are truncated (max 16 lines) and are often just previews.
Example:
smgrep "how are plugins loaded"
smgrep "how are plugins loaded" packages/transformers.js/src
Strategy for Different Query Types
For Architectural/System-Level Questions (auth, LSP integration, file watching)
- Search Broadly First: Use a conceptual query to map the landscape.
smgrep "authentication authorization checks"
- Survey the Results: Look for patterns across multiple files:
- Are checks in middleware? Decorators? Multiple services?
- Do file paths suggest different layers (gateway, handlers, utils)?
- Read Strategically: Pick 2-4 files that represent different aspects:
- Read the main entry point
- Read representative middleware/util files
- Follow imports if architecture is unclear
- Refine with Specific Searches: If one aspect is unclear:
smgrep "session validation logic"smgrep "API authentication middleware"
For Targeted Implementation Details (specific function, algorithm)
- Search Specifically: Ask about the precise logic.
smgrep "logic for merging user and default configuration"
- Evaluate the Semantic Match:
- Does the snippet look relevant?
- Crucial: If it ends
…(truncated)