Sordino
A local PII masking proxy for Claude Code. It sits between Claude Code and
the Anthropic Messages API, masks personal data on the way out, and unmasks it
on the way back — so the model provider only ever sees deterministic tokens
like [EMAIL_ADDRESS_a47n1d8s9c0f], while you keep seeing real values locally.
Quick start (Claude Code)
Run these inside a claude session — they are Claude Code slash commands, not
shell commands:
/plugin marketplace add sordino-sh/sordino
/plugin install sordino
[restart Claude Code]
That's it. The plugin ships prebuilt binaries (no compile, no download) and
auto-routes each project the first time it sees it. After the one-time restart,
masking is live — run /sordino:status to confirm. Details, scoping options, and
the standalone proxy are below.
Permission denied (publickey) on install?
The install clones the public repo over HTTPS, but a global git rule on your
machine — url."[email protected]:".insteadOf "https://github.com/" — rewrites
every GitHub HTTPS URL to SSH, and SSH needs a key GitHub recognizes (even for
public repos). Common on Windows / Git-for-Windows setups seeded from a
dotfiles guide.
Fix with any of:
Detection is done by presidio-rs (offline regex
recognizers — email, phone, credit card, IP, API keys, IBAN, SSN, …). The
mask/unmask design is ported from the orchestr8 Privacy Engine: deterministic
session-salted tokens (blake3) backed by a reversible AES-256-GCM session store.
How it works
sordino is a hybrid: a reverse proxy is the data plane, and thin Claude Code
hooks are the control plane.
Claude Code ──ANTHROPIC_BASE_URL=http://127.0.0.1:<project-port>──► sordino-proxy ──TLS──► api.anthropic.com
(sees plaintext) (masks/unmasks) (sees only tokens)
One proxy per project. Each project gets its own proxy on an OS-assigned
ephemeral port (127.0.0.1:0), synchronized through a per-project rendezvous file
keyed by the project's path — so its key, token store, and config are fully isolated, and
two projects can never collide on a port (the birthday problem). Concurrent claude
sessions in different projects never interfere or correlate; two windows in the same
project share one proxy. The plugin writes the bound port into the project's gitignored
.claude/settings.local.json on the first session (or explicitly via /sordino:enable).
The port is sticky (reused across proxy restarts when free), so it rarely changes; set
[proxy] port = N in sordino.toml to pin a static port instead.
This is not a TLS-intercepting MITM — Claude Code natively supports
ANTHROPIC_BASE_URL, so you simply point it at the local proxy, which
re-originates a fresh TLS connection to Anthropic. No certificates to install.
Why a proxy and not pure hooks?
Claude Code hooks can't actually mask the traffic: UserPromptSubmit can't
rewrite the prompt the model sees, PostToolUse can't modify tool output, the
system prompt is unreachable, and assistant text can only be changed
display-only. Mapped onto the privacy "four arrows", hooks cleanly cover only
one of them. The proxy is the only place with a real egress guarantee, so it
owns the masking; the hooks just launch it and surface status.
The four arrows
Arrow 1: user / system → LLM = MASK (request)
Arrow 4: tool output → LLM = MASK (request)
Arrow 2: LLM → display = UNMASK (response)
Arrow 3: LLM → tool input = UNMASK (response)
Because this build unmasks on the wire, Claude Code's transcript stores
plaintext — which means assistant-authored history comes back as plaintext on
the next turn and is re-masked outbound. Deterministic tokens make that
round-trip reproduce the exact original token form, so nothing leaks and
prompt-cache prefixes stay byte-stable. thinking blocks and their signatures
are kept tokenized end-to-end (never unmasked), so signatures stay valid.
Workspace