smgrep

Search codebases with natural-language queries and return file paths with code snippets.

70|7|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/can1357/smgrep --skill smgrep
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: smgrep
Source: https://github.com/can1357/smgrep/tree/main/plugins/smgrep/skills/smgrep
Command: npx skills add https://github.com/can1357/smgrep --skill smgrep

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables semantic code search across a codebase by asking questions like "where is X implemented" or "how does Y work". It returns file paths with line numbers and code snippets to quickly locate relevant logic. Snippets are previews (first 16 lines) to help you decide which file to read in full.

Core Features & Use Cases

  • Semantic search: Find concepts and patterns, not just exact strings.
  • Code discovery: Locate implementation across repositories with path constraints and contextual understanding.
  • Output semantics: Get results as a path:line with an inlined code snippet for quick context.
  • Use Case: Example: ask where authentication is handled or how a plugin is loaded, and get a concise list of files with context to inspect.

Quick Start

Install smgrep and run a sample query like: smgrep "how are plugins loaded" to discover relevant code paths. The first search will index the repository and return results with file paths and line numbers.

Frequently Asked Questions about smgrep

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search code by concept instead of exact text matching?

Semantic code search finds implementations by meaning rather than keywords. smgrep queries natural-language questions like "where is authentication handled" to locate relevant code across your codebase, returning file paths, line numbers, and code snippets for quick inspection.

Can I search a codebase to locate where a specific feature is implemented?

Yes. smgrep enables code discovery by accepting concept-based questions such as "how are plugins loaded" or "where is this check implemented." Results include file paths with line numbers and contextual code previews to help you identify relevant files.

How does semantic search help me navigate a large codebase?

Semantic search understands architectural patterns and behavior rather than exact strings, reducing manual file browsing. smgrep indexes your repository and returns targeted results with snippets, letting you quickly narrow down which files contain the logic you need.

Does smgrep support scoped searches within specific directories?

Yes. smgrep supports path constraints so you can limit searches to specific directories or modules, making it faster to locate implementations within particular sections of your codebase.

What information does smgrep provide in search results?

Results include the file path, line number, and a truncated code snippet (up to 16 lines) that provides context. Snippets are previews; smgrep instructs you to read the full file for complete understanding of the implementation.

Do I need to set up indexing before searching my codebase?

No manual setup is required. smgrep automatically indexes your repository on the first search, then returns results with file paths and line numbers. Subsequent searches use the index for faster lookups.