selective-grep-filtering

selective-grep-filtering is a skill for Claude Code from alivirgo/Major-AI-Skills. It costs 27 tokens per session (1,106 once invoked), scanned A, original, MIT.

A focused repository-search method that limits text searches to relevant folders and file types and matches exact text. A repository is the project folder containing the code and its history.

In plain words
What is it for?
It helps locate production methods or constants quickly by using directory scopes, file globs, and literal matching.
Why use it?
It reduces false matches from tests, generated files, documentation, and minified bundles, leaving fewer results to inspect.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code; mentions Codex.

Part of the mas-efficiency-pack plugin — 5 skills shipped together

Good fit It helps locate production methods or constants quickly by using directory scopes, file globs, and literal matching.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alivirgo/major-ai-skills/selective-grep-filtering
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alivirgo/Major-AI-Skills --skill selective-grep-filtering
Clone the repo
git clone --depth 1 https://github.com/alivirgo/Major-AI-Skills

Made for: Claude Code.

Or install mas-efficiency-pack, the plugin that ships this one along with the rest of its 5 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for selective-grep-filtering

README.md
[![agentmods](https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/selective-grep-filtering/github.svg)](https://agentmods.dev/skills/alivirgo/major-ai-skills/selective-grep-filtering)
Your own site
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/selective-grep-filtering"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/selective-grep-filtering/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for selective-grep-filtering

Your own site · 80×15
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/selective-grep-filtering"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/selective-grep-filtering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,106 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.01106
Opus 5.5 $0.00011 $0.00442
Sonnet 5.5 $0.00005 $0.00221
Haiku 4.5 $0.00003 $0.00111

Measured 1mo ago against content hash 58e21da7591e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

selective-grep-filtering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/mas-efficiency-pack/skills/selective-grep-filtering/SKILL.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Surgical Grep Filtering & Glob Targeting Protocol

Overview

When searching a repository for a specific method or constant ("handlePaymentCallback"), naive agents execute broad, unconstrained searches across the entire workspace directory.

Unfiltered searches return hundreds of false-positive matches:

  1. Test Snapshots & Fixtures: Matches in 50 Jest/Vitest snapshots that aren't part of production logic.
  2. Minified Bundles & Source Maps: Matches in .map or dist/ files that dump unreadable minified code into context.
  3. Markdown Documentation: Matches in changelogs, READMEs, and tutorials.

The Surgical Grep Filtering Protocol constrains the search space using strict file extension globs, target directory scopes, and exact literal matching (IsRegex: false), returning strictly the 1 to 3 production source matches.


Unconstrained Search vs. Surgical Glob Filtering

┌─────────────────────────────────────────────────────────────┐
│                 Search Precision Comparison                 │
│                                                             │
│  Unconstrained Workspace Search (140 Matches / 6,200 Toks): │
│  • 80 matches in `tests/__snapshots__/`                     │
│  • 45 matches in `dist/bundle.js`                           │
│  • 12 matches in `docs/architecture.md`                     │
│  • 3 matches in `src/services/`                             │
│  ↳ 6,200 tokens billed, agent gets lost in snapshots        │
│                                                             │
│  Surgical Glob Filtering (3 Matches / 85 Tokens - 98.6% Cut):│
│  • Includes: `["src/**/*.ts", "!**/*.spec.ts"]`             │
│  • Match: `src/services/billing.ts:42`                      │
│  • Match: `src/routes/payment.ts:18`                        │
│  ↳ 85 clean tokens, 100% production source hits             │
└─────────────────────────────────────────────────────────────┘

┌───────────────────────────────────────────────────────────────────────────┐
│ 1. TARGET DIRECTORY ONLY: Confine `SearchPath` to `src/` or `pkg/`        │
│ 2. EXCLUDE TESTS & SPECS: Add `!**/*.test.ts`, `!**/*.spec.py`            │
│ 3. LITERAL MATCHING BY DEFAULT: Set `IsRegex: false` (Prevents regex bugs)│
└───────────────────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -19 tokens per session 58e21da7591e
  2. 1mo ago First seen · 114 lines · 46 tokens per session scan A 387c754265bb

Subscribe to this mod's changes

selective-grep-filtering is a skill published in the GitHub repository alivirgo/Major-AI-Skills (2 stars, last pushed today), licensed MIT. It adds 27 tokens to every session and 1,106 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

snip

You are an expert at writing declarative YAML filters for snip, a CLI proxy that reduces LLM token consumption by filtering shell output.

edouard-claude/snip · 0 tokens

azure-pipelines

Expert knowledge for Azure Pipelines development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when configuring YAML pipelines, agents, service connections, Key Vault secrets, or…

MicrosoftDocs/Agent-Skills · 109 tokens

azure-kubernetes-service

Expert knowledge for Azure Kubernetes Service (AKS) development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when securing AKS with Entra/RBAC, configuring Fleet, GPUs or KEDA…

MicrosoftDocs/Agent-Skills · 137 tokens

azure-virtual-machines

Expert knowledge for Azure Virtual Machines development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when choosing VM/disk/GPU SKUs, configuring NVMe/Ultra disks, using Trusted…

MicrosoftDocs/Agent-Skills · 139 tokens

azure-arc

Expert knowledge for Azure Arc development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using Arc-enabled Kubernetes, Arc SQL MI, resource bridge, Arc Agentic Retrieval, or…

MicrosoftDocs/Agent-Skills · 115 tokens

azure-blob-storage

Expert knowledge for Azure Blob Storage development including troubleshooting, best practices, decision making, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using tiers/archival, NFS/SFTP/BlobFuse mounts, immutability/WORM, lifecycle policies, or Storage Mover, and…

MicrosoftDocs/Agent-Skills · 115 tokens