paperless-brain CLAUDE.md

paperless-brain CLAUDE.md is an instructions file for coding agents from vailsen/paperless-brain. It costs 10,390 tokens per session, scanned A, original, MIT.

Project instructions for PaperlessBrain, an AI-powered web interface for searching and chatting with a Paperless-ngx document archive. The archive can contain documents such as invoices, contracts, and letters, and the app runs with NiceGUI, FastAPI, Claude, or Ollama.

In plain words
What is it for?
Use them when developing or deploying PaperlessBrain, installing its optional features, starting the local app, managing versions, or publishing a release.
Why use it?
They give a coding agent the project's purpose, local development command, dependencies, deployment process, and key repository rules.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/vailsen/paperless-brain/claude-md
Clone the repo
git clone --depth 1 https://github.com/vailsen/paperless-brain

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for paperless-brain CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/vailsen/paperless-brain/claude-md.svg)](https://agentmods.dev/instructions/vailsen/paperless-brain/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/vailsen/paperless-brain/claude-md"><img src="https://agentmods.dev/badge/instructions/vailsen/paperless-brain/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 10,390 This file is loaded in full into every session.
When invoked 10,390 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.10390 $0.10390
Opus 5 $0.05195 $0.05195
Sonnet 5 $0.02078 $0.02078
Haiku 4.5 $0.01039 $0.01039

Measured 4d ago against content hash 45c128930c59, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

paperless-brain CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 757 lines

How it starts

The opening of the file, as written. The whole thing — 757 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this is

PaperlessBrain — AI-powered frontend for Paperless-ngx. Built with NiceGUI + FastAPI. Lets users chat with their document archive (invoices, contracts, letters) via Claude or Ollama LLMs, with full tool-call agentic loop.

Running

# Local dev
python main.py
# App runs at http://0.0.0.0:8080

# Deploy: tag a release, CI publishes the image, the server pulls it
git tag vX.Y.Z && git push origin main --tags   # .github/workflows/release.yml
ssh <server> "cd /root/paperlessbrain && docker compose pull && docker compose up -d"

Dependencies

Single source of truth: pyproject.toml (direct deps only, range pins; name paperless-brain, version from config/version.py via hatchling). The old requirements*.txt files are gone.

# GPU machine (dev)
pip install -e ".[crawl,i18n]"

# CPU-only (LXC/Docker) — +cpu torch wheel outranks the CUDA build on PyPI
pip install --extra-index-url https://download.pytorch.org/whl/cpu -e ".[crawl,i18n]"
playwright install chromium   # only needed with the [crawl] extra

# Docker
docker build -t paperless-brain .                    # full
docker build --build-arg LEAN=1 -t paperless-brain . # no crawl4ai/chromium
docker compose up -d

Extras: [crawl] = crawl4ai + headless Chromium (JS-heavy page fetching — app degrades to trafilatura-only without it); [i18n] = pybabel workflow.

Configuration

All settings via .env file (loaded by config/settings.py via pydantic-settings). Required keys:

  • APP_PATH — absolute path to repo root (with trailing slash)
  • PAPERLESS_URL, PAPERLESS_SUPERUSER_TOKEN — Paperless-ngx API
  • IGNORE_INBOX_TAG_AT_SYNC — tag name to skip during sync
  • EMBEDDING_MODEL, CHROMA_PATH, CHROMA_COLLECTION, EXTRACTION_SIDECAR_PATH, THUMB_PATH
  • OLLAMA_SERVER, OLLAMA_INGEST_MODELoptional, vision LLM for ingestion (both also settable in Settings > Processing, which wins). Chat and Werkbank never read them — those use per-user models with their own base_url. OLLAMA_SERVER additionally names the host the WoL/shutdown buttons control; without it that is inferred from the first local-lane model in the registry.
  • No provider API key belongs in .env. Every chat/research/vision model is managed per user in the UI (Settings > AI Models, services/model_registry.py) with its own backend (anthropic / openai_compatible), base URL, key and model id — which is what makes AI gateways (OpenRouter, Requesty, LiteLLM, Portkey …) work with no code.
  • SEARXNG_HOST — self-hosted SearXNG instance
  • STORAGE_SECRET — NiceGUI session secret

Read the full file on GitHub · 757 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 757 lines · 10,390 tokens per session scan A 45c128930c59

Subscribe to this mod's changes

paperless-brain CLAUDE.md is an instructions file published in the GitHub repository vailsen/paperless-brain (24 stars, last pushed 16d ago), licensed MIT. It adds 10,390 tokens to every session, about $0.0519 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.