grep-and-read

Search files by regex pattern and read matching contents in parallel.

4|Updated Sep 25, 2025
One-click install
npx skills add https://github.com/cowwoc/styler --skill grep-and-read
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grep-and-read
Source: https://github.com/cowwoc/styler/tree/main/.claude/skills/grep-and-read
Command: npx skills add https://github.com/cowwoc/styler --skill grep-and-read

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Exploring a codebase often involves repeatedly searching for a pattern, then individually reading each matching file. This sequential process is slow and token-inefficient, requiring multiple LLM round-trips. This Skill combines these steps into a single, efficient operation.

Core Features & Use Cases

  • Atomic Search & Read: Combines grep and read operations into a single, efficient step, drastically reducing round-trips.
  • Performance Boost: Achieves 50-70% time savings and significant token savings compared to manual sequential reading.
  • Flexible Filtering: Supports regex patterns, file type globs, and path specifications for targeted searches.
  • Contextual Output: Limits output per file (context_lines) and provides clear summaries, even for many matches.
  • Use Case: When you need to understand how a specific API (FormattingRule) is implemented across your Java codebase, use this Skill to find all relevant files and read their contents in one go, giving you a comprehensive overview without tedious manual steps.

Quick Start

To explore how "FormattingRule" is implemented in Java files: Skill: grep-and-read pattern="FormattingRule" path="/workspace/main" glob="*.java" max_files=5

Frequently Asked Questions about grep-and-read

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

FAQPage Schema
How do I search and read multiple files matching a pattern in one operation?

grep-and-read combines pattern search and file reading into a single operation. Specify a regex pattern, optional path, and glob filter—the Skill finds all matching files and returns their contents consolidated, eliminating sequential grep-then-read workflows that waste tokens and round-trips.

Can I use grep-and-read to explore how an API is implemented across my codebase?

Yes. Search for the API name or class across your repository with regex patterns and file type filters. The Skill returns all matching files with context, giving you a complete implementation overview without manually reading each file individually.

What's the best way to find errors or usages of a specific function across multiple files?

Pattern search with file-type filtering pinpoints all occurrences instantly. Set max_files to control output scale, use context_lines to see surrounding code, and case_sensitive matching for precise queries—all results return in a single consolidated output.

How much faster is searching and reading files together versus doing it manually?

Combining grep and read achieves 50-70% time savings and significant token reduction compared to sequential manual searching and reading. Parallel execution of both operations eliminates multiple LLM round-trips on large codebases.

Can I limit output when searching files that have many matches?

Yes. Use max_files to cap the number of matching files returned and context_lines to truncate output per file. These controls keep responses focused and manageable even across repositories with thousands of matches.

Does this work with regex patterns and glob filters for precise file targeting?

Yes. grep-and-read supports full regex pattern input, optional path specification, and glob filters like *.java or *.py for targeting specific file types. Combine these with case_sensitive controls for exact or flexible matching.