GitHub
Sign in once, then open, review, and fix pull requests beside the worktree the code came from.
Signing in
Settings → GitHub, or the first time you open a PR view. Pragma uses the OAuth
device flow — a browser opens at github.com/login/device with a code — requesting
the repo scope only. If you already use the gh CLI, Pragma can adopt its token
instead. The token belongs to the host: it is stored in an owner-only file (0600 on
macOS and Linux, an owner-only ACL on Windows) beside the host server, so
Pragma Go can look up and publish pull requests even
with no desktop window open. Nothing a paired phone can call ever returns the token itself.
A token stored by an older Pragma is moved there once, on first launch.
Creating a pull request
The right sidebar's Pull Request tab opens the create view when the worktree has no open PR:
- AI drafts the title and body from the actual diff — regenerate with Shift+Tab, edit freely in a markdown WYSIWYG.
- Pre-flight checks catch an uncommitted or unpushed branch before you submit.
- A "Created with Pragma" footer (a heading link, an "Open worktree" link, and the opt-out line) is appended. Disable the signature under Settings → GitHub → Pull requests — global scope, applies everywhere.
The AI Commit & PR button in the sidebar header does the whole pipeline at once: commits all changes as AI-planned commits, pushes, drafts the PR, and switches you to the view.
Reviewing a pull request
The PR Review tab (opened from a PR view) is the full review surface:
- Checks — pass/fail/pending counts with a per-check dropdown, plus Sync with Base Branch and, on conflicts, a confirmed Abort Merge.
- Changed files — read every file as a side-by-side diff against the base, with a per-file done-toggle. Drag the bar under a diff to make it taller or shorter, or double-click the bar to fit the whole file. The page scrolls past a diff until you click into it.
- Review threads — reply inline in markdown, resolve and unresolve optimistically,
right from the app. The toolbar's up/down arrows (or
Cmd/Ctrl+↑/↓) step through comments. Each step centers the comment in its diff and the diff on screen.
Resolving merge conflicts with AI
When a pull request conflicts with its base, the merge card offers Resolve Merge Conflicts above Sync with Base Branch. It appears only when you have both built-in AI and a System 1 model set up, and it works before or after you sync. If you haven't synced yet, it merges the base in first.
- System 1 decides. Each conflicted file is one System 1 request, and all files are sent at once. For every conflict it picks ours (the PR branch), theirs (the base), or both in either order, just like resolving by hand. It also reports two numbers: a confidence (how likely a human would pick the same) and a semantic risk (how much damage a wrong pick would do).
- The built-in AI verifies what's uncertain. If any conflict in a file scores too low (confidence discounted by risk), or System 1 couldn't answer, the whole file goes to your most capable built-in model. It gets the same context plus System 1's answers and read-only access to the code. It can keep a pick, override it, or write a hand-merged resolution. The button reads Verifying results… while this runs.
- Both models see the commit messages on each branch that touched the file and the PR description, so they resolve toward what each side was trying to do.
Resolved files are written and staged. Binary files and rename or delete conflicts are left for you, with a note saying which. Once nothing is left conflicted, the button becomes Commit and Push Fixes: it writes a commit message that says the commit fixes merge conflicts with the base, commits, and pushes. Review the staged changes first. Without built-in AI you commit the merge yourself. If the push fails after the commit, the button becomes Push Fixes and retries only the push. Abort Merge still discards everything.
Like the other AI helpers, this runs on local worktrees only, not over SSH.
Fixing with AI
Every review thread offers:
- Fix — launch an agent on that one comment.
- Add to fix it list — collect several comments.
The tab header's Address fix it list hands the whole list to an agent — in the same worktree, or on a fresh one it creates for the fix. The agent receives every comment with its file and context in one prompt.
Stacks
A PR can sit on top of another. When GitHub reports a stack, Pragma links it to your local ancestor chain:
- Missing layers get tracking worktrees, created bottom-to-top.
- Sync stack runs the stack sync in a terminal.
- Merge stack merges the top PR asynchronously, then offers to delete the matched stack worktrees and branches.
Each piece stays reviewable on its own — no more one giant branch.