Diff Viewer, Annotate AI Diff & PR Shipping
Master Orca's combined diff viewer, line-anchored Annotate AI Diff batch loop, AI vs human attribution, safe commits/pushes, and GitHub/Linear/Jira workflows.
🎯 Goal
Coding agents generate changes fast, which shifts the bottleneck to reviewing diffs and steering revisions cleanly. Pasting file paths and line numbers into chat—or interrupting an agent one nitpick at a time—causes context thrashing and regressions.
By the end of this guide, you will run Orca's tight review-to-PR loop:
- Audit staged, unstaged, untracked, image, and HTML changes inside Orca's Diff Viewer scoped to your
start-from ref; - Leave line- and range-anchored Markdown comments with Annotate AI Diff, then batch-dispatch them with Send to agent;
- Spot AI-authored vs human-edited lines at a glance with Attribution;
- Commit, repair failed hooks safely, push with
--force-with-lease, open stacked PRs, and link GitHub, Linear, and Jira issues right beside your code.
📋 Prerequisites
- At least one active Orca worktree with agent-generated edits (see Worktrees & the 4 Real Pitfalls if you haven't configured worktree isolation yet).
- For hosted PRs, CI checks, and issue drawers:
- GitHub CLI (
gh) installed and authenticated on the host running the worktree (gh auth status); - Optional credentials for GitLab, Bitbucket Cloud, Linear, or Jira configured under
Settings → Integrations(or the Tasks sidebar).
- GitHub CLI (
Key Principle: Batch Your Review Notes
Sending feedback one line at a time forces an agent into noisy back-and-forth edits. Batching all line-anchored comments into a single Send to agent pass gives the model full context so it solves cross-file fixes coherently in one turn.
🛠️ Step-by-Step
1. Inspect Everything Changed in the Diff Viewer
Every worktree comes with a built-in diff scoped by default to its start-from ref, merging staged, unstaged, and untracked changes into one reviewable surface:
- Adjust your comparison target: Switch the diff toolbar dropdown at any time to compare against the repo's
base ref(such asorigin/main), another branch, or a specific commit. - Keyboard navigation for fast triage:
| Shortcut / Control | Action | Why Use It |
|---|---|---|
j / k | Next / previous changed file | Sweep through modified modules without reaching for the mouse |
n / p | Next / previous hunk | Skip unchanged code inside large files |
F7 / Shift+F7 | Next / previous change in active editor | Focused single-file review |
s | Stage by hunk or line (visual git add -p) | Separate formatting noise from logic commits |
- Specialized viewers & layout toggles:
- Image diffs: Inspect binary image updates using Side-by-side, Swipe, or Onion-skin modes.
- HTML side preview: In combined diffs, working-tree HTML sections expose an eye icon (Open Preview to the Side) that opens the rendered HTML in a side browser split.
- 3-way merge conflict UI: Resolve git conflicts inline with clear incoming/current/result views.
- Whitespace, folding & word wrap: Open the
⋯actions menu in the diff header to toggle Show Whitespace, Collapse unchanged regions, or Diff Word Wrap (synced globally withSettings → General → Diff Word Wrap). - Resizable file tree: Combined diffs include a collapsible file tree whose resize handle supports both drag and arrow keys (
Shiftmultiplies step size) and persists across sessions.
2. Run the Annotate AI Diff Batch Loop
Instead of copying snippets into chat when something looks wrong, pin feedback directly to the diff:
- Pin a single-line or multi-line comment: Hover any line and click
+in the gutter, or place your cursor and pressc. To annotate a contiguous block, drag across adjacent lines or holdShiftto extend the selection (Orca keeps the range inside the hunk and labels the exact line span). - Write Markdown notes: Press
EnterorCmd/Ctrl+Enterto save,Shift+Enterfor a newline, orEscto cancel. - Tracking across edits: Comments stay pinned to their logical lines and automatically follow shifts when the agent edits nearby code.
- Batch send to an agent: Once your pass is complete, click
Send to agentat the top of the diff (or assign a custom keybinding toSend Review Notes to AgentunderSettings → Shortcuts). Orca compiles all unresolved notes with file paths and line anchors and lets you pick an active agent—or launch a new one—via Send notes to. - Verify and resolve: After the agent revises the code, comments stay pinned so you can verify each change. Click
Resolveto collapse verified threads; any unresolved notes stay queued for the next batch if you clickSend to agentagain.
3. Scan AI vs. Human Provenance with Attribution
When you hand-edit parts of an AI-generated branch—or need extra scrutiny on purely machine-generated blocks—check the diff gutter for Attribution markers:
- When an agent modifies files through its tooling, Orca records the ranges and marks AI-originated lines subtly in the gutter.
- Editing those lines yourself flips attribution back to human.
- Attribution metadata is local to Orca and never written into Git commits; you can export diff attribution metadata from the diff toolbar if needed for audits.
4. Commit, Push Safely, and Sync Hosted PRs & Tasks
Finish delivery right next to the diff in the Source Control panel and Tasks drawer:
- Stage & draft commits: Stage individual hunks or files, type your commit message, or click
Generate with AIto summarize staged diffs. - Keyboard commit: Press
Cmd+Enter(macOS) orCtrl+Enter(Windows/Linux) while focused in Source Control. - Inline hook repair: Repo pre-commit hooks run normally. If a hook fails, Orca displays the failure inline alongside a
Fix with AIaction that sends the hook output, attempted message, and staged file list as a repair-only prompt—never bypassing hooks or auto-pushing.
⚠️ Common Pitfalls
1. Diff Looks Stale After an External CLI Rebase or Reset
Symptom: You ran git rebase or git reset in a terminal, and the diff panel still shows outdated hunks.
Fix: Click the Refresh icon in the diff toolbar to re-read the worktree, and verify the toolbar's comparison ref (start-from ref vs base ref) hasn't drifted from what you expect.
2. GitHub PR / Checks Show HTTP 403 While Settings Budget Looks Healthy
Why it happens: Settings → Git → GitHub API Budget reads GitHub's exempt rate_limit probe endpoint, which can still show quota while live REST calls (5,000/hr shared across Orca, your terminal gh, and every agent running gh) are returning remaining: 0.
Checklist:
- Run
gh api user -i 2>&1 | head -40to inspect liveX-Ratelimit-RemainingandX-Ratelimit-Resetheaders. - Check
~/.zshrcor~/.bash_profilefor stale exportedGITHUB_TOKEN/GH_TOKENvariables overriding your keyring login (unset GITHUB_TOKEN GH_TOKEN && gh auth status). - Verify
reposcope and SAML SSO authorization if private org repos return 403/404.
3. Treating Untrusted Issue Text as Trusted Agent Instructions
Risk: Public GitHub issues, external Jira comments, or webhook payloads can contain untrusted prompt-injection text.
Rule: Treat ticket descriptions and comments strictly as untrusted data, and always review sensitive code paths in Diff Viewer before committing or pushing.
4. Piecemeal Chat Follow-Ups Causing Regressions
Symptom: Sending five separate follow-up messages causes the agent to undo earlier fixes while addressing later ones.
Fix: Mark every flaw with Annotate AI Diff first, fire a single Send to agent batch, and click Resolve only after verifying each updated hunk.
✅ Checklist & Next Steps
Before merging your next agent-built branch, verify:
- You navigated the full worktree diff with
j/k/n/pagainststart-from ref; - You batched multiple line/range notes via
Annotate AI Diff+Send to agentand resolved verified threads; - On a pre-commit hook failure, you used
Fix with AIrather than bypassing repo checks; - You understand why
Force push with leaseis explicit after rewriting local commit history.
Splits, Keyboard Navigation & Multi-Worktree Flow
Organize Ghostty-styled terminal splits, editor tabs, and per-worktree browser tabs—and navigate 10+ concurrent worktrees at keyboard speed with Cmd/Ctrl-P, Cmd/Ctrl-J, the + Omnibox, and Session Restore.
Design Mode, Orca CLI, MCP Skills & Orca Bots
Bridge browser previews to code with Design Mode, automate worktrees via Orca CLI and Orchestration, manage MCP servers and version-matched skills, and deploy Orca Bots & plugins.