Review queue¶
uh queue keeps a list of changes to review and serves a local web page, the Review Home Page, where you open each one. The queue is a JSON file on disk. Add entries from the terminal or the page. They stay until you remove them.
The queue holds two lists:
| List | What goes in it | Entry ID format |
|---|---|---|
| Pull Requests | GitHub pull request URLs | pr:github:<host>/<owner>/<repo>#<number> |
| Local Diffs & Draft Branches | Local repository diffs (a branch against a target, or uncommitted changes), and GitHub commit URLs | local:<repo path>::<target>::<head or "worktree">, or commit:<host>/<owner>/<repo>@<sha> for commits |
The queue is separate from uh review. Running uh review adds nothing to the queue, and the queue does not use the analysis caches.
Start the Review Home Page¶
uh queue with no subcommand is the same as uh queue open. Both bind an HTTP server on 127.0.0.1, print the URL, and run until you press Ctrl-C:
--openalso opens the URL in your browser.--port <n>picks the port. The default,0, takes any free port.--ast-diffturns on scoped AST diff highlighting by default for every review opened from the page.
All flags: the uh queue reference.

Each row shows the title, repository, author (PRs and commits only), a base ← head or target…head pill, and line and symbol counts. It may also show an ephemeral or Merge conflict badge. Each row has three actions:
- Review → opens the diff in the reader.
- Overview opens the change's overview page.
- × removes the entry from the queue.
Clicking the title opens the overview for PRs, commits, and local diffs with a description. Other local diffs open in the reader. From an open review, ← Home in the top bar returns to the list.
The page computes a review when you open it, not when you add it. It caches reviews in memory while the server runs, so a second open is fast. To learn how to read an open review, see Reading the UI.
Overview page¶
The overview shows the title, state, author, branches, merge-base, and labels, plus the description as Markdown. A side panel shows counts (files changed, lines, changed symbols, moved symbols), up to six key changed entry points and changed types, a Start Code Review → button, and Remove from queue.

Opening an entry runs one staleness check:
- For a PR, it compares the stored head SHA with the current head on GitHub.
- For a local diff, it recomputes the head SHA, the merge-base, and the conflict state.
- Commit entries are never stale.
If the entry is out of date, the overview shows an Out of date banner with a Refresh button that rebuilds the review. A Merge conflict banner lists conflicting files, if any. The page does not poll. It checks when you open an entry and refreshes only when you click.
Add entries¶
uh queue add <SOURCE> adds one entry and prints its ID and the queue file path. It detects SOURCE in this order:
- A GitHub pull request URL (
https://github.com/<owner>/<repo>/pull/<n>). It goes into Pull Requests. - A GitHub commit URL (
https://<host>/<owner>/<repo>/commit/<sha>, with a hex SHA of 7 to 40 characters). It goes into Local Diffs. - Anything else is treated as a path to a local git repository. It goes into Local Diffs.
Adding a queued entry again updates it in place and moves it to the top of its list. The original added time is kept. Entries match on ID or URL. Local diffs also match on repository path, target, and head.
Pull requests and commits¶
This fetches the title, description, author, state, labels, branches, SHAs, and conflict status through the gh CLI. --title, --body, --ephemeral, --target, and --head have no effect on PR entries. Line and symbol counts stay empty until you first open the PR.
Both need the gh CLI logged in. --gh-account <login> picks the gh account. For account selection and token variables, see Reviewing changes.
Local diffs¶
# A branch against a target, diffed from their merge-base
uh queue add ~/src/service --target origin/main --head feat/retry
# Uncommitted changes in the working tree
uh queue add ~/src/service
# With a title, a Markdown description for the Overview page, and the ephemeral marker
uh queue add . --target main --head feat/retry \
--title "Retry budget" \
--body $'## Context\nAdds a retry budget to the router.' \
--ephemeral
| Flag | Effect on a local diff |
|---|---|
--target <ref> |
Target ref, for example origin/main, main, or HEAD. If you leave it out, uh uses the first of origin/main, main, origin/master, master that exists and is not the current branch, and falls back to HEAD. |
--head <ref> |
Head ref. With --head, the diff runs from git merge-base <target> <head> to <head>. Without it, the entry is the uncommitted working tree. |
--title <text> |
Display title. Defaults to <target>...<head>, or <target>...working-tree when there is no head. |
--body <markdown> |
Description, rendered on the Overview page. |
--ephemeral |
Marks the entry with an ephemeral badge. |
Working-tree entries diff against HEAD
Without --head, the diff is git diff HEAD: staged and unstaged changes to tracked files, compared with the current commit. The target still sets the merge-base, the conflict check, and the default title. Commits on your branch that are not on the target are not in the diff. To review a whole branch, pass --head.
The path must exist. uh resolves it to its canonical absolute path and uses that in the entry ID, so . and the full path name the same entry. Adding a local diff computes it immediately, recording the counts, merge-base, and conflict check (git merge-tree against the target).
--ephemeral only adds the badge. Ephemeral entries are not removed automatically. Remove them like any other entry: × on the row, or Remove from queue on the Overview page.
Add from the browser¶
The Review Home Page has an add form at the top of each list.
- Pull Requests: paste a PR or commit URL and click Add PR. A commit URL still goes into the Local Diffs list. Title, description, and ephemeral cannot be set for URLs added this way.
- Local Diffs: enter a repository path, an optional target, and an optional head (blank for the working tree), then click Add local. Open Title, description & ephemeral to set the other three fields.
Browser adds go through the running server and follow the uh queue add rules.
List entries¶
Pull Requests (0):
(none)
Local Diffs & Draft Branches (2):
main...working-tree (service) [main...working-tree] +1 -0
id: local:/home/me/src/service::main::worktree
Retry budget (service) [main...feat/retry] +3 -2
id: local:/home/me/src/service::main::feat/retry
PR rows have the form #<n> <title> (<owner/repo>) [<base> <- <head>] +<added> -<removed>. Rows end in [CONFLICT] (for PRs) or [CONFLICT: <n> files] (for local diffs) when a merge conflict was detected. The newest or most recently updated entry comes first.
uh queue list --json prints the queue file as pretty-printed JSON:
{
"schema_version": 1,
"pull_requests": [],
"local_diffs": [
{
"id": "local:/home/me/src/service::main::feat/retry",
"title": "Retry budget",
"description_md": "## Context\nAdds a retry budget to the router.",
"ephemeral": true,
"repo_name": "service",
"repo_path": "/home/me/src/service",
"target_ref": "main",
"head_ref": "feat/retry",
"merge_base_sha": "82a2c58219ae7a622fe4838a49c1396e4c531a53",
"head_sha": "8cf8c0b02295da2f877dbd02a66460e8df4f8c0c",
"has_conflict": false,
"conflicts": [],
"stats": {
"files_changed": 1,
"lines_added": 3,
"lines_removed": 2,
"symbols_changed": 3,
"symbols_moved": 0
},
"added_at": 1795993011,
"updated_at": 1795993011
}
]
}
Working-tree local diffs omit head_ref and head_sha. Commit entries also have url and author. PR entries have forge, repo, pr_number, url, author, state, labels, base_ref, head_ref, base_sha, and head_sha. added_at and updated_at are Unix timestamps in seconds.
Remove entries¶
Pass the ID exactly as uh queue list prints it. IDs contain :, #, and /, so quote them in the shell. An unknown ID prints Entry not found: <id>, leaves the file unchanged, and exits 0.
The queue file¶
All uh queue subcommands use one JSON file. Its path is the first of these that is set:
--queue-file <path>$UHDIFF_QUEUE_FILE$XDG_DATA_HOME/uhdiff/queue.json~/.local/share/uhdiff/queue.json
A missing file reads as an empty queue. The file and its parent directory are created on the first write. Invalid JSON fails with invalid queue JSON at <path>: .... For all file locations and environment variables, see Configuration.
Use --queue-file for a separate queue, such as one per project or one in a test:
uh queue add . --queue-file ./review-queue.json
uh queue list --queue-file ./review-queue.json
uh queue open --queue-file ./review-queue.json --open
Running server and the file¶
The server reads the queue file at startup and builds the page from that copy. After that:
- Adding or removing on the page writes the file and reloads the lists, which picks up terminal additions.
- ← Home from an open review reloads the lists from the file.
- Reloading the tab shows the lists as of server startup. To see entries added with
uh queue addsince then, add or remove something on the page, or open a review and return with ← Home.
Opening an entry on the page also writes the file. It updates the entry's counts, SHAs, conflict state, and updated time, and for a PR, its title, description, state, and labels.
No lock between processes
Within one server, writes run one at a time. Separate processes do not coordinate. A uh queue add that runs at the same moment as a page write, or a second uh queue open on the same file, can overwrite the other's change. Each write replaces the whole file.