Decide when to use grep/rg (literal, fast, exhaustive) vs rlmgrep (semantic, slower, cross-file reasoning), especially for conceptual questions, cross-file flows, and mixed-format corpora (PDFs/images/audio). Covers scoping strategies, regex-in-natural-language best-effort behavior, and key flags (`--files-from-stdin`, `--files-from-rg`, `--answer`, `-g`, `--type`, `-y`) that make rlmgrep reliable and cost-aware.
Use this skill to pick the right search tool and craft effective rlmgrep usage. It explains when to stick to grep/rg for literal matches and when to use rlmgrep for semantic, multi-file, or non-text searches.
Use `grep`/`rg` when:
Use `rlmgrep` when:
Examples:
```sh
rlmgrep -C 2 "where is api key parsed" .
rlmgrep "retry logic for 429" --type py .
rlmgrep "find config defaults" -g "**/*.toml" -g "**/*.py" .
rg -l "token" . | rlmgrep --files-from-stdin --answer "what does this token control?"
```
Notes:
- `-y/--yes` only skips the confirmation prompt; it does not bypass the 1000-file abort cap.
- To run on larger repos, pre-filter with `rg -l ...`, or use `-g/--type` to narrow the file set.
Example (best-effort regex semantics + extra context):
```sh
rlmgrep "Find JavaScript files with functions matching `function\\s+use[A-Z]\\w+` and mention hooks." .
```
If you already know a literal anchor (e.g., a class name, constant, or table), use `rg` to find the files quickly, then pipe those file paths into rlmgrep for semantic reasoning.
Examples:
```sh
rg -l "auth" . | rlmgrep --files-from-stdin --answer "where is auth handled?"
rg -l "retry" . | rlmgrep --files-from-stdin --answer "how do retries work?"
rg -l "token" --type py . | rlmgrep --files-from-stdin --answer "where are tokens parsed?"
```
If you can express the search as a literal token or regex, start with `rg` for speed and exhaustiveness. If that fails, or the question is semantic, switch to `rlmgrep` with a short natural-language prompt.
Use `rg` or `grep` if you need guaranteed literal matches, very large-scale scanning, or exact regex behavior. rlmgrep does not promise literal containment.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/rlmgrep-usage/raw