# Catch Bugs Before Merge

Use Haystack to find real bugs in pull requests automatically, before they ship.

## The Problem

A bug caught in review costs minutes; the same bug in production costs hours of debugging, a hotfix cycle, and customer trust. Human reviewers skim large diffs, and most AI reviewers flood PRs with nitpicks that train everyone to ignore them.

## How Haystack Solves It

- **Findings with evidence**: Haystack's analysis flags concrete problems — logic errors, broken invariants, missed edge cases, unintended side effects — each with the reasoning and code paths behind it.
- **Adversarially filtered**: findings pass a materiality filter, so a flagged issue is worth reading. Silence means analysis found nothing real, not that nothing ran.
- **Safe-to-merge verdict**: each PR gets an explicit verdict, so "no findings" is a statement, not an absence.

## Setup

```bash
npx -y @haystackeditor/cli@latest setup --repo owner/name --yes
```

Check any PR's findings from the terminal or CI:

```bash
npx -y @haystackeditor/cli@latest triage owner/name#123
```

## Related

- [Review AI-generated code](/use-cases/review-ai-generated-code)
- [Merge queue automation](/use-cases/merge-queue-automation)
