Startup check for dependency vulnerabilities in Claude Code, built after comparing tools
The author wrote a startup check for Claude Code. When a session starts, a SessionStart hook[1] compares the repository's dependencies (for example, those listed in package-lock.json) with a database of known vulnerabilities using osv-scanner[2]. If it finds any, Claude reports them in its first reply. The database is updated at most once a day for each language (npm, PyPI), and later checks that day use the local copy without a network connection.
Before building this, the author reviewed existing tools: the built-in /security-review, the security-guidance plugin, the claude-code-security-review GitHub Action, and CVE Sentinel. CVE Sentinel was the closest, but it queries online every time and does not check for secrets. The author kept osv-scanner for matching and wrote about 400 lines of Python standard-library code to handle when the database is updated and how results are passed to Claude.
A separate skill, /security-fullscan, also searches for leaked secrets with gitleaks[3] and writes a report. In git repositories, only the commit history is checked, and Claude receives the file name, line number and secret type, but not the secret value. The author also found that when the network fails during a database update, the result is empty and looks like "no vulnerabilities", so the script checks against the local database first.
Sources
-
JPZenn JA
Claude Code の起動時に依存パッケージの脆弱性を調べるハーネスを、既製品と比べたうえで自作した話




