{"slug": "scan-your-codebase-for-vulnerabilities", "title": "Scan Your Codebase for Vulnerabilities", "summary": "Anthropic released a Claude Code plugin that scans codebases for vulnerabilities, allowing developers to review and apply patches locally. The plugin runs on Claude Code v2.1.154 or later, supports GitLab and Bitbucket repositories, and counts scans against plan usage limits.", "body_md": "[only a set of changes](#scan-only-your-changes), such as a branch’s diff, a pull request’s diff, or a single commit, then turn the findings you choose into patches that you review and apply yourself. The plugin runs locally in your session, and each scan counts against your plan’s usage limits. If you want a managed service that monitors your repositories, see the\n\n[Claude Security](https://claude.com/product/claude-security)product, available on the Enterprise plan. The plugin reaches code the managed product can’t reach, such as repositories hosted on GitLab or Bitbucket, or on networks that don’t allow inbound connections. The plugin is also distinct from the review tools already in Claude Code: the\n\n[security guidance plugin](/docs/en/security-guidance)reviews code as Claude writes it,\n\n[runs a single pass over your branch, and](/docs/en/commands#all-commands)\n\n`/security-review`\n\n[Code Review](/docs/en/code-review)reviews pull requests. For how the layers stack, see\n\n[How the plugin fits with other security tools](#how-the-plugin-fits-with-other-security-tools).\n\n## Prerequisites\n\nTo run the plugin, you need:- Claude Code v2.1.154 or later on a paid plan, for the\n[dynamic workflows](/docs/en/workflows)the scan uses to orchestrate its agents. On Pro, turn them on from the Dynamic workflows row in`/config`\n\n. - Python 3.9.6 or later available on your\n`PATH`\n\nas`python3`\n\n. Check with`python3 --version`\n\n. The plugin’s tooling uses only the Python standard library, so nothing is installed. - Linux, macOS, or Windows.\n- Git, for change scans and for turning findings into patches; those jobs don’t support other version control systems. A full scan works in any directory, with or without version control.\n\n## Install the plugin\n\nIn a Claude Code session, install from the[official Anthropic marketplace](/docs/en/discover-plugins#official-anthropic-marketplace):\n\nIf Claude Code reports that the marketplace is not found, run\n\n`/plugin marketplace add anthropics/claude-plugins-official`\n\nfirst, then retry the install.`/reload-plugins`\n\n, which applies pending plugin changes without a restart:\n[scan and fix your codebase](#scan-and-fix-your-codebase).\n\n### Uninstall the plugin\n\nTo remove the plugin, uninstall it from the`/plugin`\n\nmenu, or run `claude plugin uninstall claude-security`\n\nin your terminal.\n## Scan and fix your codebase\n\nThe plugin adds one command,`/claude-security`\n\n, which opens a menu of its three jobs: scanning the codebase, scanning a set of changes, and suggesting patches. The happy path runs a full scan, then turns its findings into patches:\n1\n\nOpen the Claude Security menu\n\nRun\n\n`/claude-security`\n\nand pick **Scan codebase**.2\n\nChoose what to scan\n\nThe plugin reads your repository first, then offers the whole repository or a focused area, with each option’s file count and relative cost stated. Pick the whole repository, or answer “I don’t know” and the plugin picks a sensible default for your repository’s size.\n\n3\n\nConfirm the run\n\nA scan may take a while, may use a significant number of tokens, and needs Claude Code left open while it completes. Nothing runs until you confirm.\n\n4\n\nRead the report\n\nWhile the scan runs, it reports each stage as it starts, with the detail available under\n\n[. Results land in a timestamped directory in your repository, described in](/docs/en/workflows)`/workflows`\n\n[Read the scan results](#read-the-scan-results).5\n\nTurn findings into patches\n\nRun\n\n`/claude-security`\n\nagain and pick **Suggest patches**, then choose which findings to address. Reviewed patches land in the report’s`patches/`\n\nfolder; [Fix findings](#fix-findings)covers how each patch is built and reviewed.6\n\nApply the patches you accept\n\nApply each patch from your shell with\n\n`git apply`\n\n, in its own pull request. Patches are never applied automatically.`/claude-security scan my branch`\n\n, or in plain language, such as “scan commit abc1234”. The plugin works best in [auto mode](/docs/en/permission-modes), which lets the scan’s agents proceed without a permission prompt at each step; the plugin reminds you how to enable it when a job starts.\n\n### Scan only your changes\n\nWhen your branch has commits its base doesn’t, the`/claude-security`\n\nmenu offers to scan only that diff, so you can check a branch before merging. You can also scan one of your open pull requests, or a single commit by asking for it, such as “scan commit abc1234”. Only committed changes are scanned: commit or stash in-progress edits first, or run a full scan, which reads the working tree.\nChange scans need a git repository; full scans of an unversioned directory still work. Finding your open pull requests is the one step that reaches the network, and it’s offered only when your session already has permission to run the GitHub CLI and `gh`\n\nis signed in.\n### Scope large repositories\n\nOn a large repository, scan one area at a time instead of the whole tree. Pick one of the focused scopes the plugin offers, such as your API layer or your authentication code, and the run sizes itself to what you pick. The report’s coverage section states what was and wasn’t examined. Run another scan on a different area anytime.### Read the scan results\n\nEvery scan writes its results into a timestamped`CLAUDE-SECURITY-<timestamp>/`\n\ndirectory in your repository:\n: the report, with each finding’s ID, such as`CLAUDE-SECURITY-RESULTS.md`\n\n`F1`\n\n, plus its impact, exploit scenario, severity, confidence, and recommendation: the same findings in machine-readable form, one JSON object per line`CLAUDE-SECURITY-RESULTS.jsonl`\n\n: the revision stamp, recording which commit was scanned, at what effort, whether uncommitted changes were part of the scanned tree, and how thoroughly the run was verified, so a report is always tied to the code it describes. A scan outside version control stamps`CLAUDE-SECURITY-REVISION-<commit>.json`\n\n`UNVERSIONED`\n\nin place of the commit\n\n`.gitignore`\n\n, so a stray `git add`\n\nnever sweeps a report into a commit. To keep a report in history for an audit trail, delete that one `.gitignore`\n\nfile and commit the directory like any other.\nFindings only appear in the report after independent verifier agents analyze them, which keeps reports short and worth reading. Scans are nondeterministic: two scans of the same code can surface different findings. Run scans regularly, and use the revision stamps to attribute each report to the exact code and settings it covered.\n## Fix findings\n\nStart the fix flow by picking**Suggest patches** from the\n\n`/claude-security`\n\nmenu, or ask in plain language, such as “fix finding F3”, then pick which findings from the report to address. Patches are built against committed code, and the report has to still describe the code you have: findings whose code has since changed are skipped with a note, and the plugin offers a fresh scan instead of patching from a stale report. Each patch is drafted in a scratch copy of your repository, so your source files stay untouched until you apply a patch yourself.\nBefore delivery, each patch is reviewed by an agent independent of the one that wrote it, which runs your project’s tests against the change when the code has them and reads the diff on its own terms for anything new it might introduce. A patch is written only when that review can vouch that the change addresses the one finding, introduces no new vulnerability, and leaves behavior otherwise unchanged. When it can’t vouch for all three, you get a short note explaining why instead of a patch.\n### Patches are never applied automatically\n\nApplying a patch is always your decision. Patches land in the report’s`patches/`\n\nfolder, one `F<n>.patch`\n\nper finding with a note beside it explaining the change. Apply one from your shell, or ask Claude to apply it and open a pull request:\n## Scan repositories you don’t trust\n\nThe plugin is built for scanning code you control, where the question is which bugs are in the code rather than whether the code is trying something. A scan runs in your session, under your permissions, and adds no isolation of its own: the repository’s committed`.claude/`\n\nsettings, hooks, and `CLAUDE.md`\n\napply exactly as they would in any other session. The scan treats everything the repository says, in code, comments, and findings text, as data under review rather than instructions, but that isn’t a defense against a hostile repository.\nTo scan a repository you don’t fully trust, such as a third-party dependency or an unfamiliar codebase, sandbox the whole session first. [sandbox-runtime](https://github.com/anthropic-experimental/sandbox-runtime)enforces filesystem and network restrictions at the operating-system level; its README covers how to run Claude Code inside it.\n\n## How the plugin fits with other security tools\n\nThe Claude Security plugin is the on-demand deep-scan layer in a defense-in-depth stack, alongside the[security guidance plugin](/docs/en/security-guidance),\n\n[,](/docs/en/commands#all-commands)\n\n`/security-review`\n\n[Code Review](/docs/en/code-review), the managed\n\n[Claude Security](https://claude.com/product/claude-security)product, and your existing scanners:\n\nThe plugin doesn’t replace your existing source-code security tools. Run it alongside static analysis, dependency scanning, and code review: it reasons about your code the way a human security researcher would, which complements the deterministic checks those tools provide.\n\n## Troubleshooting\n\n**The** The plugin needs\n\n`/claude-security`\n\nmenu opens with a Python warning.`python3`\n\n3.9.6 or later on your `PATH`\n\n. When it can’t find `python3`\n\nat all, the menu warns that Claude Security won’t work until one is installed; when the first `python3`\n\non your `PATH`\n\nis older, the warning names the version it found. Install Python 3, or put a newer `python3`\n\nfirst on your `PATH`\n\n, then start a new session.\n## Related resources\n\nTo go deeper on the pieces this page touches:[Security guidance plugin](/docs/en/security-guidance): catch issues in code as Claude writes it, in the same session[Code Review](/docs/en/code-review): set up the PR-time multi-agent review[Claude Security](https://claude.com/product/claude-security): the managed service that monitors connected repositories[Claude Code security](/docs/en/security): how Claude Code approaches trust, permissions, and safeguards[Discover and install plugins](/docs/en/discover-plugins#official-anthropic-marketplace): browse other official plugins", "url": "https://wpnews.pro/news/scan-your-codebase-for-vulnerabilities", "canonical_source": "https://code.claude.com/docs/en/claude-security", "published_at": "2026-07-22 19:32:26+00:00", "updated_at": "2026-07-22 19:52:41.568044+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-safety"], "entities": ["Anthropic", "Claude Code", "Claude Security", "GitLab", "Bitbucket"], "alternates": {"html": "https://wpnews.pro/news/scan-your-codebase-for-vulnerabilities", "markdown": "https://wpnews.pro/news/scan-your-codebase-for-vulnerabilities.md", "text": "https://wpnews.pro/news/scan-your-codebase-for-vulnerabilities.txt", "jsonld": "https://wpnews.pro/news/scan-your-codebase-for-vulnerabilities.jsonld"}}