Text of code.claude.com › docs › en › claude-security as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Scan your codebase for vulnerabilities - Claude Code Docs

Documentation Index Fetch the complete documentation index at: /docs/llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. The Claude Security plugin runs a multi-agent vulnerability scan of your codebase inside a Claude Code session. By default , when you scan a whole repository, Claude agents map your architecture, build a threat model, hunt for vulnerabilities, and independently review every finding before writing the report.

Use the plugin to scan a whole repository or only a set of 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, uses whichever models you have access to in Claude Code , and each scan counts toward your usage . If you want a managed service that monitors your repositories, or want to run scans on Claude Mythos , see the Claude Security product, available on the Enterprise plan.

The plugin is also distinct from the review tools already in Claude Code: the security guidance plugin reviews code as Claude writes it, /security-review runs a single pass over your branch, and Code Review reviews pull requests. For how the layers stack, see How the plugin fits with other security tools . Prerequisites To run the plugin, you need: A paid plan, Anthropic API access, or a third-party provider , for the dynamic workflows the scan uses to orchestrate its agents.

On Pro, turn them on from the Dynamic workflows row in /config . Python 3.9 or later available on your PATH as python3 . Check with python3 --version . The plugin’s tooling uses only the Python standard library, so nothing is installed. Linux, macOS, or Windows. 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.

Models and providers A scan runs inside your Claude Code session. The plugin makes no model calls of its own, so there’s no separate API key or provider setting to configure. Model : the agents that hunt for vulnerabilities, verify findings, and write and review patches run on your session’s model . To change it, run /model in your session before you start a scan. A few supporting steps, such as mapping the repository, use the sonnet alias instead.

Provider : scans run on a paid plan, with Anthropic API access, or on a third-party provider such as Amazon Bedrock , Google Cloud’s Agent Platform , or Microsoft Foundry . On a third-party provider, the sonnet alias can resolve to a different version than it does on the Anthropic API. If your account can’t use that version, pin your model versions , including ANTHROPIC_DEFAULT_SONNET_MODEL . Automatic model fallback re-runs a request that a model’s safeguards flag.

On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the request can end with a refusal message instead, depending on how your deployment is set up . Install the plugin In the VS Code extension or the desktop app, install it by following Install a plugin . In a terminal, start Claude Code by running claude , then enter this at its prompt to install from the official Anthropic marketplace : /plugin install claude-security@claude-plugins-official The command opens the plugin’s details, where you choose an installation scope to start the install.

If the install fails, match the message Claude Code reports: Marketplace "claude-plugins-official" not found : add the marketplace with /plugin marketplace add anthropics/claude-plugins-official , then retry the install. Plugin "claude-security" not found in marketplace "claude-plugins-official" : your local copy of the marketplace catalog may be out of date. Refresh it with /plugin marketplace update claude-plugins-official , then retry the install.

If the retry prints the same message, see Plugin not found in marketplace . Check the install summary. If it reports Run /reload-plugins to apply. , see Apply plugin changes without restarting to activate the plugin in your current session. Once the plugin is active, you’re ready to scan and fix your codebase . Update the plugin To update the plugin yourself, see Update plugins now . Claude Code also updates the plugin automatically unless auto-update is turned off.

Uninstall the plugin To remove the plugin, uninstall it from the /plugin menu, or run claude plugin uninstall claude-security in your terminal. Scan and fix your codebase The plugin adds one command, /claude-security , 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: 1 Open the Claude Security menu Run /claude-security and pick Scan codebase .

2 Choose what to scan The plugin reads your repository first, then offers the whole repository or a focused area. Pick the whole repository, or answer “I don’t know” and the plugin picks a sensible default for your repository’s size. 3 Confirm the run A 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. 4 Read the report While the scan runs, it reports each stage as it starts, with the detail available under /workflows .

Results are written to a timestamped directory in your repository, described in Read the scan results . 5 Turn findings into patches Run /claude-security again and pick Suggest patches , then choose which findings to address. Reviewed patches are written to the report’s patches/ folder; Fix findings covers how each patch is built and reviewed. 6 Apply the patches you accept Apply each patch from your shell with git apply , in its own pull request.

Patches are never applied automatically. You don’t have to start from the menu: ask for a job directly, as arguments to the command, such as /claude-security scan my branch , or in plain language, such as “scan commit abc1234”. The plugin works best in auto mode , which lets the scan’s agents proceed without a permission prompt at each step. Scan only your changes When your branch has commits its base doesn’t, the /claude-security menu 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. Change scans need a git repository; full scans of an unversioned directory still work. Finding your open pull requests is offered only when your session already has permission to run the GitHub CLI and gh is signed in.

Scope large repositories On 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. Choose a scan effort Scan effort sets how deep a scan goes. Your findings go through the same independent verification at low , medium , and high . low : a quick first look.

It skips the architecture map and the threat model when you scan your codebase. medium : the default. high : what medium does, plus more hunting for vulnerabilities in the same code. Name the scan effort in your request at the Claude Code prompt, such as /claude-security scan my public API code at high or /claude-security scan my branch at high . If a scan of a large repository finds less than you expect, choose high scan effort, scan a second time, or do both.

Each can report findings that one medium scan doesn’t. Read the scan results Every scan w

The rest of this page is on the live site.