# Examples

## Code Review

Find all error handling patterns:

```bash
sgrep "error handling and recovery" src/
```

## Refactoring

Find functions that do similar things:

```bash
sgrep "convert string to number" src/ --threshold 0.5
```

## Documentation Search

```bash
sgrep "setup instructions" README.md QUICKSTART.md docs/
```

## Cross-File Discovery

Find related code across your entire project:

```bash
sgrep "recursively walk subdirectories" src/
# Finds: /// Recursive directory search
```

## Zero-Shot Classification

Classify text chunks against labels:

```bash
sgrep -e "bug,feature,refactor,docs" CHANGELOG.md
```

## Pipeline Integration

```bash
# Find similar files and open in editor
sgrep --json "authentication middleware" src/ | jq -r '.[0].path' | xargs $EDITOR

# Count semantic matches above threshold
sgrep --json "memory leak" src/ | jq length
```