Mgrep Code Search
Quickly finds code snippets matching complex patterns across large repositories using advanced regular expressions.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add mgrep-code-search npx -- -y @trustedskills/mgrep-code-search
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"mgrep-code-search": {
"command": "npx",
"args": [
"-y",
"@trustedskills/mgrep-code-search"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
The mgrep-code-search skill enables AI agents to perform advanced code searches across repositories using grep-like patterns. It allows for filtering results by file type, line numbers, and specific context within the codebase.
When to use it
- Locating specific functions or variables across a large monorepo quickly.
- Finding all instances of a deprecated API usage before refactoring.
- Searching for configuration patterns (e.g., environment variables) hidden in multiple files.
- Identifying lines containing specific error codes or log messages within source code.
Key capabilities
- Executes standard grep commands directly against code repositories.
- Supports regex patterns for flexible and complex search queries.
- Filters results by file extensions to narrow down relevant code.
- Returns precise line numbers and surrounding context for matches.
Example prompts
- "Find all occurrences of 'TODO' comments in Python files within the project."
- "Search for any usage of the
legacy_authfunction and show me the line numbers." - "List all JavaScript files that import the
axioslibrary."
Tips & gotchas
Ensure the AI agent has read access to the target repository before initiating a search, as it cannot scan private or inaccessible codebases. For very large repositories, consider refining your regex patterns to avoid overwhelming the context window with excessive results.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.