anafpy CLAUDE.md

anafpy CLAUDE.md is an instructions file for coding agents from robert-malai/anafpy. It costs 9,900 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for anafpy, a typed asynchronous Python client for Romania's ANAF tax-authority services, plus a local MCP server. ANAF handles services such as electronic invoicing.

In plain words
What is it for?
Use them when developing the ANAF client, electronic-invoicing features, documentation, or MCP tools, and when checking the required architecture and dependencies.
Why use it?
They explain the project's boundaries and conventions so changes preserve its stateless transport design and documented service behavior.

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/robert-malai/anafpy/claude-md
Clone the repo
git clone --depth 1 https://github.com/robert-malai/anafpy

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 anafpy CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/robert-malai/anafpy/claude-md.svg)](https://agentmods.dev/instructions/robert-malai/anafpy/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/robert-malai/anafpy/claude-md"><img src="https://agentmods.dev/badge/instructions/robert-malai/anafpy/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 9,900 This file is loaded in full into every session.
When invoked 9,900 The same file — it is already loaded in full.
Security scan A 2 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.09900 $0.09900
Opus 5 $0.04950 $0.04950
Sonnet 5 $0.01980 $0.01980
Haiku 4.5 $0.00990 $0.00990

Measured yesterday against content hash 1983f3b54ffc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

anafpy CLAUDE.md scanned grade A with 2 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# timeout (DUK JVM + platform curl)

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

_transport/subprocess.py # bounded async runner; kills the process group on
CLAUDE.md · 606 lines

How it starts

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

CLAUDE.md

Guidance for working in this repository. DESIGN.md is the decision record — rationale, dates, and reversals live there; this file states only the current rules. docs/anaf-reference/ is the compiled local reference of ANAF's APIs. docs/ is also the MkDocs source of the public docs site (Read the Docs, https://anafpy.readthedocs.io).

What this is

anafpy — typed async Python clients for Romania's ANAF tax-authority services, plus a local stdio MCP server (anafpy.mcp, extra anafpy[mcp]) exposing the same operations as Claude tools and skills. It is a thin, stateless transport client — no persistence, no accounting logic; client methods map 1:1 onto MCP tools. Python 3.12+ (dev pin 3.13), httpx2, Pydantic v2.

The service strands:

  • e-Factura (electronic invoicing). Outbound has two shapes (DESIGN.md §1): XML pass-through is strongly recommended when the caller runs invoicing software — bring its complete UBL XML; anafpy never re-composes an upstream document, and ANAF's SPV is not invoice storage (it purges filed messages after ~60 days, so the durable record lives upstream). Structured authoring (efactura.authoring) is the first-class path without one: a bidirectional InvoiceDocument covers invoice + credit note (kind picks the render target), totals/VAT computed with explicit overrides preserved, a hand-translated EN 16931 + CIUS-RO rule set (validate(), findings with official BR-* ids; ANAF stays authoritative), byte-stable render/read round-trips, EFacturaClient.upload_invoice. The same model backs the inbox — but not the same contract: the construction checks are authoring's, and nothing the caller did not author is judged by them (_DERIVED_CONTEXT — a document read off the wire, or a value compute_* derives), so the reader never rejects a document ANAF accepted and a read one always renders back. DownloadedMessage.view never raises (None when not representable — a missing mandatory element or off-list code; cause on view_error + a warning; raw bytes + full UBL model are the fallback tiers).
  • e-Transport (goods transport) — fully translated: bidirectional flat models author a filing and view a parsed one, covering all four operations (declaration/correction, deletion, confirmation, vehicle change); XML input remains supported. UIT presentation (extra anafpy[cards], DESIGN.md §13) renders a filed declaration into two PDFs — a phone-shaped driver card and an A4 detail document — locally, informative, never issued by ANAF. Validity is ANAF's data_exp_uit when the caller has one and the statutory OUG 41/2022 window otherwise (ANAF discloses the date only to the transport organizer, so that is the common case) — the two are never rendered alike.
  • Public no-auth services (anafpy.public) — registry lookups, financial statements, and the stateless e-Factura validare/transformare.
  • Exchange rates (anafpy.bnr, DESIGN.md §17) — the one non-ANAF publisher: BNR's reference-rate XML on curs.bnr.ro, for the lei figures ANAF filings need from foreign-currency documents. A rate source, not a ruling: it returns what BNR published on a day; which day a filing must use is the caller's (and the workflow skill's) call.
  • SPV (anafpy.spv) — read-only mailbox over a certificate cookie session.
  • Declarations (anafpy.declaratii, DESIGN.md §12) — local authoring + validation via ANAF's DUKIntegrator (managed-installed from ANAF's update feed), official-PDF rendering, qualified signing (the raw op delegated to the OS token — no key material or PIN in-process), portal filing (production-only; opt-out ANAFPY_DECLARATII_UPLOAD=off), and no-auth StareD112 status/recipisa tracking.

Read the full file on GitHub · 606 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. yesterday Changed · +13 lines · +221 tokens per session 1983f3b54ffc
  2. 4d ago First seen · 593 lines · 9,679 tokens per session scan A d2091b5acc86

Subscribe to this mod's changes

anafpy CLAUDE.md is an instructions file published in the GitHub repository robert-malai/anafpy (27 stars, last pushed 4d ago), licensed Apache-2.0. It adds 9,900 tokens to every session, about $0.0495 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.