Claude Code & Tools.

Connect Claude Code to the Noirdoc gateway or mask local files and paths directly on your machine with the Claude Code plugin and the noirdoc CLI.

Claude Code through the gateway.

Set ANTHROPIC_BASE_URL to https://api.noirdoc.de (without /v1) and ANTHROPIC_AUTH_TOKEN to your px- key; select a Claude model from GET /v1/models such as claude-sonnet-5-5 via ANTHROPIC_MODEL (Claude Code is built for Claude models and does not support other models through a gateway). Turn on Noirdoc Shield via ANTHROPIC_CUSTOM_HEADERS or directly on the API key (shield_mode set to On).

Start Claude Code
export ANTHROPIC_BASE_URL="https://api.noirdoc.de"
export ANTHROPIC_AUTH_TOKEN="$NOIRDOC_API_KEY"
export ANTHROPIC_MODEL="claude-sonnet-5-5"
export ANTHROPIC_CUSTOM_HEADERS="X-Noirdoc-Shield: on"
claude
Environment variableEffect
ANTHROPIC_BASE_URLBase URL https://api.noirdoc.de without /v1 (Claude Code appends /v1/messages itself).
ANTHROPIC_AUTH_TOKENSends your px- key as Authorization: Bearer. Do not set alongside ANTHROPIC_API_KEY.
ANTHROPIC_API_KEYAlternative to ANTHROPIC_AUTH_TOKEN; sends your px- key as x-api-key (set only one of the two variables).
ANTHROPIC_MODELClaude model ID from GET /v1/models (for example claude-sonnet-5-5 or claude-haiku-4-5).
ANTHROPIC_CUSTOM_HEADERSAdditional headers, one Name: Value pair per line (for example X-Noirdoc-Shield: on or X-Noirdoc-Tags: ...).

Preflight token counting: Claude Code counts context tokens beforehand via POST /v1/messages/count_tokens. This call skips Noirdoc Shield at €0 (for Claude on Google Vertex AI, the gateway forwards to the Vertex counting method; see Messages), while actual POST /v1/messages requests run through Shield when enabled.

Local Claude Code plugin.

The open-source Claude Code plugin (MIT licence, usable independently of the gateway) connects the local noirdoc CLI directly with Claude Code. The plugin intercepts reads of protected paths, hands Claude a copy masked locally with placeholders such as <<PERSON_1>> and stores responses containing placeholders; you put the original values back in your own terminal outside Claude Code.

Claude Code
/plugin marketplace add nextaim-de/noirdoc-claude-plugin
/plugin install noirdoc@nextaim
/noirdoc:noirdoc-setup

Source code, path rules and commands are documented at github.com/nextaim-de/noirdoc-claude-plugin.

noirdoc CLI for documents.

The Python package noirdoc (MIT licence) replaces personal data in PDF, DOCX, XLSX and plain-text files locally on your machine with consistent placeholders such as <<PERSON_1>>. With --namespace, placeholders stay identical across multiple files, and noirdoc reveal restores the original values locally. This makes the CLI well suited to sanitising binary office documents (PDF, DOCX, XLSX) beforehand or applying reversible pseudonymisation locally, whereas Noirdoc Shield in the gateway statelessly inspects and redacts inbound text without storing mappings.

noirdoc CLI
pip install "noirdoc[full]"
noirdoc redact --namespace client-mueller \
  letter.docx -o letter-masked.docx
noirdoc reveal --namespace client-mueller \
  letter-masked.docx -o letter.docx

Source code, supported formats and options are documented at github.com/noirdoc-ai/mask-engine.