# Sag

> Search and Grep - powerful code search across repositories and file systems. Use when this capability is needed.

- Skill: `tomevault-io/sag-8` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/sag-8`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/sag-8/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/sag-8

---


# SAG (Search and Grep)

Fast code search using ripgrep.

## Basic Search

```bash
rg "pattern" /path/to/search
```

## Search by File Type

```bash
rg "function" --type ts
rg "class" --type py
```

## Search with Context

```bash
rg "TODO" -C 3
```

## Search and Replace

```bash
rg "old_name" --files-with-matches | xargs sed -i '' 's/old_name/new_name/g'
```

## Useful Flags

- `-i` — case insensitive
- `-w` — whole word match
- `-l` — files only
- `-c` — count matches
- `--hidden` — include hidden files
- `--glob '!node_modules'` — exclude patterns

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/kody-w) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

