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.
For agents (.md & prompt)
Claude Code through the gateway.
Route Claude Code through the Noirdoc gateway to Claude models from GET /v1/models (Claude Code is built for Claude models and does not support other models through a gateway):
-
Set environment variables and start
Set
ANTHROPIC_BASE_URLtohttps://api.noirdoc.de(without/v1) andANTHROPIC_AUTH_TOKENto yourpx-key; select a Claude model such asclaude-sonnet-5-5viaANTHROPIC_MODEL. Turn on Noirdoc Shield viaANTHROPIC_CUSTOM_HEADERSor directly on the API key (shield_modeset to On).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" claudeEnvironment variable Effect ANTHROPIC_BASE_URLBase URL https://api.noirdoc.dewithout/v1(Claude Code appends/v1/messagesitself).ANTHROPIC_AUTH_TOKENSends your px-key asAuthorization: Bearer. Do not set alongsideANTHROPIC_API_KEY.ANTHROPIC_API_KEYAlternative to ANTHROPIC_AUTH_TOKEN; sends yourpx-key asx-api-key(set only one of the two variables).ANTHROPIC_MODELClaude model ID from GET /v1/models(for exampleclaude-sonnet-5-5orclaude-haiku-4-5).ANTHROPIC_CUSTOM_HEADERSAdditional headers, one Name: Valuepair per line (for exampleX-Noirdoc-Shield: onorX-Noirdoc-Tags: ...). -
Add project context to CLAUDE.md or AGENTS.md
When your project integrates the Noirdoc gateway in code, add this short block to
CLAUDE.mdorAGENTS.mdso coding agents consistently follow base URL, header and error-handling conventions:# Noirdoc Gateway - Base URL: `https://api.noirdoc.de/v1` (Anthropic SDK: omit `/v1`) - Auth: `Authorization: Bearer $NOIRDOC_API_KEY` (`px-` key, server-side only) - Shield: send `X-Noirdoc-Shield: on` for stateless pre-flight checks - Error handling: always branch on `error.code`, never `error.message` - Up-to-date docs (Markdown): `https://www.noirdoc.de/llms.txt` and `https://www.noirdoc.de/en/llms-full.txt` (DE: `/llms-full.txt`)
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.
/plugin marketplace add nextaim-de/noirdoc-claude-plugin
/plugin install noirdoc@nextaim
/noirdoc:noirdoc-setupSource 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.
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.docxSource code, supported formats and options are documented at github.com/noirdoc-ai/mask-engine.