loupe

module
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT

README

loupe

latest release ci codecov

loupe collects a review agent's findings into a local draft so you decide each one and publish a single GitHub review. For local work, such as uncommitted changes or a plan, you decide the findings the same way and return the decisions to the agent that applies them.

Deciding each finding, then writing the review's opening sentence and sending it with one key.

Why loupe

  • Nothing posts under your name unread. You accept, rewrite or drop each finding yourself. You write the review's opening, and one confirmation sends one review.
  • Any review agent works. loupe has no opinion on how findings are found. The agent files them through a CLI, and a plugin for Claude Code, Codex and Pi teaches it the workflow.
  • Findings are files on disk. One directory per run. No daemon, no database, no service to sign up for.
  • Human and bot reviews read the same. A CI job can publish through loupe too. Its review uses the same comment format. It is marked unattended and never approves or blocks a merge.

How it works

  1. Your agent captures the pull request into a run and files its findings into the draft.
  2. You decide each finding in loupe review, which opens in a pane beside the agent in Herdr, tmux, Orca, iTerm2 or Ghostty. You accept, rewrite or drop each one, or send it back with a note for the agent to answer.
  3. loupe publish shows the review as it will read, with its exact Markdown one key away. You write its opening, and one key posts it.

Local work, such as uncommitted changes, a plan or a spec, goes through the same review with no pull request. The agent captures it with loupe capture --changed or --files, and each finding shows the change the agent will make. Once you have decided the last one, you return the run, and the agent applies what you accepted. Nothing reaches GitHub. Local work has the steps.

This is what a published review looks like. A CI review uses the same format.

loupe stats totals your decisions across runs: how many findings the agent filed, how many you published and how many you rejected.

Install

One command installs the binary into ~/.local/bin, checked against the release's checksum. It also installs the agent plugin, at the same release, into each of Claude Code, Codex and Pi that it finds.

curl -fsSL https://secondshift-labs.github.io/loupe/install.sh | sh

loupe update updates the binary and the plugins together, and loupe uninstall removes both and keeps your review runs. Install covers the options, mise, release archives and GitHub Actions.

loupe runs on Linux and macOS, on amd64 and arm64, and needs git. It reaches GitHub with the token in GH_TOKEN or GITHUB_TOKEN, or else the one gh auth login stored, so a signed-in gh needs no setup. macOS release builds are signed with a Developer ID and notarized by Apple.

To try the interface without a pull request, run mise run demo in a clone. It opens loupe review on seeded runs against an in-memory GitHub, so nothing leaves the machine.

Documentation

  • Install: the binary, the agent plugin for each host, and updating or removing the two together.
  • Comment format: the full reference for a published review, for anyone building on it.
  • The review workflow: the attended loop, local work, the pane hand-off, adapting a review skill you already have, and the command and environment reference.
  • Unattended reviews in CI: the GitHub Action, the pipeline steps, sticky rounds and the rules an unattended review follows.
  • Withdrawal reasons: how an agent says why it withdrew a finding, and the recommended reason codes.
  • CLI contract: commands, input, results and errors, for scripting against loupe.
  • Constitution: the seven principles every change answers to.
  • Contributing: setup, local development, tests, commits and releases.
  • Security: how to report a vulnerability.

License

MIT. See LICENSE.

Directories

Path Synopsis
cmd
loupe command
loupe-demo command
Command loupe-demo runs loupe against seeded review runs and an in-memory GitHub, so the review interface and the whole publish flow can be tried by hand without a pull request, credentials or network.
Command loupe-demo runs loupe against seeded review runs and an in-memory GitHub, so the review interface and the whole publish flow can be tried by hand without a pull request, credentials or network.
internal
cli
Package cli maps loupe's commands onto cobra and turns domain results and refusals into the output contract.
Package cli maps loupe's commands onto cobra and turns domain results and refusals into the output contract.
diff
Package diff is the parsed pr.diff that both location validation and the review interface read.
Package diff is the parsed pr.diff that both location validation and the review interface read.
draft
Package draft holds the review draft: findings, human decisions, send-back notes and replies.
Package draft holds the review draft: findings, human decisions, send-back notes and replies.
findingid
Package findingid orders ids like f-001 so that f-999 sorts before f-1000.
Package findingid orders ids like f-001 so that f-999 sorts before f-1000.
gitenv
Package gitenv filters the environment handed to git, shared by gitx and the test repositories.
Package gitenv filters the environment handed to git, shared by gitx and the test repositories.
github
Package github is loupe's narrow view of the GitHub REST API, behind an interface so tests can fake it.
Package github is loupe's narrow view of the GitHub REST API, behind an interface so tests can fake it.
gitx
Package gitx runs the few git commands loupe needs against the user's clone.
Package gitx runs the few git commands loupe needs against the user's clone.
local
Package local captures local work for apply mode: the changed files of a Git worktree, named files, or no file.
Package local captures local work for apply mode: the changed files of a Git worktree, named files, or no file.
markdown
Package markdown checks authored Markdown against the allowlist in docs/comment-format.md, so a body or summary cannot restructure the <details> wrapper the renderer puts around it.
Package markdown checks authored Markdown against the allowlist in docs/comment-format.md, so a body or summary cannot restructure the <details> wrapper the renderer puts around it.
mode
Package mode is the one switch on a run's kind.
Package mode is the one switch on a run's kind.
pane
Package pane opens loupe review for the human in a new terminal pane beside the agent's, in Herdr, tmux, Orca, iTerm2 or Ghostty.
Package pane opens loupe review for the human in a new terminal pane beside the agent's, in Herdr, tmux, Orca, iTerm2 or Ghostty.
publish
Package publish runs the publication state machine: gates, envelope, confirmation, one review request, receipt.
Package publish runs the publication state machine: gates, envelope, confirmation, one review request, receipt.
refusal
Package refusal is a leaf so every domain package can return refusals without importing internal/cli.
Package refusal is a leaf so every domain package can return refusals without importing internal/cli.
render
Package render composes what loupe shows and sends.
Package render composes what loupe shows and sends.
run
Package run owns the on-disk layout of review runs: paths, references, atomic writes and locking.
Package run owns the on-disk layout of review runs: paths, references, atomic writes and locking.
section
Package section places a finding in the review body's sections, so that every surface presents findings in the order the published review will.
Package section places a finding in the review body's sections, so that every surface presents findings in the order the published review will.
severity
Package severity orders loupe's four severity words so that every surface ranks findings the same way.
Package severity orders loupe's four severity words so that every surface ranks findings the same way.
stats
Package stats rolls the human gate up across runs: what the agent filed, what was published, what the human rejected and what the agent cut itself, counted the way the published loupe-meta marker counts them.
Package stats rolls the human gate up across runs: what the agent filed, what was published, what the human rejected and what the agent cut itself, counted the way the published loupe-meta marker counts them.
style
Package style is the one place terminal appearance is decided: colors, glyphs and the small layout helpers every human-facing surface shares, so the review interface and the one-shot commands look like one program.
Package style is the one place terminal appearance is decided: colors, glyphs and the small layout helpers every human-facing surface shares, so the review interface and the one-shot commands look like one program.
testutil/fakegh
Package fakegh is an in-memory GitHub REST and GraphQL server for the endpoints loupe calls, reached through the production client so request encoding is exercised end to end.
Package fakegh is an in-memory GitHub REST and GraphQL server for the endpoints loupe calls, reached through the production client so request encoding is exercised end to end.
testutil/gitfail
Package gitfail puts a git on PATH that runs the real git except where a test wants a call to fail or print nothing.
Package gitfail puts a git on PATH that runs the real git except where a test wants a call to fail or print nothing.
testutil/gitrepo
Package gitrepo builds a local stand-in for a GitHub repository: a bare remote, a user's clone of it, and a pull request head published at refs/pull/<number>/head.
Package gitrepo builds a local stand-in for a GitHub repository: a bare remote, a user's clone of it, and a pull request head published at refs/pull/<number>/head.
testutil/golden
Package golden compares output with the files under testdata/golden at the repository root, and owns the one -update flag that rewrites them.
Package golden compares output with the files under testdata/golden at the repository root, and owns the one -update flag that rewrites them.
testutil/herdrstub
Package herdrstub writes a stand-in for the Herdr command line, which loupe handoff drives to open review in a pane beside the agent.
Package herdrstub writes a stand-in for the Herdr command line, which loupe handoff drives to open review in a pane beside the agent.
testutil/refusaltest
Package refusaltest checks that an error is a loupe refusal of the expected code.
Package refusaltest checks that an error is a loupe refusal of the expected code.
testutil/screen
Package screen drives loupe's full-screen programs the way a human at a terminal does: keys go in through a pipe, and each step waits for the screen to show its result rather than for time to pass, so a test never races the program, however slowly a step such as publishing runs.
Package screen drives loupe's full-screen programs the way a human at a terminal does: keys go in through a pipe, and each step waits for the screen to show its result rather than for time to pass, so a test never races the program, however slowly a step such as publishing runs.
testutil/sgrtest
Package sgrtest reads the SGR escape sequences that styled terminal text carries.
Package sgrtest reads the SGR escape sequences that styled terminal text carries.
tui
Package tui is the human review interface: a full-screen Bubble Tea program.
Package tui is the human review interface: a full-screen Bubble Tea program.
updatecheck
Package updatecheck tells a person running an old release that a newer one exists.
Package updatecheck tells a person running an old release that a newer one exists.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL