npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

prai-review

v0.1.0

Published

AI PR reviewer — reviews any PR with full codebase context using Claude Code. Free, local-first, multi-forge.

Readme


prai reviews your pull requests using Claude Code — the same AI that can read your entire codebase, not just the diff. It runs from your terminal, uses your existing Claude Code subscription, and works with GitHub, Bitbucket, and GitLab.

$ prai

╭ prai — AI PR reviewer ╮
╰────────────────────────╯

? Select a PR to review:
❯ #47  feat/login-fix — Fix OAuth token refresh
  #45  bugfix/null-check — Handle missing user profile
  #43  feat/dashboard — Add analytics dashboard

✔ Review complete

  CRITICAL  src/auth/oauth.ts:89
  Token refresh has no retry — a single 503 kills the session
  fix: Wrap in exponential backoff (3 retries)

  WARNING  src/auth/oauth.ts:142
  Access token stored in localStorage — vulnerable to XSS
  fix: Move to httpOnly cookie

  VERDICT: Changes requested

? What next?
❯ Accept review
  Give feedback — explain why an issue is incorrect
  Post to PR — post as a comment on the PR

Install

You need Claude Code installed and logged in. prai uses your existing subscription — no extra API keys or costs.

npm install -g prai-review

Or build from source:

git clone https://github.com/shubham-jangid/prai.git
cd prai && npm install && npm run build && npm link

Setup (one time)

prai init

That's it. prai detects your forge from the git remote and walks you through auth:

  • GitHub — personal access token with repo scope
  • Bitbucket — email + API token
  • GitLab — personal access token with api scope

Self-hosted GitHub Enterprise and GitLab instances are supported automatically.

Usage

prai              # pick a PR interactively
prai 47           # review PR #47 directly
prai describe 47  # generate a PR description
prai list         # list open PRs

That's the whole CLI. No config files, no YAML pipelines, no CI setup.

Guide the review

Tell Claude what to focus on:

prai 47 --focus "security, error handling"
prai 47 --context "migrating auth from JWT to sessions"
prai 47 --prompt "check for N+1 queries and missing indexes"

Or just run prai with no flags — it'll ask you interactively after you pick a PR.

Deep review

By default, prai does a quick review (~1 min). For thorough reviews where Claude reads every changed file, checks callers, and verifies tests:

prai 47 --deep

Takes 3-5 minutes but catches significantly more.

Push back on findings

Disagree with something? Choose Give feedback after the review, explain why an issue is correct or intentional, and Claude re-evaluates. It drops justified issues and keeps valid ones. Go back and forth as many rounds as you need.

Post to PR

prai 47 --post

Posts the review as a comment on the PR.

Team rules

Drop a .prai/rules.yaml in your repo to customize reviews for your whole team:

# .prai/rules.yaml
high_risk_modules:
  - src/auth/
  - src/payments/
  - db/migrations/

suppress:
  - test-naming-conventions
  - import-ordering

architecture_rules:
  - "All API endpoints must validate input with zod schemas"
  - "Database queries must go through the repository layer"

custom_instructions: |
  Our team uses Result types instead of exceptions.
  Flag any throw statements in service layer code.

Use inside Claude Code

prai ships as a Claude Code skill:

/prai           # interactive PR review
/prai 47        # review PR #47
/prai describe  # generate PR description

All flags

| Flag | What it does | |---|---| | --focus | Narrow review to specific areas | | --context | Explain what the change is about | | --prompt | Custom review instructions | | --deep | Read every changed file in full | | --post | Post review as a PR comment | | --verbose | Show the full prompt sent to Claude |

How it works

┌─────────┐     ┌───────────────┐     ┌──────────────┐
│  prai   │────▶│  Forge API    │────▶│  PR metadata │
│  CLI    │     │  (GH/BB/GL)   │     │  + branches  │
└────┬────┘     └───────────────┘     └──────────────┘
     │
     │  git worktree add /tmp/prai-review-47
     ▼
┌──────────────────────────────┐
│  Isolated worktree           │
│  (your working dir untouched)│
│  git diff origin/main...HEAD │
└────────────┬─────────────────┘
             │
             ▼
┌──────────────────────────────┐
│  Composable Prompt Pipeline  │
│                              │
│  base review rules           │
│  + tool guidance             │
│  + review checklist          │
│  + PR context (title, desc,  │
│    branch intent, commits)   │
│  + team rules (.prai/rules)  │
│  + --focus areas             │
│  + --context explanation     │
│  + --prompt custom instr.    │
│  + adaptive hints (by size)  │
│  + feedback history          │
│  + diff                      │
└────────────┬─────────────────┘
             │
             ▼
┌──────────────────────────────┐
│  Claude Code CLI             │
│  (runs locally, reads files) │
│  --allowedTools Read,Grep,   │
│                 Glob         │
└────────────┬─────────────────┘
             │
             │  structured JSON review
             ▼
┌──────────────────────────────┐
│  Terminal output + optional  │
│  post to forge as PR comment │
└──────────────────────────────┘

Key design decisions:

  • Worktree isolation — temporary git worktree so prai never touches your working directory. Cleaned up automatically, even on Ctrl+C.
  • Full file reading — Claude reads changed files and their imports, not just the diff. This avoids false positives from missing context.
  • Composable prompt pipeline — the prompt is assembled from independent segments. Each is a pure function returning a string. Empty segments are skipped.
  • Adaptive depth — small diffs (<100 lines) get deep-dive instructions. Large diffs (>500 lines) get instructions to prioritize critical paths. Over 8000 lines are truncated with a warning.
  • Two-pass review — critical issues (security, data safety) separated from warnings (performance, style).
  • Supervised review — feedback is injected as a new prompt segment. Claude re-evaluates with full context of previous findings and your explanations.
src/
  index.ts        # CLI entry point, command routing, signal handling
  api.ts          # HTTP client for GitHub/Bitbucket/GitLab APIs
  credentials.ts  # Credential storage (~/.prai/credentials.json)
  forge.ts        # Auto-detect forge type from git remote
  git.ts          # Worktree management, diff, commit log
  reviewer.ts     # Claude invocation, prompt building, output parsing
  init.ts         # Interactive setup wizard
  ui.ts           # Terminal formatting, spinners, markdown export

License

MIT