laws CLAUDE.md

laws CLAUDE.md is an instructions file for coding agents from Totopolis/laws. It costs 1,885 tokens per session, scanned A, original, BSD-2-Clause.

A set of Claude Code instructions for an offline repository of Russian codes and laws. It explains the available legal texts, search modes, commands, and language model.

In plain words
What is it for?
Guiding work on the repository’s legal search, including its data layout, search commands, MCP setup, and model details.
Why use it?
It gives the coding agent the project-specific context needed to use the legal search correctly and describe what the data contains.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/totopolis/laws/claude-md.svg)](https://agentmods.dev/instructions/totopolis/laws/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/totopolis/laws/claude-md"><img src="https://agentmods.dev/badge/instructions/totopolis/laws/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,885 This file is loaded in full into every session.
When invoked 1,885 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.01885 $0.01885
Opus 5 $0.00942 $0.00942
Sonnet 5 $0.00377 $0.00377
Haiku 4.5 $0.00188 $0.00188

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

Security

Grade A, and why

laws 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 3d 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 · 122 lines

How it starts

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

Кодексы и законы РФ: поиск по смыслу

Репозиторий даёт офлайн-поиск по законодательству Российской Федерации (24 кодекса и 563 закона): вопрос обычными словами — в ответ конкретные статьи. Ничего не качается из сети во время работы, всё считается локально на процессоре. Первое знакомство и команды для человека — в README.md, здесь то, что нужно знать при работе с кодом.

data/       тексты по статьям: data/<раздел>/<slug>/st-105.json, реестр — data/index.json
            (раздел документа — поле dir реестра: codex/ для кодексов, fz/ для законов)
CATALOG.md  перечень всех документов сборки: редакция, число статей, slug
index/      векторный индекс LanceDB (laws.lance) — по нему идёт поиск
src/laws_mcp/  поиск: server.py (MCP), cli.py (терминал), search.py (ядро)

Снапшот один, папок-дат нет. Тексты выгружены 2026-08-28, всего 29 003 статей в 587 документах (24 кодекса и 563 закона); редакция каждого по отдельности — в data/index.json и в CATALOG.md.

Как пользоваться поиском

Скиллы: /x-prepare-system — развернуть на новой машине, /x-search-laws — искать, /x-run-mcp — поднять MCP-сервер. Если работаешь без них:

PYTHONPATH=src PYTHONIOENCODING=utf-8 .venv/Scripts/python.exe -m laws_mcp.cli "вопрос" "ещё вопрос"
PYTHONPATH=src PYTHONIOENCODING=utf-8 .venv/Scripts/python.exe -m laws_mcp.cli --article uk-rf:105
PYTHONPATH=src PYTHONIOENCODING=utf-8 .venv/Scripts/python.exe -m laws_mcp.setup_check

На Linux/macOS интерпретатор — .venv/bin/python, PYTHONIOENCODING не нужен.

Два правила, которые сильно влияют на результат:

  1. Задавай несколько формулировок за один запуск. Модель грузится ~5 секунд, а каждый следующий запрос внутри вызова стоит 0,2 с. Пять отдельных вызовов — это 30 секунд, один вызов с пятью вопросами — 6.
  2. Перед ответом по существу открывай статью целиком через --article. Фрагменты в выдаче обрезаны, а в кодексах ответ часто зависит от оговорки в другой части статьи («за исключением случаев, предусмотренных пунктом 3»), которой во фрагменте не видно.

Read the full file on GitHub · 122 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. 3d ago First seen · 122 lines · 1,885 tokens per session scan A cbf36fa41021

Subscribe to this mod's changes

laws CLAUDE.md is an instructions file published in the GitHub repository Totopolis/laws (0 stars, last pushed 7d ago), licensed BSD-2-Clause. It adds 1,885 tokens to every session, about $0.0094 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.

Related

Other instructions, from other repositories