DEV Community

Cover image for Step-by-step guide: scan your codebase for vulnerabilities with Claude Code
Daniel (San) Ávila
Daniel (San) Ávila

Posted on Originally published at Medium

Step-by-step guide: scan your codebase for vulnerabilities with Claude Code

A few days ago I got my first report from Anthropic’s OSS Scanner. That same week another security disclosure landed for a tool I use.

Two reminders in a few days that I don’t really know what is sitting in my own repos.

So I went looking for something I could run myself, on any project, before I ship. What I use now is a Claude Code skill called vulnerability-scanner. One command to install, then you just ask Claude to check the project. Here’s what it does, how to set it up, and whether it’s worth your time.

What it actually looks for

Most security tools pattern match. This one reads your code.

It starts by mapping the attack surface: your routes, webhooks, CLI arguments, uploads, scheduled jobs, and the place where a request turns into a user with a role and a tenant. Only then does it start judging lines.

The part I care about is the AI side. If your project calls a model, the skill asks three questions about every call. What untrusted text reaches the prompt? What is the model allowed to do? Where does its output end up? That is prompt injection, tool abuse and MCP servers with too much reach, in three questions.

It also reads the files most scanners walk past: your CLAUDE.md, your skills, your hooks, your .mcp.json. A hidden instruction aimed at an agent counts as a finding, not as a task.

And it will not hand you a grep hit and call it a bug. A pattern match is a lead. It has to trace the data from something an attacker controls to somewhere that hurts before it reports anything, and if it can refute the lead it drops it. That is the step that keeps the noise down, and it is the step most tools skip.

How to install it

One command, in your project folder:

npx claude-code-templates@latest --skill security/vulnerability-scanner
Enter fullscreen mode Exit fullscreen mode

That writes three files into .claude/skills/vulnerability-scanner/. Nothing else in your setup changes.

You don’t need to remember a command after that. Claude Code loads every skill’s description at the start of a session and pulls in the full skill only when it matches, so “check this project for security problems before I ship” is enough. If you’d rather be explicit, type /vulnerability-scanner at the start of your message.

The skill lives in Claude Code Templates, the open catalog I maintain, so it is a plain markdown file you can read before you trust it. It is also read-only by design: it reports, it doesn’t edit.

What you get back

Findings, worst first, one block each: severity with its OWASP id, the file and line, the attack step by step, what the attacker gets out of it, and the fix.

Then two sections you rarely get from a scanner.

“Checked, not a problem” lists the scary-looking code it ruled out and why, so you don’t re-report the same execFile call next month. “Not covered” lists what it could not check: runtime config, infrastructure, dependencies it couldn’t resolve, files it skipped.

That second list is the useful one. It tells you where you are still blind.

Is it worth it?

Yes, with one thing in mind.

A month ago I was looking at Cloudflare’s security audit skill and one detail stuck with me. A single audit run found only about half the vulnerabilities that turned up across several runs. An AI security audit is not a checkbox you tick once.

So run it more than once, and point it at different parts of the project. It also doesn’t replace semgrep or npm audit. If you already have those installed it will read their output as extra leads, which is the right way around.

The read-only rule is what makes that easy. I can point it at a client repo, or at a repo I don’t own, and the worst case is a report I disagree with. Nothing gets installed, nothing gets rewritten, no build script runs.

What it does better than any of them is the new part: looking at an agent, its tool list and its prompt, and telling you how somebody would turn that against you.

Install it and point it at your messiest project. You will find something.

Links

You can follow me on my social media:

Top comments (0)