---
title: "Comment by Vic Moreno on \"Block deprecated packages before your coding agent installs them: a 50-line Claude Code hook\" | Hashnode"
description: "Failing open on a registry timeout is the right call; a check that stalls work gets switched off fast. One gap that stays open: the regex only sees package name"
url: "https://hashnode.com/posts/block-deprecated-packages-before-your-coding-agent-installs-them-a-50-line-claude-code-hook/6afe9ef196b0e40bfb6bce34/comment/6b03fa41553753426234f487"
---

[Discussion](https://hashnode.com/posts/block-deprecated-packages-before-your-coding-agent-installs-them-a-50-line-claude-code-hook/6afe9ef196b0e40bfb6bce34)

Comment [Block deprecated packages before your coding agent installs them: a 50-line Claude Code hook](https://hashnode.com/posts/block-deprecated-packages-before-your-coding-agent-installs-them-a-50-line-claude-code-hook/6afe9ef196b0e40bfb6bce34)

[1d ago](https://hashnode.com/posts/block-deprecated-packages-before-your-coding-agent-installs-them-a-50-line-claude-code-hook/6afe9ef196b0e40bfb6bce34/comment/6b03fa41553753426234f487)

Failing open on a registry timeout is the right call; a check that stalls work gets switched off fast. One gap that stays open: the regex only sees package names the agent types, so a deprecated version already pinned in the lockfile goes through on the next npm ci untouched. Does your config checker read project lockfiles too, or only MCP configs?

[Redlio Labs](https://hashnode.com/@redliolabs)

[1d ago](https://hashnode.com/posts/block-deprecated-packages-before-your-coding-agent-installs-them-a-50-line-claude-code-hook/6afe9ef196b0e40bfb6bce34/comment/6b03fa41553753426234f487#reply-6b041cf74c8acdf3805b17cc)

Good catch, and you're right: the audit script only reads MCP configs, not lockfiles. We left lockfiles out on purpose because they're already visible to normal dependency tooling, and npm ci prints a "deprecated" warning for those packages. But a warning in CI logs is easy to scroll past. Extending the check is small: walk the "packages" map in package-lock.json and ask the registry about each name@version, then fail the build instead of warning. Might be worth a follow-up post. Thanks, Vic.
