dep-regret stops your AI agent (or you) from importing a 40 MB library for a
3-line job. For any package it shows the install size, how many dependencies
it drags in, and whether a standard-library or native feature already does the
job β then hands you a one-key, agent-ready prompt to inline it instead.
Try it in one line β no signup, no API key, no install:
go run github.com/agenticraptor/dep-regret/cmd/dep-regret@latest check momentOr
cdinto any npm / Python / Rust / Go project and just rundep-regret.
dep-regret Β· ~/code/my-app
npm Β· 12
REGRET left-pad (npm) 10 KB βΈ String.prototype.padStart()
RECONSIDER request (npm) 209 KB βΈ fetch() or undici
RECONSIDER node-fetch (npm) 107 KB βΈ global fetch()
RECONSIDER uuid (npm) 70 KB βΈ crypto.randomUUID()
RECONSIDER is-odd (npm) 7 KB βΈ n % 2 === 1
REVIEW moment (npm) 4.4 MB βΈ Intl.DateTimeFormat, Temporal, date-fnsβ¦
REVIEW lodash (npm) 1.4 MB βΈ native ES methods or single-method imports
KEEP express (npm) 75 KB βΈ looks reasonable
KEEP react (npm) 172 KB βΈ looks reasonable
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
You could save ~6.5 MB and 26 dependencies
by inlining 10 of 12 dependencies.
Run `dep-regret inline left-pad` for an agent-ready prompt to remove it.
AI coding agents add dependencies the way other people add browser tabs. A
prompt says "parse this date" and suddenly moment (4.4 MB) is in your
package.json. "Pad a string" pulls in left-pad. "Make a UUID" adds a package
for something crypto.randomUUID() has done natively for years. This is
a named, documented AI-tech-debt smell:
dependency churn and 50 MB transitive trees for one-line problems.
dep-regret is the gut-check that fits between "I want X" and "X is now a
permanent part of my supply chain":
- It quantifies the cost. Real install size (all four ecosystems) and direct-dependency count (npm and PyPI), pulled live from the registry β with an offline estimate when there's no network.
- It knows when a built-in already does it. A curated, human-reviewed
knowledge base maps commonly-regretted packages to their standard-library or
native replacement β
left-padβpadStart,pytzβzoneinfo,lazy_staticβLazyLock,github.com/pkg/errorsβfmt.Errorf("%w"). - It offers a way out.
dep-regret inline <pkg>prints a precise, copy-paste prompt that tells your coding agent exactly how to remove the dependency and replace it with native code.
And yes β
dep-regretitself has zero third-party dependencies. It would be a little awkward otherwise. The whole tool is one small static binary built from the Go standard library. Rundep-regreton its own repo and watch it report nothing to regret.
- π
scanany project and rank every dependency by a 0β100 regret score, with a quotable headline: "save ~6.5 MB and 26 dependencies." - π§ͺ
check <pkg>a single package before you add it β settle the "do I really need this?" argument in one command. - π§ Curated knowledge base of 70+ commonly-regretted packages across npm, PyPI, Cargo, and Go, each mapped to its native/stdlib replacement with a line-count estimate and a fair, nuanced note.
- π€
inline <pkg>generates an agent-ready prompt to vendor/replace the dep (works offline, no key). With--applyand an API key it drafts the replacement itself (Anthropic, OpenAI, or a local Ollama). - π‘οΈ
guardinstalls shell hooks sonpm install/pip install/cargo add/go getrun a check β and ask for confirmation β before a flagged package lands. - πͺ« Works with zero config and zero network. No registry access? You still get a verdict from the embedded knowledge base and size estimates.
- π¦ One tiny static binary. Zero dependencies. Naturally.
go install github.com/agenticraptor/dep-regret/cmd/dep-regret@latestGrab a binary for your OS/arch from the Releases page.
brew install agenticraptor/tap/dep-regretAvailable once the Homebrew tap is published β see the note in
.goreleaser.yamlto enable it.
git clone https://github.com/agenticraptor/dep-regret
cd dep-regret
make install# 1. Scan the project in the current directory (works with zero setup)
cd ~/code/my-app
dep-regret
# 2. Should I add this package? Check before you commit to it.
dep-regret check moment
dep-regret check left-pad@1.3.0 # a specific version
dep-regret check pytz -e pypi # pick the ecosystem explicitly
# 3. Get an agent-ready prompt to remove a dependency
dep-regret inline lodash # prints a prompt; pipe it to your agent
dep-regret inline lodash | pbcopy # β¦or straight to the clipboard
# 4. Guard your package managers (asks before adding a flagged dep)
dep-regret guard --install # adds a hook to your shell rc
# 5. Export a report for a PR or a teammate
dep-regret scan -f markdown -o dep-regret.mddep-regret [path] Scan a project and rank deps by regret (default)
dep-regret check <pkg>[@version] Analyze a single package before you add it
dep-regret inline <pkg> Print an agent-ready prompt to inline a dep
dep-regret guard Install/print package-manager confirmation hooks
dep-regret doctor Check your environment and registry access
dep-regret version
Common flags:
| Flag | Description |
|---|---|
-e, --ecosystem |
npm Β· pypi Β· cargo Β· go (auto-detected for scan) |
-f, --format |
term Β· markdown Β· json Β· plain (default: term) |
--offline |
Skip registry lookups; use only the embedded knowledge base |
--flagged |
(scan) show only flagged dependencies |
--top N |
(scan) show only the N most-regretted dependencies |
--apply |
(inline) draft the replacement with a configured LLM |
--color |
auto Β· always Β· never |
-o, --output <file> |
Write the report to a file |
The score is deterministic and explainable β no model, no magic. Given the same inputs it always produces the same number, which is what makes the headline ("save ~6.5 MB") trustworthy. Each dependency starts at 0 and accrues points:
| Signal | Points |
|---|---|
A standard-library / native feature does the job (has_stdlib) |
+55 |
It's a trivially-replaceable micro-package (micro) |
+60 |
It's deprecated or unmaintained (deprecated) |
+45 |
It's a heavyweight often used for a fraction of its surface (heavyweight) |
+25 |
| Registry reports it as deprecated | +40 |
| Install size | +3 / MB (max +30) |
| Direct dependency count (npm / PyPI) | +1 / dep (max +15) |
The total maps to a verdict:
| Score | Verdict | Meaning |
|---|---|---|
| 0β24 | KEEP | Looks reasonable. |
| 25β44 | REVIEW | Worth a look. |
| 45β69 | RECONSIDER | You probably have a lighter option. |
| 70β100 | REGRET | You almost certainly don't need this. |
Heavyweight, genuinely-useful libraries (axios, requests, testify) are
scored gently on purpose β dep-regret flags them for a second look, not a
witch hunt. See docs/scoring.md for the full rationale.
The "a built-in already does this" judgments come from a curated, human-reviewed
dataset (internal/knowledge/data/replacements.json),
embedded into the binary so it works offline. A few examples:
| Ecosystem | Package | Replace with | Since |
|---|---|---|---|
| npm | left-pad |
String.prototype.padStart() |
ES2017 |
| npm | uuid |
crypto.randomUUID() |
Node 14.17 |
| npm | node-fetch |
global fetch() |
Node 18 |
| PyPI | pytz |
zoneinfo |
Python 3.9 |
| PyPI | six |
(write Python 3) | β |
| Cargo | lazy_static |
std::sync::LazyLock |
Rust 1.80 |
| Cargo | num_cpus |
std::thread::available_parallelism() |
Rust 1.59 |
| Go | github.com/pkg/errors |
fmt.Errorf("%w", β¦) |
Go 1.13 |
| Go | github.com/sirupsen/logrus |
log/slog |
Go 1.21 |
Contributions to the knowledge base are the most valuable kind. Know a package that a built-in now replaces? Add an entry β it's one JSON object.
dep-regret guard --install # writes a hook into ~/.zshrc or ~/.bashrc
# (or `dep-regret guard --print` to see the snippet and add it yourself)After that, adding a flagged package pauses for confirmation:
$ npm install moment
moment (npm)
Verdict REVIEW (regret score 38/100)
Size 4.4 MB
Replace Intl.DateTimeFormat, Temporal, date-fns, or day.js
Add this dependency anyway? [y/N]
Remove it any time with dep-regret guard --uninstall.
dep-regret runs entirely on your machine. By default it makes read-only
requests to public package registries (npmjs.org, pypi.org, crates.io,
proxy.golang.org) to look up real install sizes β that's the only network it
touches. Pass --offline and it makes zero network calls, falling back to
the embedded knowledge base and size estimates. The optional inline --apply
feature is the only thing that contacts an LLM, and only when you ask it to.
manifest (package.json / requirements.txt / Cargo.toml / go.mod)
β
βββΊ parse dependencies ββ
β β
registry lookup ββββββββββββΌββΊ analyze βββΊ regret score + verdict βββΊ render
(size, dep count, β (knowledge base + size + deps) (term / md / json)
deprecation; optional) ββββ β
βββΊ inline βββΊ agent-ready prompt
(+ optional LLM draft)
Contributions are very welcome β see CONTRIBUTING.md. The highest-leverage contributions are new knowledge-base entries and support for more ecosystems (Ruby gems, Maven, NuGetβ¦). Please also read our Code of Conduct.
MIT Β© 2026 agenticraptor and dep-regret contributors.