Documentation

Hooks

Event-driven hooks that scan, track, and surface vulnerability intelligence automatically. Includes capability detection, dependency-add gating, container/IaC pre-checks, and prompt routing.

The Vulnetix plugin registers a set of hooks with Claude Code (and equivalents for Augment, CodeBuddy, Codex, Copilot, Cortex, Cursor, Gemini, iFlow, Kiro, OpenHands, Qoder, Qwen, Windsurf, Amazon Q). Each hook fires on a specific event, performs lightweight analysis, and injects an informational systemMessage back into the conversation. Hooks never block operations – they always exit 0.

Hook overview

HookEventMatcherTimeoutPurpose
Capabilities DetectSessionStart15sProbes binaries + repo signals; writes .vulnetix/capabilities.yaml
Session SummarySessionStart10sDisplays vulnerability dashboard on session start
Pre-Commit ScanPreToolUseBash30sExtracts packages from staged manifests and runs background VDB searches
Dep Install GatePreToolUseBash20sQuick vuln/malware check before npm/pip/cargo/etc. install
Docker Build GatePreToolUseBash30sQuick container scan before docker/podman build
Terraform Apply GatePreToolUseBash30sQuick IaC scan before terraform/tofu apply
Git Push GatePreToolUseBash30sPre-push secret-scan + open-finding summary
Manifest Edit GatePreToolUseEdit|Write30sChecks packages being added/modified for risk
Post-Install ScanPostToolUseBash120sScans after dependency install commands
Dockerfile Edit GatePostToolUseEdit|Write10sBackground container scan after Dockerfile edits
IaC Edit GatePostToolUseEdit|Write10sBackground IaC scan after *.tf/*.tofu edits
Stop ReminderStop10sReminds about unresolved vulnerabilities
Context InjectUserPromptSubmit15sAuto-detects CVE/GHSA IDs in messages
Prompt RouterUserPromptSubmit10sRoutes security-relevant prompts to the matching skill

Key principles

Never blocks. Every hook exits 0 regardless of what it finds. Hooks are informational – they surface context and suggest actions but never prevent commits, edits, or other operations.

JSON systemMessage output. All hooks communicate by writing a JSON object to stdout:

{"systemMessage": "Vulnetix: ..."}

Claude Code reads this and injects it into the conversation context, making the information available to the AI without interrupting the developer.

Minimal dependencies. Hooks require only two external tools:

  • jq – for JSON processing (manifest parsing, API response handling, systemMessage construction)
  • vulnetix CLI – authenticated with a Vulnetix account for API access

If either dependency is missing, hooks exit silently rather than producing errors.

Data directory. Hooks that generate artifacts (package search results, SBOMs, memory updates) write to .vulnetix/ in the project root. This directory is automatically added to .gitignore on first use.

How hooks are registered

Hooks are declared in the plugin’s hooks.json file and registered with Claude Code when the plugin is installed. Each entry specifies:

  • hook – the Claude Code event name (e.g., PreToolUse, PostToolUse)
  • matcher – optional tool name filter (e.g., Bash, Edit|Write)
  • script – path to the shell script
  • timeout – maximum execution time in seconds

Agent-specific configuration

The same six hooks work across multiple agents. Each agent uses its own config file format — the plugin ships a pre-built config for each:

AgentConfig fileNotes
Claude Codehooks.jsonDefault
Augmenthooks.augment.json
CodeBuddyhooks.codebuddy.jsonRegex matchers
Cortex Codehooks.cortex.json
iFlow CLIhooks.iflow.json
OpenHandshooks.openhands.jsonPreToolUse + PostToolUse only
Qoderhooks.qoder.json
Qwen Codehooks.qwen.jsonTimeouts in milliseconds

Hooks are registered automatically when you install via npx skills add.

Pre-Commit Scan
Extracts packages from staged dependency manifests and runs background VDB package searches before every git commit — never blocks the commit operation.
Post-Install Scan
Automatically scans dependency manifests after package install commands to detect newly introduced vulnerabilities.
Manifest Edit Gate
Checks packages being added or modified in dependency manifests before the edit is applied, reporting vulnerability counts, severity, and Safe Harbour scores.
Session Summary
Displays a vulnerability status dashboard when a new Claude Code session starts, summarizing open issues and tracked manifests.
Stop Reminder
Reminds about unresolved vulnerabilities when a Claude Code session ends, showing up to three open vuln IDs with suggested next actions.
Vulnerability Context Injection
Automatically detects CVE and GHSA identifiers in user messages and injects prior vulnerability context from the project memory.
Capabilities Detect
SessionStart probe of system binaries and repo signals; persists to .vulnetix/capabilities.yaml.
Dep Install Gate
Quick vuln/malware check before npm/pnpm/yarn/pip/uv/cargo/go/gem/composer add commands.
Docker Build Gate
Quick container scan of the Dockerfile before docker/podman build.
Dockerfile Edit Gate
Background container scan after editing Dockerfile or Containerfile.
Git Push Gate
Pre-push secret-scan + open-finding summary.
IaC Edit Gate
Background IaC scan after editing *.tf or *.tofu files.
Prompt Router
Detects security-relevant keywords in user prompts and suggests the matching Pix skill.
Terraform Apply Gate
Quick IaC scan before terraform/tofu apply.