jstockdi

Ward — Development skill for Claude Code

Development community

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,