Skip to main content

rd0-jinx

Find the pull request that already does this.

Coding agents (Copilot, Codex, Devin, Claude Code, Cursor, Jules) open a lot of pull requests, and some of them redo work that is already open. rd0-jinx checks a new PR against the open ones and, when it finds a likely duplicate, tells you which PR it matches and why.

  • Runs on CPU in about 6 ms per PR. No LLM, no API key, no network call.
  • Explains every match: shared files, overlapping line ranges, identical added lines, the same linked issue.
  • About 1.9 false alarms per 100 PRs that have no duplicate.

Full README, benchmark and papers: https://github.com/ReviewDebtZero/rd0-jinx

Install

pip install rd0-jinx                # the `jinx` command
pip install "rd0-jinx[embed]"       # optional local MiniLM text model (installs PyTorch)

Use it

jinx check new_pr.json --open-queue open_prs.jsonl --top 2
PR #44134: checked 19 open PRs in 12 ms. 1 likely duplicate(s) (score >= 0.50).
  DUPLICATE? #44110  score 1.00  refactor(tvp): use capture_outputs for output tracing
               - one PR links to the other (#44110)
               - shares 1 of 1 changed files (src/transformers/models/tvp/modeling_tvp.py)
               - 100% of changed line ranges overlap
               - 100% of added lines are identical
               - similar title/description after removing agent template text (0.92)

Input uses the GitHub API's JSON shape (number, title, body, user.login, created_at). Optional fields are diff (unified diff text), files, agent and linked_issues. The queue can be a JSON list or a JSON-lines file.

Flag What it does
--top N List at most N candidates
--threshold X Flag only scores >= X (default 0.5)
--json Machine-readable output
--embed Also use the local MiniLM text model (needs [embed])
--templates FILE Use templates learned from your own PRs

Before you open a PR: jinx precheck

Run it on your branch (or as an agent's last step before gh pr create). It reads the open PRs of the repository from the GitHub API (token from GITHUB_TOKEN, GH_TOKEN or gh auth token) and compares git diff $(git merge-base origin/main HEAD) and your first commit subject with all of them, with the same two-stage ranking as the Action.

jinx precheck                                  # after coding: branch diff + commit subject
jinx precheck --issue 123 --exit-code          # also counts PRs that link issue 123; exit 1 on a match
jinx precheck --no-diff --title "Add Granite 4 tool parser" --issue 123   # before coding: task text only
Flag What it does
--repo owner/name Repository to read open PRs from (default: the origin remote)
--base REF Branch the change starts from (default origin/main)
--no-diff Before coding: compare only --title, --body and --issue
--issue N Issue the change addresses (repeatable)
--author LOGIN --skip-same-author Ignore your own open PRs
--open-queue FILE Read open PRs from a file instead of the API
--exit-code Exit 1 when a likely duplicate is found (2 if the open PRs cannot be read)

Before coding there is no code to compare, so only titles, descriptions and links count; on the large-repository benchmark this mode is weaker (see research/experiments/hotrepos/). A line for AGENTS.md:

Before opening a PR, run `jinx precheck --exit-code`. If it reports a likely duplicate, stop and
comment on that PR instead of opening a new one.

In Python

from rd0_jinx import PR, Detector

new = PR.from_dict(new_pr_json)  # GitHub API JSON shape
queue = [PR.from_dict(d) for d in open_prs_json]

det = Detector()  # ships with trained weights
for m in det.rank(new, queue, top=3):
    if m.score >= det.threshold:
        print(m.number, round(m.score, 2), m.reasons)

As a GitHub Action

- uses: ReviewDebtZero/rd0-jinx@v0.1.3
  with:
    threshold: ""        # empty = bundled default (0.5)
    max-open-prs: "10000"  # open PRs listed and scored on text and links
    shortlist: "20"        # best matches whose files are fetched and compared
    skip-same-author: "true"   # default: ignores the author's own open PRs

License

MIT. The shipped weights were trained on AIDev (CC BY 4.0).

Metadata

Release files for rd0-jinx 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rd0-jinx 0.1.3
File Size Uploaded Provenance Actions
rd0_jinx-0.1.3.tar.gz 128.9 kB With provenance Details for rd0_jinx-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rd0-jinx 0.1.3
File Interpreter ABI Platform Actions
rd0_jinx-0.1.3-py3-none-any.whl Python 3 none any Details for rd0_jinx-0.1.3-py3-none-any.whl

Total release size: 154.6 kB

Release files / rd0_jinx-0.1.3.tar.gz

Download URL rd0_jinx-0.1.3.tar.gz
Size 128.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e3926df1c0bc870da172d8f32a733da1f6751a91213aa24cf4dfe294b80418ca
BLAKE2b-256 checksum
How to use checksums
3ad91db6e1f29f21267bc70431ba46e24be6ff122705cdb5766bd72cc895cf4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / rd0_jinx-0.1.3-py3-none-any.whl

Download URL rd0_jinx-0.1.3-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1adc03fb09f952d2f2b17b7e8f1a43e564587a24b9f41c91c41b22fba86ea8a9
BLAKE2b-256 checksum
How to use checksums
5ea974c77278c290e90955f2ace6ca281be4b157d4fed4fabeeac534dab2edef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for rd0-jinx 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rd0_jinx-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page