# AI use cases for Jevgrep (dzhng/jevgrep)

Repo: [dzhng/jevgrep](https://github.com/dzhng/jevgrep) | Use cases: 3 | Page: https://dedupedai.com/use-cases/dzhng-jevgrep/

Jevgrep is a TypeScript CLI (`jg`) that answers repository questions by returning relevant files, reading leads, and verbatim source excerpts for coding agents, using Jev to judge relevance.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Find the code behind a behavior before an agent edits it: https://dedupedai.com/use-cases/dzhng-jevgrep/trace-behavior-before-agent-edits/
- Locate the tests that cover a specific behavior: https://dedupedai.com/use-cases/dzhng-jevgrep/find-tests-covering-a-behavior/
- Check which files a search will send before running it: https://dedupedai.com/use-cases/dzhng-jevgrep/preview-search-scope-before-sending/

## How to find the code behind a behavior before an agent edits it with Jevgrep

Repo: [dzhng/jevgrep](https://github.com/dzhng/jevgrep) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Ask a repository question and get files, leads, and source excerpts to start an unfamiliar change.

**Who it is for:** A developer new to a codebase who has been asked to change a behavior but does not know which files implement it.

**The problem:** Coding agents spend part of every unfamiliar task finding the right files, and the developer lacks a starting point.

**The outcome:** A stdout summary with a compact file list, selected source with line references, and declaration and call locations to guide the change.

### Steps

1. Run `npm install -g @dzhng/jevgrep` to install the CLI.
2. Run `jg auth` and choose your provider and key.
3. Run `jg skill` from the project where your agent works.
4. Run `jg "How are telemetry events recorded and sent?" ./my-project` with your own question and path.

### Prompt to paste into your agent

```text
Use the jevgrep skill in this repository to run `jg` with the question "<question about the behavior>" against <target path>. Report the files, line references, and source excerpts it returns, and confirm each cited file exists before you propose any edit.
```

### Caveat

Jevgrep returns evidence for the agent to judge, not a generated answer or a guarantee that every relevant file was found.

Risk, credentials: Eligible source from the search root is sent to the provider you selected, and the credential filter is best-effort, so choose a root you intend to share.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/dzhng-jevgrep/trace-behavior-before-agent-edits/

## How to locate the tests that cover a specific behavior with Jevgrep

Repo: [dzhng/jevgrep](https://github.com/dzhng/jevgrep) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Ask which tests exercise a behavior so an agent can run or extend the right suite.

**Who it is for:** A maintainer preparing a fix who needs to know which tests already cover a behavior such as retries on timeout.

**The problem:** Test coverage for one behavior is spread across folders, and grep on a guessed name often misses it.

**The outcome:** A list of relevant test files and excerpts that show which tests cover the behavior, ready for the agent to run or extend.

### Steps

1. Run `npm install -g @dzhng/jevgrep` to install the CLI.
2. Run `jg auth` to save your provider key.
3. Run `jg "Which tests cover retry behavior when a request times out?" .` in the repository root.
4. Read the returned file list and excerpts, then open the cited test files to confirm they match.

### Prompt to paste into your agent

```text
In the repository at <target path>, run `jg` with the question "Which tests cover <behavior>?" and list each returned test file with its line references. Verify that each listed file exists and contains the test before you run the suite.
```

### Caveat

The README describes the output as evidence, so a test that looks relevant still needs to be opened and read before the agent relies on it.

Risk, credentials: Test and source files in the searched root are sent to the selected provider, so exclude sensitive paths with --exclude when needed.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/dzhng-jevgrep/find-tests-covering-a-behavior/

## How to check which files a search will send before running it with Jevgrep

Repo: [dzhng/jevgrep](https://github.com/dzhng/jevgrep) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Count the files under a root and exclude paths so only intended source reaches the provider.

**Who it is for:** A team lead or security-minded developer who must confirm what source leaves the machine before a search runs.

**The problem:** Searches send eligible source to Jev, and automatic filtering is best-effort, so the scope needs checking first.

**The outcome:** A per-directory file count and a narrower search that skips generated or test paths, reducing what is sent to the provider.

### Steps

1. Run `jg files [root]` on the directory you plan to search, using your own path in place of `[root]`.
2. Review the counts grouped by top-level directory.
3. Add `--exclude` with a gitignore pattern relative to the root, for example `--exclude 'src/generated/'`.
4. Run `jg "<your question>" <root>` with the same exclusions applied. (inferred, check the README)

### Prompt to paste into your agent

```text
For the repository at <target path>, run `jg files <target path>` and summarize the file counts by top-level directory. Then propose `--exclude` patterns for generated or sensitive paths and confirm the counts drop before any search is run.
```

### Caveat

`jg files` needs no provider key or network request, but it only counts files and does not prove that no sensitive content remains in the searched paths.

Risk, credentials: The README says the sensitive-content filter is best-effort and not redaction, so review the file list yourself before searching.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/dzhng-jevgrep/preview-search-scope-before-sending/
