grep_files

Search directory trees for regex matches and return file paths, line numbers, and content.

8|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/OpenAuthority/clawthority --skill grep-files
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grep_files
Source: https://github.com/OpenAuthority/clawthority/tree/main/examples/skills/grep_files
Command: npx skills add https://github.com/OpenAuthority/clawthority --skill grep-files

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Searches for a regex pattern across files in a directory tree and returns an array of matches with file paths, 1-based line numbers, and matched line content.

Core Features & Use Cases

  • Recursively scans a directory to find lines that match a given regex.
  • Optional glob filtering to restrict which files are examined.
  • Returns a structured list containing absolute file paths, line numbers, and the matching line content.
  • Skips binary files and decodes only UTF-8 text for safety and compatibility.

Quick Start

Run grep_files with a pattern to recursively search a directory and return matches with file paths, line numbers, and the matched content.

Frequently Asked Questions about grep_files

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

FAQPage Schema
How do I search for a regex pattern across multiple files in a directory tree?

To search for a regex pattern across files, you recursively scan a directory to return an array of matches containing absolute file paths, 1-based line numbers, and the matching line content. It decodes files as UTF-8 text for safe compatibility.

Can I use glob filtering to restrict which files are examined during a directory search?

Yes, you can apply optional glob filtering to restrict which files are examined during a directory search. This limits the searched files to a specific subset while locating matching line content.

What is the best way to find specific text or code patterns across a codebase?

The best way to find text or code patterns across a codebase is to recursively traverse the directory tree and match lines against a supplied regular expression. This returns a structured list of matches with absolute paths and line numbers without modifying files.

Does searching files recursively handle binary files or non-UTF-8 text safely?

Searching files recursively handles binary files safely by skipping them entirely. It decodes only UTF-8 text files, ensuring compatibility and preventing errors when traversing mixed-format directory trees.

What limitations should I expect when matching regex patterns across project files?

A key limitation when matching regex patterns across project files is that it only reads UTF-8 text and skips binary files. It returns line-level matches without modifying files, so it does not support in-place text replacement.