Ward — Development skill for Claude Code
Claude Code hook CLI — PII guard, leak detection, event logging.
How to install Ward
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open jstockdi/ward and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Ward does
Claude Code hook CLI — PII guard, leak detection, event logging.
Alternatives in Development
- Sanitize — Detect and redact PII from text files — 15 categories (SSNs, credit cards, API keys, etc.), zero dependencies 3.1k ★
- Purpose — Orient yourself in pi-vs-cc — a collection of Pi coding agent extensions and agent specs that progressively de 527 ★
- Sync Pii Anonymizer — Skill: Re-sync the vendored pii-anonymizer library 295 ★
README
Ward
A fast, local CLI that integrates with [Claude Code hooks](https://docs.anthropic.com/en/docs/claude-code/hooks) to block PII, secrets, and credentials from leaking through your AI coding workflow. Ships as a single Rust binary — no runtime dependencies.
What It Does
Ward scans every prompt you send and every tool call Claude makes, blocking sensitive data before it leaves your machine.
| Subcommand | Hook Events | Purpose |
|---|---|---|
ward pii |
UserPromptSubmit, PreToolUse, PostToolUse | Block SSNs, credit cards, emails, phone numbers |
ward leaks |
UserPromptSubmit, PreToolUse, PostToolUse | Block API keys, cloud credentials, tokens, passwords, private keys, connection strings |
ward log |
All events | Structured event logging to ~/.ward/events.jsonl |
On UserPromptSubmit and PreToolUse, a match **blocks** (exit 2) before anything leaves your machine. On PostToolUse the tool has already run, so blocking is impossible — instead ward **redacts**: it rewrites the tool output via the hook's `updatedToolOutput` field, replacing each secret with a `[WARD LEAKS REDACTED: ]` (or `WARD PII`) marker before Claude ever sees it. If a match can't be masked in place, the whole output is withheld.
Detection Coverage
PII Patterns
- Social Security Numbers (with ISO date false-positive prevention)
- Credit card numbers (spaces and dashes)
- Email addresses
- US phone numbers
Leak Detection — 3 Tiers
**Tier 1: Provider-Specific Keys** (32 patterns, high confidence)
- AWS (access key, secret key, Bedrock), GCP, Azure
- Anthropic, OpenAI
- GitHub (PAT, fine-grained, OAuth, app tokens), GitLab
- Slack (bot, app, user, webhook, legacy tokens)
- Stripe, SendGrid, Twilio, Linear, Databricks
- Heroku, Vercel, Grafana, Sentry, Datadog
- HashiCorp Vault, NPM, PyPI
**Tier 2: Structural Patterns** (medium confidence)
- PEM-encoded private keys (RSA, EC, OPENSSH)
- JWT tokens
- Connection strings (postgres, mysql, mongodb, redis, amqp,
Related Skills
Logging Implementation Best Practices
Production logging with structured JSON, PII redaction, rotation, retention and observability.
Rogue Observability Engineering Skill
Expert application observability: structured logging, correlation IDs, health checks, metrics/SLIs, error trac
Kimi Guard
Runtime behavior guard for Kimi Code CLI — loop detection, quota gates, checkpoint/resume, supervised Wire run
Claude Agent Rs
Rust-native Claude Code alternative — 5.4MB binary, $0 on Max, 8 tools, MCP client, semantic compaction, 19-ev
Sensitive Canary
Claude Code hooks that guard secrets and PII before they reach the Anthropic API
Claude Code Privacy Guard
🛡️ Claude Code plugin that blocks prompts containing secrets, API keys, and PII before they reach Claude.
Related Agents
ForensicAgent
Forensic security analyst — PII detection, secret scanning, identity leak auditing across git history, staged
Claude Code Test Agent
Tests all 27 Claude Code hooks by logging each event to tests-agents-hook/agent-hook-fired.log
Secrets Credential Engineer
Owns the full lifecycle of secrets and credentials — detection, prevention, vaulting, rotation, and leak respo