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

@scopediff-dev/cli

v0.2.0

Published

Local-first CLI that checks whether AI-generated code changes stay within task scope.

Readme

ScopeDiff

Let AI write code without letting it rewrite your project.

ScopeDiff reports when AI-generated code changes drift outside the scope a task declared. It runs locally, requires no API key, and works with Cursor, Codex, Claude Code, and other AI coding workflows.

Most AI code review tools ask:

Is this code good?

ScopeDiff asks:

Was this code supposed to change?

How it answers that

ScopeDiff does not try to guess your intent from a prompt. Instead, the task declares its scope up front — the paths it expects to touch — and ScopeDiff compares the actual diff against that declaration. It is an attention router: it points you (or your agent) at the few changes that fall outside the declared scope, and gets out of the way for everything that's in scope.

Its guiding principle is trust over coverage: only high-confidence facts (an undeclared dependency/lockfile/migration/CI/secret change) ever block. Fuzzy, inferred findings are surfaced for review but never block.

Why ScopeDiff

AI coding agents are useful, but they drift: touching unrelated modules, changing dependencies, deleting tests, or rewriting build files while solving a narrow task. ScopeDiff catches that drift before you finish a task or open a PR.

Declared scope (recommended)

At the start of a task, declare what it should touch:

scopediff intent --task "fix login empty password returns 400" --allow "src/auth/**"

This writes .scopediff/intent.json. Then, after changes, check the diff:

scopediff check

Example output (declared src/auth/**, but the diff also touched package.json and src/payment/):

ScopeDiff Report

Mode:
  scope

Declared scope:
  task: fix login empty password returns 400
  allow: src/auth/**

Summary:
  1 high, 1 medium, 0 info
  3 files, 6 changed lines

High Risk:
  [SD019] High-risk file changed outside declared scope
  file: package.json
  reason: This file was changed but is not covered by the declared scope (src/auth/**). High-risk files require an explicit declaration.
  blocking: true

Potential Scope Drift:
  [SD019] Potential scope drift: file changed outside declared scope
  file: src/payment/PaymentService.ts
  reason: This file was changed but is not covered by the declared scope (src/auth/**). Please review whether it belongs in this task.

Result:
  failed because 1 blocking finding(s) were found.

Files inside the declared scope (and test files) stay silent. An undeclared high-risk file blocks; an undeclared ordinary source file is a non-blocking review note; an undeclared docs file is informational.

Without a declaration

If there is no .scopediff/intent.json, ScopeDiff degrades gracefully:

  • Deterministic danger tripwires still fire on fact — env/secret changes, test deletion, and large deletions are flagged regardless of scope.
  • Keyword heuristics become a best-effort fallback — it guesses task domains from a prompt or branch name. These findings are review hints and never block.

You can still pass context explicitly:

scopediff check --prompt "fix login empty password returns 400"
scopediff check --prompt-file task.md

Diff source

scopediff check            # git diff HEAD (all tracked changes)
scopediff check --staged   # git diff --staged
scopediff check --base main # git diff main...HEAD

Agent workflows

scopediff init cursor
scopediff init codex
scopediff init claude

Execution differs by tool, and ScopeDiff is honest about it:

| Tool | Enforcement | How | | --- | --- | --- | | Claude Code | Hard | init claude installs a Stop hook (scopediff check --hook) that runs automatically before the agent finishes and sends it back on blocking findings. Merged into .claude/settings.json. | | Cursor | Soft (best-effort) | .cursor/rules/scopediff.mdc asks the agent to declare scope and check. The agent may skip it. | | Codex | Soft (best-effort) | AGENTS.md asks the agent to declare scope and check. The agent may skip it. |

Deterministic post-turn hooks for Cursor and Codex are not yet supported here; on those tools enforcement is best-effort until that is verified.

Configuration

scopediff init   # writes scopediff.yml

ScopeDiff reads scopediff.yml from the current project.

Exit codes

  • 0: passed
  • 1: blocked by findings at or above the configured fail_on (default: HIGH)
  • 2: runtime or config error

Privacy

ScopeDiff runs locally. Your code, diffs, and task context are not uploaded. No API key is required. No LLM is used — semantic judgment, when needed, is left to the coding agent already in your editor.

Roadmap

  • v0.1: CLI, local rules, config, Risk Mode, Agent Pack
  • v0.2: declared-intent scope engine, Claude Code Stop hook, honest agent docs
  • v0.2.x: verify Cursor/Codex hooks, file-level scope precision, more rules
  • v1.0: PR bot, team policies, dashboard

License

MIT