fs-grep

Search text files for regular expression patterns with context lines.

10|Updated Jul 22, 2025
One-click install
npx skills add https://github.com/bdambrosio/Cognitive_workbench --skill fs-grep
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fs-grep
Source: https://github.com/bdambrosio/Cognitive_workbench/tree/main/src/world-tools/fs/fs-grep
Command: npx skills add https://github.com/bdambrosio/Cognitive_workbench --skill fs-grep

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you quickly find specific text patterns within files located in your project's filesystem, saving you the time of manually searching through code or documentation.

Core Features & Use Cases

  • Pattern Searching: Utilizes regular expressions to find text matching a defined pattern.
  • Contextual Snippets: Returns snippets of text around the matches, including specified context lines.
  • Recursive Search: Can search through subdirectories.
  • Use Case: Find all instances of "TODO" comments across your entire codebase, or locate specific error messages within log files.

Quick Start

Search for the pattern "error" in all files within the "logs" directory, showing 2 lines of context around each match.

Frequently Asked Questions about fs-grep

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 project directory?

You can search files for regex patterns by specifying a directory and a regular expression. The tool recursively scans subdirectories and returns snippets of matching lines to help you locate the text quickly.

Can I display context lines around matching text when searching through code?

Yes, you can display context lines around matching text when searching code. The tool allows you to specify optional context lines to show before and after each match for better readability.

What is the best way to find specific error messages within log files?

The best way to find specific error messages within log files is to use regex pattern matching against the directory. You can limit the number of results returned and use case-insensitivity to catch varied error formats.

Does recursive file searching support case-insensitive pattern matching?

Yes, recursive file searching supports case-insensitive pattern matching. You can enable this option to find text variations across all files and subdirectories without manually handling letter casing in your regex.

How do I locate all TODO comments across my entire codebase?

To locate all TODO comments across your codebase, search the root directory using the text "TODO" as your regex pattern. The recursive search will scan all subdirectories and return snippets of the matching lines.

Are there limitations when searching large numbers of files for text patterns?

When searching large numbers of files, performance limitations can arise, but you can manage this by limiting the number of results returned. This prevents excessive output and keeps the search focused on the most relevant matches.