# claude-plugin-snyk
A Claude Code plugin that integrates Snyk security scanning into the agentic development loop. It catches vulnerabilities as Claude writes code — not after.
## What it does
**Secure at Inception (hooks)** — background Snyk scans run on every file edit. When Claude finishes a response, the plugin checks whether any newly written lines introduced vulnerabilities. If so, Claude is blocked from stopping and given a table of issues to fix. The cycle repeats until the code is clean (capped at 3 rounds to prevent infinite loops). Dependency manifest changes trigger SCA scans too.
**`/snyk-fix` command** — on-demand security remediation. Scans for SAST and/or SCA vulnerabilities, selects the highest-priority issue, fixes it, validates with a re-scan, and optionally opens a PR.
**Secure Dependency Health Check (skill)** — automatically evaluates open-source packages when Claude is about to add a dependency. Compares candidates on vulnerability history, maintenance health, and popularity using the Snyk package intelligence API.
## Prerequisites
- [Claude Code](https://claude.ai/code) with plugin support
- [Snyk CLI](https://docs.snyk.io/snyk-cli/install-the-snyk-cli): `npm install -g snyk && snyk auth`
- [uv](https://docs.astral.sh/uv/getting-started/installation/) (used to run the hook scripts)
- A Snyk account (free tier works)
## Installation
Install via the Claude Code plugin system:
```bash
claude plugin install https://github.com/snyk/claude-plugin-snyk
```
Or add it locally by pointing Claude Code at this directory.
## Configuration
| Variable | Default | Description |
|----------|---------|-------------|
| `SAI_MIN_BLOCK_SEVERITY` | `medium` | Minimum SCA severity that blocks Claude from stopping (`critical`, `high`, `medium`, `low`) |
| `CLAUDE_HOOK_DEBUG` | `0` | Set to `1` for verbose hook logging |
## What's included
| Component | Type | Description |
|-----------|------|-------------|
| Secure at Inception | Hooks | Background SAST + SCA scanning on every edit |
| `/snyk-fix` | Command | Full remediation workflow with optional PR |
| Secure Dependency Health Check | Skill | Package evaluation before adding dependencies |
| Snyk MCP server | MCP | Gives Claude access to Snyk scan and advisory tools |
## License
Apache 2.0
> This repository is closed to public contributions.