nacre CLAUDE.md

nacre CLAUDE.md is an instructions file for coding agents from nacre-work/nacre. It costs 43,437 tokens per session, scanned C, original, Apache-2.0.

A set of project instructions for nacre, a self-hosted knowledge index that agents access through MCP and applications access through a REST API. It focuses on permissions, tenant isolation, search filtering, and deletion rules.

In plain words
What is it for?
Use it when changing nacre's authentication, authorisation, search, document deletion, REST API, or other core subsystems.
Why use it?
It helps prevent security incidents caused by leaking documents, applying permissions too late, or confusing missing data with inaccessible data.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nacre-work/nacre/claude-md.svg)](https://agentmods.dev/instructions/nacre-work/nacre/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/nacre-work/nacre/claude-md"><img src="https://agentmods.dev/badge/instructions/nacre-work/nacre/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 43,437 This file is loaded in full into every session.
When invoked 43,437 The same file — it is already loaded in full.
Security scan C 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.43437 $0.43437
Opus 5 $0.21719 $0.21719
Sonnet 5 $0.08687 $0.08687
Haiku 4.5 $0.04344 $0.04344

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

Security

Grade C, and why

nacre CLAUDE.md scanned grade C 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 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.

Cloud metadata endpointhighServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

`http://169.254.169.254/…`, the API beside it, or the vector store (no

Makes network callslowCapability

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

`docs/quickstart.md`'s path from a clean clone to a first search was four `curl`
CLAUDE.md · 2,933 lines

How it starts

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

Nacre — core

A self-hosted knowledge index with fine-grained access control. Agents reach it over MCP, applications over a REST API. Apache 2.0; the commercial modules live in a separate private repository.

Read docs/authz.md before writing anything. Every other subsystem depends on the permission model, and reworking it after search exists is expensive. Work order is in docs/README.md.

The six invariants

Breaking one of these is a security incident, not a bug. They are not negotiable in a PR.

  1. The organization comes from the token — never from a body, path, or header.
  2. Access filtering is a pre-filter, never a post-filter. The filter goes inside the index traversal so top_k returns k permitted results.
  3. A failure to evaluate permissions denies access. There is no "couldn't compute it, let it through" path.
  4. "No permission" and "no such object" are indistinguishable404, never 403, including the wording of the message.
  5. A deleted document is never returned, including before garbage collection. deleted = false belongs in every query.
  6. write does not imply read. admin implies both. This is the opposite of most permission systems; do not "fix" it.

Never, in any change

  • Filter search results after they come back from the vector database.
  • Accept org_id from a request body, path, or header.
  • Return 403 where the object is invisible.
  • Log document contents or full query text.
  • Ask for a larger top_k and trim on permission — that is a post-filter that also costs more. Trimming on relevance over an already-permitted candidate set is what reranking is, and it is allowed; the test is whether the answer can end up smaller than the number of permitted matches.
  • Skip the ACL filter in one branch of a hybrid query. Every prefetch branch carries it; one omission is a leak.
  • Query outside withOrg without saying which mechanism permits it. There are two, and only two: whileAuthenticating for resolving a credential, and acrossOrganizations for the worker's queue. A raw pool.connect() that reads a tenant table is a query that works in development and raises in production, because development connects as a superuser and the policies do not apply to one.

Read the full file on GitHub · 2,933 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 · 2,933 lines · 43,437 tokens per session scan C 7aba1f2f57c9

Subscribe to this mod's changes

nacre CLAUDE.md is an instructions file published in the GitHub repository nacre-work/nacre (0 stars, last pushed 6d ago), licensed Apache-2.0. It adds 43,437 tokens to every session, about $0.2172 per session on Opus 5. A static security scan graded it C with 2 findings (cloud metadata endpoint, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.