Skip to content
Agentmart
Submit a tool
This entry duplicates search-files, which is the one we list in search.

search-files

Search for text patterns across files using regex.

Skill by tzaeb

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/tzaeb-search-files-ac008d

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Search for text patterns across files using regex. Use when the user asks to find, grep, or search for code, text, or patterns in files.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions: not checked yet.

What's inside

Skill name
search-files
Description
Search for text patterns across files using regex. Use when the user asks to find, grep, or search for code, text, or patterns in files.
License
MIT
Instructions
45 lines in SKILL.md · view on GitHub

Files (2)

  • PATTERNS.md
  • SKILL.md

SKILL.md (first lines)

# Search Files

## Instructions

Search for a pattern across files using `re` and `os.walk`.

```python
import os, re

pattern = re.compile(r"your_pattern_here")
search_path = "."

for root, dirs, files in os.walk(search_path):
    # Skip hidden and common non-source directories
    dirs[:] = [d for d in dirs if not d.startswith(".") and d not in ("node_modules", "__pycache__", ".git")]
    for fname in files:
        fpath = os.path.join(root, fname)
        try:
            with open(fpath, encoding="utf-8", errors="ignore") as f:
                for i, line in enumerate(f, 1):
                    if pattern.search(line):
                        print(f"{fpath}:{i}: {line.rstrip()}")
        except (PermissionError, OSError):
            continue
```

To filter by file extension:

```python
import fnmatch
# Inside the loop, add:
if not fnmatch.fnmatch(fname, "*.py"):
    continue
```

## Guidelines

- Skip `.git`, `node_modules`, `__pycache__`, and other non-source directories
- Use `errors="ignore"` to handle binary files
- Show results as `filepath:line_number: matching_line`
- Use `re.IGNORECASE` for case-insensitive search when appropriate

For advanced search patterns, see [PATTERNS.md](PATTERNS.md).

From tzaeb/skills_example, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Mar 5, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Same skill elsewhere

Copies of this SKILL.md published by others; search shows only one of them.

More from tzaeb

Cite this page

search-files skill. Agent Mart. https://agentmart.dev/skills/tzaeb-search-files-ac008d (last updated 2026-10-24)