# Grep

> Search file contents using regex patterns

- Skill: `tashfeenahmed/grep` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tashfeenahmed/grep`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tashfeenahmed/grep/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tashfeenahmed (https://skillmd.com/u/tashfeenahmed)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/tashfeenahmed/grep

---


# Grep Skill

Search file contents using regex patterns. Uses ripgrep (`rg`) when available for speed, falls back to pure JavaScript.

## When to Use

Use the grep skill for:

- **Finding code references**: Search for function calls, variable usage
- **Finding strings**: Search for error messages, log entries
- **Regex searching**: Complex pattern matching across files
- **Scoped searches**: Search within specific file types

## Input Format

```json
{
  "pattern": "function\\s+\\w+",
  "path": "src",
  "glob": "*.ts",
  "context": 2,
  "max_results": 20
}
```

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `pattern` | string | Yes | - | Regex pattern to search for |
| `path` | string | No | `.` | Directory to search in |
| `glob` | string | No | - | Glob pattern to filter files |
| `context` | number | No | 0 | Context lines around matches |
| `max_results` | number | No | 50 | Maximum matches returned |

## Output Format

```
src/index.ts:5: export function main() {
src/utils.ts:12: function helper(x: number) {
```

## Limitations

- Maximum 50 results by default (configurable)
- Skips binary files
- Respects .gitignore rules

