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

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.2
  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: "false"  # "true" 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.2

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.2
File Size Uploaded Provenance Actions
rd0_jinx-0.1.2.tar.gz 128.7 kB With provenance Details for rd0_jinx-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 154.3 kB

Release files / rd0_jinx-0.1.2.tar.gz

Download URL rd0_jinx-0.1.2.tar.gz
Size 128.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8b0e3f148616d61a753978cc2e42627d53b8a0f9dd60457181dbdd306ba7c448
BLAKE2b-256 checksum
How to use checksums
c64ab7175bc7708a283a12cc85f6d71194862c09ff073d603086136680e4dc43
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 Nov 30, 2026.

Transparency log

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

Download URL rd0_jinx-0.1.2-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cf7b5bfdf09f9c707b949803872f6bea3c098b7cc9b3514193b7bbe2c589ab5
BLAKE2b-256 checksum
How to use checksums
334bea02b59512a408f97a73bd465943a8b699bf546ffed8a0592f71d3225c43
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 Nov 30, 2026.

Transparency log

Security for rd0-jinx 0.1.2

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.2.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 Nov 30, 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