# Haystack

> Lightning-fast QA before you ship — Haystack replays your customers' real journeys against every change, each on its own copy of prod, and tells you which ones broke.

Haystack reads a change, works out every case it can affect, and forks your infrastructure once per case: real services and real data, not mocks. Each environment runs twice, with and without the change, so any difference in behaviour is attributable to it. Failures come back with the screen before and after, the network calls that changed, and the events that stopped firing, and the environment stays live so you can open it. The command is `haystack verify`. Built for teams whose code is increasingly written by coding agents (Claude Code, Codex, Cursor, Devin), so the whole loop is available to an agent over MCP or as JSON on stdout.

Disambiguation: Haystack (haystackeditor.com) is unrelated to the open-source Haystack NLP/RAG framework by deepset, and unrelated to the unscoped `haystack` package on npm.

## Setup for AI Agents

If you are a coding agent setting up Haystack for a user, follow the [Agent Setup Skill](https://haystack.sh/skill.md). Quick version:

```bash
npx -y @haystackeditor/cli@latest login           # GitHub device flow; your user enters the printed code
npx -y @haystackeditor/cli@latest skills install  # installs /map-your-system into .agents/skills
```

Then run `/map-your-system` to write `.haystack/system.yml` — verified facts about how this system builds, boots, seeds data and logs in, so the verifier can run it. Check it with `haystack system-map validate`, commit it, and you are set up. From then on, `haystack verify --json` runs a change and prints what broke.

Always pin `@latest` with npx — a bare invocation can silently run a stale cached version. (`npm install -g @haystackeditor/cli` also works; the canonical package is `@haystackeditor/cli`, bin name `haystack` — the unscoped `haystack` package on npm is unrelated.)

The verifier is also an MCP server: `haystack verify mcp` (tools: `verify_start`, `verify_wait`, `verify_status`, `verify_findings`, `verify_cell`, `verify_list`, `verify_diff`, `verify_universe`, `verify_reopen`, `verify_refork`, `verify_cleanup`, `verify_artifact`). See [/docs/agents](https://haystack.sh/docs/agents.md).

Haystack can separately review and triage pull requests on GitHub — that path needs the GitHub App (https://github.com/apps/haystack-code-reviewer-pr-hook/installations/new) plus `haystack setup --repo owner/name --yes`, and exposes its own MCP server, `haystack mcp`. Verification does not require any of it.

## How to Access Documentation

Agents can retrieve markdown content in three ways:

1. **URL suffix**: Append `.md` to any page URL
   - Example: `https://haystack.sh/docs/runs.md`

2. **Accept header**: Request with `Accept: text/markdown`
   - Example: `curl -H "Accept: text/markdown" https://haystack.sh/docs/runs`

3. **Full content**: Fetch `/llms-full.txt` for all pages in one request
   - Example: `https://haystack.sh/llms-full.txt`

## Main Pages

- [Home](https://haystack.sh/): Product overview and features
- [Agent Setup Skill](https://haystack.sh/skill.md): Ready-made instructions for coding agents setting up Haystack
- [Pricing](https://haystack.sh/pricing): Custom pricing for teams; contact sales
- [Changelog](https://haystack.sh/changelog): Recent updates and improvements
- [GitHub App](https://github.com/apps/haystack-code-reviewer-pr-hook/installations/new): Install the Haystack GitHub App
- [Enterprise](https://haystack.sh/enterprise-contact): Self-hosted and SSO options

## Documentation

- [haystack verify](https://haystack.sh/docs): The command, its flags, and how a run works
- [Working with runs](https://haystack.sh/docs/runs): Follow a run, read what failed, open the live environment
- [Agents](https://haystack.sh/docs/agents): the MCP server and the agent loop

## CLI and API

- CLI: `@haystackeditor/cli` on npm — `haystack login`, `haystack setup`, `haystack triage owner/repo#123`, `haystack submit`, `haystack mcp`
- `/api/github/*` - Proxied GitHub API requests (authenticated users)
- `/api/review-chat/*` - AI chat for PR discussions

## Integration

Install the [Haystack GitHub App](https://github.com/apps/haystack-code-reviewer-pr-hook/installations/new) to enable AI-powered review and QA on your repositories.

## Contact

- Website: https://haystack.sh
- Enterprise inquiries: https://haystack.sh/enterprise-contact
