anma: Instructions file for Claude Code

CLAUDE.md

anma CLAUDE.md is an instructions file for Claude Code from anma-labs/anma. It costs 760 tokens per session, scanned A, original, Apache-2.0.

A project instruction system built around small module contracts. It generates architecture maps, nested instruction files, and checks that code stays within module boundaries.

In plain words
What is it for?
Use it in Python projects to define module boundaries, regenerate project guidance, run boundary checks, and enforce those rules in tests or pre-commit checks.
Why use it?
It keeps developers and coding agents aware of which parts of a project may depend on each other. Regenerating the files from the contracts avoids manual drift.

Instructions file for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is anma-labs/anma's own configuration. It tells Claude Code how to work on anma itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything anma configures →

Reuse

Borrowing it

Nothing to install: this file belongs to anma-labs/anma. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/anma-labs/anma/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/anma-labs/anma

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/anma-labs/anma/claude-md.svg)](https://agentmods.dev/instructions/anma-labs/anma/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/anma-labs/anma/claude-md"><img src="https://agentmods.dev/badge/instructions/anma-labs/anma/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 760 This file is loaded in full into every session.
When invoked 760 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00760 $0.00760
Opus 5 $0.00380 $0.00380
Sonnet 5 $0.00152 $0.00152
Haiku 4.5 $0.00076 $0.00076

Measured 7d ago against content hash 0d6a4b043728, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

anma 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 7d 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 · 62 lines

How it starts

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

anma

ANMA turns per-module anma.yaml contracts into the artifacts that keep Claude Code inside module boundaries: a generated architecture map, nested CLAUDE.md files, a PreToolUse hook, and a boundary-check engine. Contracts are the single source of truth — never hand-edit generated files.

Commands

  • pip install -e .[dev] — install with pytest
  • python -m pytest tests/ -q — run tests (keep them green before commits)
  • anma sync . — regenerate all artifacts after editing any anma.yaml
  • anma check . — enforce boundaries (also runs in CI and the pre-commit hook)

Internal architecture

This package is intentionally small (~650 LOC). The internal dependency direction is strict — lower layers must NOT import higher ones:

contracts.py   leaf: load + validate contracts (no internal imports)
templates.py   leaf: generated-artifact strings (no internal imports)
scaffold.py    leaf: `anma init` example (no internal imports)
engine.py      depends on: contracts            (tach adapter + builtin checker)
compile.py     depends on: contracts, templates (renders all artifacts)
cli.py         depends on: all of the above     (orchestrator / entry point)

INVARIANT: core (contracts, engine, compile, templates, scaffold) must never import cli. cli is the only place argparse and I/O wiring live.

INVARIANT: tach is optional. engine.py must keep working with zero extra dependencies via the builtin ast checker. Never make tach a hard import.

What not to edit by hand (generated by anma sync)

  • the ANMA:MAP block below
  • anma/CLAUDE.md, .claude/rules/, .claude/hooks/, tach.toml, .github/workflows/anma.yml To change behavior, edit a contract or anma/templates.py, then re-sync.

Dogfooding note (known limitation)

ANMA currently models a "module" as a directory with an anma.yaml. This package is a single flat module, so anma check enforces the workflow here (generated CLAUDE.md + green CI) but cannot yet enforce the internal layering above — that needs file/layer-level modules. Tracked as the next core feature; it also matters for enterprise layered-monolith packages.

Read the full file on GitHub · 62 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. 7d ago First seen · 62 lines · 760 tokens per session scan A 0d6a4b043728

Subscribe to this mod's changes

anma CLAUDE.md is an instructions file published in the GitHub repository anma-labs/anma (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 760 tokens to every session, about $0.0038 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-31.