Find and read multiple files in one operation (50-70% faster for exploration)
Finds and reads multiple files matching a pattern in one operation to reduce LLM round-trips.
/plugin marketplace add cowwoc/claude-code-dog/plugin install dog@claude-code-dogThis skill is limited to using the following tools:
Purpose: Find files matching a pattern and read them in a single atomic operation, reducing LLM round-trips from 1+N to 2-3.
Performance: 50-70% faster for reading 3+ files during codebase exploration
[LLM Round 1] Search for pattern
-> Grep: Find files containing "FormattingRule"
-> Returns: file1.java, file2.java, file3.java
[LLM Round 2] Read first file
-> Read: file1.java
[LLM Round 3] Read second file
-> Read: file2.java
[LLM Round 4] Read third file
-> Read: file3.java
[LLM Round 5] Analyze and report
-> Summarize findings from all files
Total: 10s + (5s * 3) = 25s, 5 LLM round-trips
[LLM Round 1] Execute batch-read
-> Bash: batch-read.sh "FormattingRule" --max-files 3
-> [Script finds files + reads all + returns content]
[LLM Round 2] Analyze and report
-> Parse combined output
-> Summarize findings
Total: 8-12s, 2-3 LLM round-trips
Savings: 50-70% faster for N>=3 files
# Find and read files containing "FormattingRule"
~/.claude/scripts/batch-read.sh "FormattingRule"
# Only search Java files
~/.claude/scripts/batch-read.sh "FormattingRule" --type java
# Read at most 3 files
~/.claude/scripts/batch-read.sh "FormattingRule" --max-files 3
# Show only first 50 lines of each file
~/.claude/scripts/batch-read.sh "FormattingRule" --context-lines 50
# Read complete files (no truncation)
~/.claude/scripts/batch-read.sh "FormattingRule" --context-lines 0
# Search Java files, read 5 files, show 100 lines each
~/.claude/scripts/batch-read.sh "FormattingRule" \
--type java \
--max-files 5 \
--context-lines 100
Script returns two outputs:
{
"status": "success",
"message": "Successfully read 3 file(s) matching pattern",
"duration_seconds": 2,
"pattern": "FormattingRule",
"files_found": 3,
"files_read": 3,
"output_file": "/tmp/batch-read-output-12345.txt",
"working_directory": "/path/to/project",
"timestamp": "2025-11-08T00:45:00-05:00"
}
===============================================================
FILE: src/main/java/FormattingRule.java
===============================================================
1 package io.github.cowwoc.styler;
2
3 public interface FormattingRule {
4 void apply(StyleContext context);
5 }
[... file content ...]
---------------------------------------------------------------
===============================================================
FILE: src/test/java/FormattingRuleTest.java
===============================================================
1 package io.github.cowwoc.styler;
2
3 import org.testng.annotations.Test;
4
5 public class FormattingRuleTest {
6 @Test
7 public void testRule() {
8 // Test implementation
9 }
10 }
[... file content ...]
---------------------------------------------------------------
# Find all files implementing a specific feature
batch-read.sh "ValidationEngine" --type java --max-files 5
# Find all test files for a component
batch-read.sh "FormatterTest" --type java
# See how an API is used across the codebase
batch-read.sh "StyleContext.apply" --type java
# Review all configuration files
batch-read.sh "application.properties" --max-files 10
# Collect all README files
batch-read.sh "README" --type md --max-files 20
Script uses grep -l (list files only) to avoid duplicate results from multiple matches in same file.
When using --context-lines, script includes line numbers to help locate code:
42 public void validate() {
43 // Implementation
44 }
When files are truncated, script shows how much was omitted:
[... truncated: showing 100 of 523 lines ...]
Script warns if output is very large (>100KB):
Warning: Output is large (125000 bytes)
Consider using --context-lines to limit output
| Files | Traditional | Optimized | Savings |
|---|---|---|---|
| 1 file | 15s | 10s | 33% |
| 2 files | 20s | 10s | 50% |
| 3 files | 25s | 11s | 56% |
| 5 files | 35s | 12s | 66% |
| 10 files | 60s | 15s | 75% |
Expected Usage: 5-10 times per day
Time Savings per Use: ~15-30 seconds (average 3-5 files)
Daily Impact: 75-300 seconds (1.25-5 minutes)
Monthly Impact: 30-150 minutes (0.5-2.5 hours)
--context-lines 0--type filter uses file extension only--type java matches *.java filesWrong: Use batch-read to find and read one known file
batch-read.sh "MyClass.java"
Correct: Use Read tool directly
Read: /path/to/project/src/main/java/MyClass.java
Wrong: Read random files that happen to match pattern
batch-read.sh "test" # Too generic, matches everything
Correct: Use specific pattern or file type
batch-read.sh "ValidationTest" --type java
Wrong: Read 10 large files for detailed analysis Correct: Read files one-by-one for thorough review
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.