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)
View as .md All docs (llms-full.txt)

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):

  1. Set environment variables and start

    Set ANTHROPIC_BASE_URL to https://api.noirdoc.de (without /v1) and ANTHROPIC_AUTH_TOKEN to your px- key; select a Claude model such as claude-sonnet-5-5 via ANTHROPIC_MODEL. 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: ...).
  2. Add project context to CLAUDE.md or AGENTS.md

    When your project integrates the Noirdoc gateway in code, add this short block to CLAUDE.md or AGENTS.md so coding agents consistently follow base URL, header and error-handling conventions:

    AGENTS.md / CLAUDE.md
    # 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.

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.

Claude Code & Tools
https://www.noirdoc.de/en/docs/tools.md
.md