templates/skills/secure-claude/SKILL.md
Security audit for Claude Code configuration. Scans agents, skills, rules, hooks, settings, and MCP servers for malware, data exfiltration, prompt injection, or system compromise. Use when the user says 'audit config', 'check for malware', 'security scan', 'is my setup safe', 'scan hooks', 'check skills for backdoors', or installs new skills/agents from untrusted sources.
npx skillsauth add samwang0723/claudecode-setup secure-configInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Perform a comprehensive security audit of the user's Claude Code configuration at ~/.claude/.
Read every file in each location. Do not skip any file — a single malicious line in one file is a critical finding.
settings.json → hooks and settings.local.json → hooks)Hooks execute shell commands automatically in response to Claude events. They are the highest-risk vector.
Read the settings files:
~/.claude/settings.json~/.claude/settings.local.json (if exists).claude/settings.json and .claude/settings.local.json (if exists)Extract all hook entries from PreToolUse, PostToolUse, Notification, and Stop arrays.
For each hook with type: "command":
commandcurl, wget, nc, ncat, ssh, scp, rsync, any URL/IP literals)~/.claude/ (writing to /etc/, ~/.ssh/, ~/.bashrc, ~/.zshrc, cron)kill, pkill, background daemons, nohup to suspicious binaries)base64 -d | bash, eval, $() wrapping encoded strings, hex escapes)~/.ssh/*, ~/.aws/*, ~/.gnupg/*, keychains, browser profiles)~/.claude/agents/*.md)Agents define subagent behavior. They can influence what tools Claude invokes and what commands it runs.
For each agent file:
~/.claude/skills/*/SKILL.md and any bundled scripts)Skills can run arbitrary code through bundled scripts and influence Claude's behavior through instructions.
For each skill directory:
SKILL.md and all files in subdirectories (scripts/, references/, assets/)scripts/ containing binaries or compiled code (not readable source)curl | bash, wget -O - | sh)dangerouslySkipPermissions or bypassPermissionscontext: fork with suspicious agent references (agents not in the known set)~/.claude/rules/**/*.md)Rules are auto-loaded into every conversation. A poisoned rule affects all sessions silently.
For each rule file:
settings.json, settings.local.json)Beyond hooks, settings control permissions, environment variables, and MCP server connections.
Check permissions:
allow patterns (e.g., Bash(*) with no deny rules)deny list when broad permissions are granteddangerouslySkipPermissions or similar bypass flagsCheck environment variables (env):
Check MCP servers (mcpServers):
Check enabledPlugins in settings:
Spawn parallel subagents (or scan sequentially if subagents unavailable):
Each scanner must read every file — do not rely on filenames or paths to filter. Open and inspect contents.
Classify findings by severity:
| Severity | Criteria | Examples |
|----------|----------|---------|
| CRITICAL | Active data exfiltration, reverse shell, credential theft, remote code execution | Hook that curls tokens to external server; skill that downloads and runs a binary |
| HIGH | Potential for compromise if triggered, bypass of safety features | Agent instructing to skip permissions; rule with prompt injection; broad Bash(*) allow |
| MEDIUM | Suspicious but not definitively malicious, overly broad access | MCP server with unclear provenance; env var with embedded URL; skill downloading code |
| LOW | Informational, best-practice violations | Missing deny rules; secrets in env vars; plugin from unverified source |
Present findings as a structured security report:
# Claude Code Security Audit Report
**Scan date:** {date}
**Files scanned:** {count}
**Findings:** {critical} critical, {high} high, {medium} medium, {low} low
## Critical Findings
(if any — each with file path, line number, description, and recommended action)
## High Findings
(same format)
## Medium Findings
(same format)
## Low Findings
(same format)
## Clean Files
(list of files that passed all checks — confirms they were actually scanned)
## Recommendations
(prioritized list of remediation steps)
If zero critical or high findings are found, state that clearly — a clean bill of health is valuable information.
Focus: $ARGUMENTS
development
Generate a technical specification document using the DDD template in template.md. Use when the user says 'write tech spec', 'create tech spec', 'technical specification', or needs a structured design document for a new feature or major change covering architecture, domain models, APIs, data design, security, and operations.
testing
Write a Product Requirements Document (PRD) using the standard TMAB template with stakeholders, user stories (Given-When-Then), success metrics, and A/B testing plans. Use when the user asks to write a PRD, create product requirements, document a feature spec, or plan a new product feature.
data-ai
Clean up an agent team. Removes team resources, optionally cleans worktrees and branches. Use after team work is complete and merged. Use when told to "stop team", "cleanup team", "disband team".
testing
Check progress of an active agent team. Shows member status, completed tasks, pending work, and any messages. Use when asked "team status", "how's the team", "check team progress", "team update".