Agent skill

Mgrep Code Search

by intellectronica in intellectronica/agent-skills

Semantic code search using mgrep for efficient codebase exploration.

CC0-1.0Auto-check passedDevelopment

Install Mgrep Code Search

skills CLI
$ npx skills add intellectronica/agent-skills --skill mgrep-code-search -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install intellectronica/agent-skills mgrep-code-search --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/intellectronica/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mgrep-code-search .claude/skills/mgrep-code-search && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mgrep-code-search
GitHub stars
295
Used in
1 other repo
Token cost
~871 tokens
SKILL.md length
257 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
CC0-1.0

At a glance

Semantic code search using mgrep for efficient codebase exploration.

  • Works in 3 steps: Start watcher (once per session or when… → Search semantically → Refine as needed using path constraints…
  • Tasks that involve Codebase onboarding
  • SKILL.md covers Overview, When to Use This Skill, Quick Start and Search Commands, plus 3 more sections
  • Calls bunx

What it does

Mgrep Code Search is an agent skill from intellectronica/agent-skills. Semantic code search using mgrep for efficient codebase exploration. This skill should be used when searching or exploring codebases with more than 30 non-gitignored files and/or nested directory structures. It provides natural language semantic search that complements traditional grep/ripgrep for finding features, understanding intent, and exploring unfamiliar code.

Its SKILL.md is about 870 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Codebase onboarding. The repository describes itself as: @intellectronica's agent skills. The licence is CC0-1.0.

When your agent uses it

  • Tasks that involve Codebase onboarding

Example prompts

  • “/mgrep-code-search”

Requirements

  • Node.js

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Start watcher (once per session or when files change significantly)
  2. Search semantically
  3. Refine as needed using path constraints or options

What it can do on your machine

Read from SKILL.md and the folder at commit 9b0e00a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bunx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use bunx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mgrep Code Search loads about 871 tokens when it runs. Until then it costs about 97 tokens; SKILL.md has 257 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~97
When it runs · the whole SKILL.md, loaded when a task matches
~871

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from intellectronica/agent-skills at commit 9b0e00a, republished under its CC0-1.0 licence (© intellectronica). 257 words, ~871 tokens.

Download SKILL.mdSave it as .claude/skills/mgrep-code-search/SKILL.md (or your agent's skills folder).
name
mgrep-code-search
description
Semantic code search using mgrep for efficient codebase exploration. This skill should be used when searching or exploring codebases with more than 30 non-gitignored files and/or nested directory structures. It provides natural language semantic search that complements traditional grep/ripgrep for finding features, understanding intent, and exploring unfamiliar code.

Overview

mgrep is a semantic search tool that enables natural language queries across code, text, PDFs, and images. It is particularly effective for exploring larger or complex codebases where traditional pattern matching falls short.

When to Use This Skill

Use mgrep when:

  • The codebase contains more than 30 non-gitignored files
  • There are nested directory structures
  • Searching for concepts, features, or intent rather than exact strings
  • Exploring an unfamiliar codebase
  • Need to understand "where" or "how" something is implemented

Use traditional grep/ripgrep when:

  • Searching for exact patterns or symbols
  • Regex-based refactoring
  • Tracing specific function or variable names

Quick Start

Indexing

Before searching, start the watcher to index the repository:

bash
bunx @mixedbread/mgrep watch

The watch command indexes the repository and maintains synchronisation with file changes. It respects .gitignore and .mgrepignore patterns.

Searching
bash
bunx @mixedbread/mgrep "your natural language query" [path]

Search Commands

bash
bunx @mixedbread/mgrep "where is authentication configured?"
bunx @mixedbread/mgrep "how do we handle errors in API calls?" src/
bunx @mixedbread/mgrep "database connection setup" src/lib
Search Options
OptionDescription
-m <count>Maximum results (default: 10)
-c, --contentDisplay full result content
-a, --answerGenerate AI-powered synthesis of results
-s, --syncUpdate index before searching
--no-rerankDisable relevance optimisation
Examples with Options
bash
# Get more results
bunx @mixedbread/mgrep -m 25 "user authentication flow"

# Show full content of matches
bunx @mixedbread/mgrep -c "error handling patterns"

# Get an AI-synthesised answer
bunx @mixedbread/mgrep -a "how does the caching layer work?"

# Sync index before searching
bunx @mixedbread/mgrep -s "payment processing" src/services

Workflow

  1. Start watcher (once per session or when files change significantly):

    bash
    bunx @mixedbread/mgrep watch
  2. Search semantically:

    bash
    bunx @mixedbread/mgrep "what you're looking for" [optional/path]
  3. Refine as needed using path constraints or options:

    bash
    bunx @mixedbread/mgrep -m 20 -c "refined query" src/specific/directory

Environment Variables

Configure defaults via environment variables:

VariablePurpose
MGREP_MAX_COUNTDefault result limit
MGREP_CONTENTEnable content display (1/true)
MGREP_ANSWEREnable AI synthesis (1/true)
MGREP_SYNCPre-search sync (1/true)

Important Notes

  • Always use bunx @mixedbread/mgrep to run commands (not npm/npx or direct installation)
  • Run bunx @mixedbread/mgrep watch before searching to ensure the index is current
  • mgrep respects .gitignore patterns automatically
  • Create .mgrepignore for additional exclusions

© intellectronica, CC0-1.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/mgrep-code-search of intellectronica/agent-skills.

Open the folder on GitHubat commit 9b0e00a

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in intellectronica/agent-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Mgrep Code Search next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mgrep Code Search compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mgrep Code Search this skillintellectronica/agent-skills2951 repos~871Automated safety check: PassCC0-1.0
Codebase Knowledge Graph Q&AEgonex-AI/Understand-Anything86k1 repos~1.2kAutomated safety check: PassMIT
Understand ExplainEgonex-AI/Understand-Anything86k1 repos~1.3kAutomated safety check: PassMIT
Repomix Codebase Exploreryamadashy/repomix29k1 repos~2.7kAutomated safety check: PassMIT
Code Graph Mermaid Diagramstrailofbits/skills7.4k1 repos~1.7kAutomated safety check: PassCC-BY-SA-4.0
Project Onboarding Guide from Knowledge GraphEgonex-AI/Understand-Anything86k—~1.2kAutomated safety check: PassMIT

Similar skills

  • Codebase Knowledge Graph Q&A

    Egonex-AI/Understand-Anything

    Answers questions about a codebase by searching a prebuilt knowledge graph of its files, functions, classes and dependencies, not by rereading every source file.

    86k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed
  • Understand Explain

    Egonex-AI/Understand-Anything

    Gives an in-depth explanation of one file, function or module by reading the project's knowledge graph and checking that the graph is still fresh.

    86k GitHub starsUsed in 1 repo~1.3k tokens
    DevelopmentAuto-check passed
  • Repomix Codebase Explorer

    yamadashy/repomix

    Packs a local or remote repository into a single AI-friendly file with the Repomix CLI, then reads and searches that output to explain structure, find patterns or report metrics.

    29k GitHub starsUsed in 1 repo~2.7k tokens
    DevelopmentAuto-check passed
  • Code Graph Mermaid Diagrams

    trailofbits/skills

    Official

    Generates Mermaid diagrams from Trailmark code graphs, including call graphs, class hierarchies, module dependency maps, complexity heatmaps and attack surface data flows.

    7.4k GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed
  • Writes an onboarding guide for new team members from a project's existing knowledge graph, after checking that the graph still matches the current commit.

    86k GitHub stars~1.2k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • GitDiagram Repository Overview

    ahmedkhaleel2004/gitdiagram

    Explains the architecture of a public GitHub repository through GitDiagram: how the code is organized, the main components with paths, and a Mermaid diagram.

    18k GitHub stars~427 tokensUpdated today
    DevelopmentAuto-check passed

More from intellectronica/agent-skills

All 21 skills in this repo
  • Beautiful Mermaid

    intellectronica/agent-skills

    Render Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library.

    295 GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check passed
  • Gpt Image 1 5

    intellectronica/agent-skills

    Generate and edit images using OpenAI's GPT Image 1.5 model.

    295 GitHub stars~1.5k tokensUpdated 5 mo ago
    Auto-check passed
  • Nano Banana 2

    intellectronica/agent-skills

    Generate and edit images using Google's Nano Banana 2 (Gemini 3.1 Flash Image Preview) API.

    295 GitHub stars~972 tokensUpdated 5 mo ago
    Auto-check passed
  • Nano Banana Pro

    intellectronica/agent-skills

    Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API.

    295 GitHub stars~1.1k tokensUpdated 5 mo ago
    Auto-check passed
  • Notion API

    intellectronica/agent-skills

    This skill provides comprehensive instructions for interacting with the Notion API via REST calls.

    295 GitHub starsUsed in 1 repo~3.7k tokens
    Auto-check passed
  • Youtube Transcript

    intellectronica/agent-skills

    Extract transcripts from YouTube videos. An agent skill from intellectronica/agent-skills.

    295 GitHub starsUsed in 3 repos~394 tokens
    Auto-check passed

Categories

Questions about Mgrep Code Search

What does Mgrep Code Search do?

Semantic code search using mgrep for efficient codebase exploration. Mgrep Code Search is an agent skill from intellectronica/agent-skills. Semantic code search using mgrep for efficient codebase exploration.

When should I use Mgrep Code Search?

Mgrep Code Search fits situations like: tasks that involve Codebase onboarding.

How do I install Mgrep Code Search in Claude Code?

Run `npx skills add intellectronica/agent-skills --skill mgrep-code-search -a claude-code`. Or copy the skill folder (skills/mgrep-code-search in intellectronica/agent-skills) into .claude/skills/mgrep-code-search in your project. Claude Code loads it when a task matches its description.

How do I install Mgrep Code Search in Codex?

Run `npx skills add intellectronica/agent-skills --skill mgrep-code-search -a codex`. Or copy the skill folder (skills/mgrep-code-search in intellectronica/agent-skills) into .agents/skills/mgrep-code-search in your project. Codex loads it when a task matches its description.

Can I use Mgrep Code Search in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add intellectronica/agent-skills --skill mgrep-code-search -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mgrep-code-search, .gemini/skills/mgrep-code-search, .github/skills/mgrep-code-search and .opencode/skills/mgrep-code-search in your project.

What does Mgrep Code Search need to run?

Going by SKILL.md and its folder, Mgrep Code Search needs the command-line tools its instructions call (bunx). Our summary lists: Node.js.

Does Mgrep Code Search access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Mgrep Code Search safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Mgrep Code Search use?

Mgrep Code Search is published under the CC0-1.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mgrep Code Search use?

About 871 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mgrep Code Search?

Skills that share tags, products or a category with Mgrep Code Search: Codebase Knowledge Graph Q&A (Egonex-AI/Understand-Anything, 86k stars), Understand Explain (Egonex-AI/Understand-Anything, 86k stars), Repomix Codebase Explorer (yamadashy/repomix, 29k stars) and Code Graph Mermaid Diagrams (trailofbits/skills, 7.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mgrep Code Search?

intellectronica (a GitHub user) maintains it in intellectronica/agent-skills, which has 295 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on April 25, 2026.

Source: intellectronica/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.