> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squasher.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Auto-fix PRs

> Generate reviewable pull requests from error context and connected repository settings.

Auto-fix creates a pull request for a qualifying error group after a completed diagnosis selects the `remediate` disposition. Diagnosis and remediation share one cycle key, but remain distinct stages: diagnosis is read-only and short-lived; remediation may prepare code.

## Typical flow

1. Squasher receives an error and produces an evidence-backed diagnosis.
2. The diagnosis either requests remediation, asks for a human, or records that no safe fix exists.
3. For `remediate`, project policy and repository settings are checked deterministically.
4. Squasher prepares a candidate patch, verifies it, and opens a pull request for review.
5. The PR result is sent to configured Slack or webhook review destinations.

## Recommended setup

* Connect [GitHub](/integrations/github).
* Add a review channel with [Slack](/integrations/slack) if your team wants notifications.
* Pair with [Linear](/integrations/linear) if you want issue tracking alongside the PR.

## Notes

* Auto-fix is review-oriented. Your team decides whether and when to merge.
* Better error context generally leads to better candidate fixes.
* Squasher records terminal cycles, safe refusals, PR creation, tests, verification, and result delivery against the prompt and model version that produced them.

## Agent handoff

Use this prompt when a coding agent is deciding whether to start a fix run:

```text theme={null}
Inspect Squasher error group <error_group_id> in project <project_id>. Summarize the triage, related traces, suspect commits, and repository connection. Do not start a hosted fix run until a human confirms.
```

Agents can list and inspect run history with the [Agent Runs API](/api-reference/agent-runs), `squasher agent-runs ...`, or MCP Code Mode after `search("agentRuns")`. Creating a fix run is a write action and should be confirmed by the user.
