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

@hdehler/diffai

v1.0.0

Published

A beautiful git diff viewer — diff branches clearly and export structured summaries for AI

Downloads

23

Readme

diffai

A beautiful, interactive git diff viewer built for reviewing AI-written code. Side-by-side layout, mouse scroll, multi-repo support, and structured output that Claude can read directly.


Why

When you use AI to write code and then commit it, the changes blur together quickly. git diff in the terminal is noisy, Cursor's diff view disappears once you're on a branch, and trying to understand what was actually changed — and why it matters — is hard.

diffai gives you a proper side-by-side viewer with keyboard and trackpad navigation, a web UI for deep dives, and --summary / --json flags you can pipe straight into Claude.


Install

Requirements: Node.js 18+

# Clone and install globally
git clone https://github.com/harrydehler/diffai.git ~/diffai
cd ~/diffai
npm install
npm install -g .

Install tab completion (zsh / bash):

diffai completion install
# Then restart your terminal, or:
source ~/.zshrc

Usage

diffai                          # current branch vs main (interactive TUI)
diffai main feature-branch      # compare any two branches
diffai HEAD~5 HEAD              # last 5 commits
diffai abc123 def456            # compare two SHAs

diffai --repo inventory         # diff a saved repo (see: config)
diffai --all                    # diff all saved repos in sequence

Views

Interactive TUI (default)

Running diffai in a terminal opens a full-screen viewer.

────────────────────────────────────────────────────────────────
  src/auth.js  modified  +12  -4
  main → feature-login  3/5 ██████████░░░░░░
────────────────────────────────────────────────────────────────
  BEFORE                          │ AFTER
────────────────────────────────────────────────────────────────
   4 - const jwt = require("jsonw… │   4 + import jwt from 'jsonwebto…
   5   const db  = require('./db') │   5   import db from './db.js'

Keyboard controls:

| Key | Action | |-----|--------| | / n / Enter | Next file | | / p | Previous file | | / k | Scroll up 1 line | | / j | Scroll down 1 line | | Space / d | Page down | | u | Page up | | 19 | Jump to file by number | | o | Back to overview | | q / Ctrl+C | Quit |

Trackpad / mouse wheel also scrolls up and down within a file.


Web UI

diffai --web
diffai main feature-branch --web

Opens a GitHub-style diff in your browser — file sidebar, sticky file headers, side-by-side layout, keyboard shortcuts. Best for large diffs or sharing.


Other output modes

diffai --flat        # non-interactive, scrollable output (piping / CI)
diffai --stat        # file overview only — no diff body
diffai --summary     # plain-text summary — paste into Claude
diffai --json        # structured JSON — Claude or scripts can parse this directly
diffai --file src/   # filter to files whose path contains this string

Multi-repo config

Save repo shortcuts so you don't have to type paths:

diffai config add inventory ~/inventory
diffai config add sales     ~/sales-display
diffai config add rma       ~/rma

diffai config list           # list all saved repos
diffai config remove sales   # remove one

Then use them anywhere:

diffai --repo inventory               # inventory: current branch vs main
diffai --repo inventory main feat     # inventory: specific branches
diffai --all                          # diff every saved repo in sequence
diffai --all --summary                # AI summary across all repos

Using with Claude

diffai --summary and diffai --json are designed to be fed directly into Claude.

Quick paste:

diffai --summary | pbcopy   # copy to clipboard, paste into Claude

In a Claude Code session:

# Claude can run this directly
diffai --json
diffai --repo inventory --summary

Ask Claude things like:

  • "Walk me through what changed and why each change matters"
  • "Which of these changes could introduce bugs?"
  • "Summarize this diff for a PR description"

The /diffai-review custom command (if installed) runs the full analysis automatically — it fetches the diff, looks up function definitions, and explains the context behind each change.


Untracked files

diffai automatically includes untracked files (new files not yet committed) when comparing against your current branch. They appear at the end of the file list marked as added.


Tab completion

After running diffai completion install, tab-completing works for:

  • Branch names — auto-fetched from git branch -a
  • Saved repo names — auto-fetched from your config
diffai main <TAB>         # complete branch names
diffai --repo <TAB>       # complete saved repo names

Options reference

diffai [base] [head] [options]

Arguments:
  base    Base ref to compare against (default: main/master)
  head    Head ref to compare (default: current branch)

Options:
  -r, --repo <name>      Run against a saved repo by name
  -A, --all              Run across all saved repos in sequence
  -w, --web              Open a web UI in the browser
  -s, --stat             File overview only
  -F, --flat             Non-interactive scrollable output
  -S, --summary          Plain-text summary for Claude
  -j, --json             Structured JSON output
  -f, --file <pattern>   Show only files whose path contains this string
  -C, --cwd <path>       Run against a repo at this path
  -h, --help             Show help
  -V, --version          Show version

License

MIT — Harry Dehler