AI Fix · Auto PR
Claude Code drives the fix — PR, Preview, and Production merge. Tokens run on your Claude Code subscription.
Table of Contents
AI Fix turns one issue into a working PR. Click a button and Claude Code reads the issue's metadata — screenshots, console logs, network logs, React tree, DOM snapshot — and produces a branch, a diff, and a PR. Preview deploys flow back to the issue. No extra prompt engineering required.
BYO Claude
AI Fix runs on BYO Claude (Bring Your Own Claude). Token usage is billed to your Claude Code subscription or Anthropic API key. QA Note never charges for tokens. What QA Note provides is the context pipeline (issue metadata → MCP → Claude Code) and the PR / preview tracking infrastructure.
| Item | Who pays |
|---|---|
| AI token cost | Claude Code subscriber |
| Context capture and delivery | QA Note |
| PR creation / merge rights | GitHub App permissions (granted by user) |
| Preview tracking | Vercel integration (linked by user) |
Quotas follow Anthropic's limits, not QA Note's plan. Org-level Claude Code seats are reused as-is.
Pipeline at a Glance
Four stages: Issue → PR → Preview → Production merge.
| Stage | Actor | Output | Time box |
|---|---|---|---|
| ① Issue | Reporter (Chrome Ext / Widget) | Screenshot + metadata + MCP context | Instant |
| ② PR | Claude Code | Branch + diff + PR #N | ≤ 30 min |
| ③ Preview | Vercel | Preview URL + check results | ≤ 5 min |
| ④ Merge | Human review → merge | main updated + issue auto-closed | Human time |
Each stage's output (branch name, PR number, preview URL, merge SHA) is appended to the issue's "AI Fix run log". The same data is available via the ai_fix field on get_issue MCP responses.
PLAN / IMPLEMENT
Claude Code does not write code in one shot. PLAN emits the proposed changes as text. IMPLEMENT then turns the plan into a real diff. The split lets a human stop after PLAN.
| Stage | Input | Output | Human input |
|---|---|---|---|
| PLAN | Issue metadata + codebase context | Files to change + change summary + size estimate | "Plan only" stops here |
| IMPLEMENT | PLAN output + user approval | Branch + diff + commit + PR | "Plan + Implement" runs through |
PLAN output is auto-attached as an issue comment so the decision trail survives the merge.
30-minute Timeout
A single AI Fix run is capped at 30 minutes. After 30 minutes the Claude Code session stops and any partial work is wrapped into a PR. Timeouts are treated as a normal flow, not an error — the issue gets a "Timed out · partial result" marker.
A timed-out PR reviews like any other. If more work is needed, trigger AI Fix again on the same issue (it opens a fresh branch).
3-Button Matrix
Three buttons live on the issue page.
| Button | What Claude Code does | Token cost | Recovery |
|---|---|---|---|
| Plan only | Writes the change plan as text | Low (proportional to plan size) | Read the plan, implement by hand |
| Plan + Implement | PLAN → branch → diff → commit → PR | Medium to high (depends on diff size) | Review or revert the PR |
| Custom prompt | Runs with your custom prompt | Depends on prompt | Same revert path once a PR exists |
Custom prompt keeps the auto-injected issue context but lets you append free-text instructions. Examples: "include tests too", "stick to existing design tokens".
Vercel Prerequisite
To track Preview deployments, the project must have the Vercel integration active. Without it, the PR is still created but no preview URL is attached to the issue.
Path: /settings/projects/[projectId]/integrations/vercel
Once linked, every PR triggers a Vercel preview build. The result (success/fail, build URL, check URL) hits QA Note via webhook and is appended to the issue automatically.
Preview → Production Tracking
AI Fix tracks past the merge — production deployment is part of the pipeline.
- PR merges to
main - Vercel kicks off the production build (
vercel build && vercel deploy --prod) - Result (success/fail, deploy URL, SHA) is attached to the issue
- On success, the issue can auto-transition to
resolved(optional) - On failure, the issue stays open and a notification fires
The auto-transition setting lives at /settings/projects/[projectId]/automation.
Code Example
Click "AI Fix · Plan + Implement" on the issue page, or — if MCP is connected — trigger it from one line.
# Run from Claude Code with the issue permalink
claude-code "Fix https://qanote.app/i/abc-42"
Under the hood, Claude Code calls the resolve_by_url MCP tool to load the issue, then opens a branch and PR via the GitHub App.
Troubleshooting
Claude Code is unresponsive
- Check Anthropic-side token limits first. The Claude Code console shows usage.
- If the context is too large (5 screenshots + 500KB DOM + 50 network entries), some metadata gets truncated. The issue shows a "context truncated" marker.
PR creation fails
- The GitHub App permission has expired or repo access was revoked. Reconnect from the project's
/settings/ai-fixpage. - If a previous branch from the same issue conflicts, new runs append
-2,-3automatically.
Timeouts
- The partial-result PR can be reviewed as-is. Need more work? Trigger AI Fix again on the same issue.
- Repeated timeouts mean the change is too big. Run PLAN only to scope it down, then split the work into smaller PRs by hand.