Skip to content

Local-first PR feedback

Run PR feedback on every commit. Open clean PRs only.

GitPreflight reviews your staged diff during git commit, routes findings directly into your coding agent, and keeps the full fix loop local before any PR exists.

No copy/paste. No manual prompting. No waiting for PR comments. Agent-to-agent feedback runs in the same loop until result is PASS.

Quick start
npm i -g gitpreflight
gitpreflight setup
gitpreflight version

# then work as usual
git add -A
git commit -m "feat: improve retry loop"

The loop, before PR

The review cycle happens at commit time, so humans read intent in the PR instead of cleanup threads.

  1. You stage changes and run git commit.
  2. GitPreflight reviews git diff --cached with PR-style checks.
  3. Findings are injected into your active agent session with actionable suggestions.
  4. Your agent patches code, restages, and reruns until PASS.
  5. Only then do you open a PR with less noise and fewer review rounds.

Fully autonomous by default

Designed for local agent workflows that should run without extra user prompts.

Without GitPreflight

  • Feedback arrives after push, inside PR comments.
  • You manually shuttle comments back into your agent.
  • Each fix adds more thread noise and review churn.
  • PRs read like a transcript instead of a clean change.

With GitPreflight

  • Review starts on git commit in your local loop.
  • Agent-to-agent feedback arrives before any PR is created.
  • Structured findings include ready-to-apply suggestion blocks.
  • You push only after PASS and open cleaner PRs.

Agent feedback protocol

Stable Markdown output makes autonomous parsing and patching predictable across runs.

Excerpt: MARKDOWN_CONTRACT
# GitPreflight Review

Result: FAIL
Counts: note=1 minor=1 major=0

## Findings

### src/loop.ts

#### Retry logic misses backoff
Path: src/loop.ts
Line: 42
Severity: minor
Agreement: 2/3

Use exponential backoff to avoid tight failure loops.

```suggestion
await wait(Math.min(5000, 250 * 2 ** attempt));
```

Install for local development

Set up once with OpenTUI, then keep your agent loop hands-free on every commit.

  1. Install and wire hooks with gitpreflight setup.
  2. OpenTUI walks through scope, hook mode, and local-agent provider selection.
  3. Use gitpreflight setup local-agent later if you want to switch providers only.
  4. Re-running setup updates managed hook lines instead of duplicating entries.
  5. Use gitpreflight version (or -v) to check current/latest versions.
  6. Commit as usual; feedback is routed automatically during hooks.
Saved local config
~/.config/gitpreflight/config.json
~/.config/gitpreflight/config.schema.json

FAQ

How do I bypass GitPreflight?

  • One-shot bypass: `gitpreflight skip-next --reason "<why>"`
  • Universal bypass: `git commit --no-verify`

Does this require manual prompting every time?

No. Once local-agent setup is complete, GitPreflight runs in the hook flow and routes findings automatically into your active agent loop.

What if I run setup more than once?

Setup is idempotent for managed hooks: existing GitPreflight lines are updated/cleaned instead of appended repeatedly.

What makes PRs cleaner?

The noisy fix rounds happen before PR creation. Reviewers see the intended change set instead of agent back-and-forth.

What metrics or telemetry do you collect?

GitPreflight sends only anonymous install/review usage events keyed by a random local install ID. We do not include repo URLs, diffs, file contents, emails, or auth tokens in that payload. Hosted mode also tracks daily usage/model stats for your org dashboard; local-agent reviews do not use those hosted quota metrics.

I use OpenCode. Is hook execution isolated from host sessions?

Yes. GitPreflight sanitizes inherited OpenCode server session env vars before spawning opencode during hook reviews.

What if a review run times out?

The commit is marked UNCHECKED locally under .git/gitpreflight/ and surfaced on the next run so the backlog stays visible.