law-search

law-search is a skill for Claude Code from llamadrive/bengo-toolkit. It costs 81 tokens per session (4,299 once invoked), scanned A, original, MIT.

A Japanese-law lookup workflow using the e-Gov API, Japan's government service for accessing official legal texts. It searches and displays laws and specific articles, with a local cache for retrieved XML data.

In plain words
What is it for?
Use it to search laws and articles, retrieve official text, validate or clear cached results, and cross-check citations against Japan's e-Gov source.
Why use it?
It makes relevant Japanese provisions easier to locate while checking cached files for corruption and discarding stale or invalid copies. It also explains that checksums detect damage, not deliberate changes by someone with the same user access.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the bengo-toolkit plugin — 15 skills, 25 commands, 3 MCP servers shipped together

Good fit Use it to search laws and articles, retrieve official text, validate or clear cached results, and cross-check citations against Japan's e-Gov source.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/llamadrive/bengo-toolkit/law-search
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.

Any agent
npx skills add llamadrive/bengo-toolkit --skill law-search
Clone the repo
git clone --depth 1 https://github.com/llamadrive/bengo-toolkit

Made for: Claude Code.

Or install bengo-toolkit, the plugin that ships this one along with the rest of its 15 skills, 25 commands, 3 MCP servers.

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 law-search

README.md
[![agentmods](https://agentmods.dev/badge/skills/llamadrive/bengo-toolkit/law-search/github.svg)](https://agentmods.dev/skills/llamadrive/bengo-toolkit/law-search)
Your own site
<a href="https://agentmods.dev/skills/llamadrive/bengo-toolkit/law-search"><img src="https://agentmods.dev/badge/skills/llamadrive/bengo-toolkit/law-search/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for law-search

Your own site · 80×15
<a href="https://agentmods.dev/skills/llamadrive/bengo-toolkit/law-search"><img src="https://agentmods.dev/badge/skills/llamadrive/bengo-toolkit/law-search.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,299 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00081 $0.04299
Opus 5 $0.00041 $0.02150
Sonnet 5 $0.00016 $0.00860
Haiku 4.5 $0.00008 $0.00430

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

Security

Grade A, and why

law-search scanned grade A with 1 finding 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (search.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

urllib を呼ばず stderr 最終行に以下の JSON を emit して exit 0 する:
skills/law-search/SKILL.md · 287 lines

How it starts

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

e-Gov 法令 API を使用して、日本の法令条文を検索・取得・表示する。

データの取扱い

law-search の XML キャッシュはユーザー固有ディレクトリ ~/.claude-bengo/cache/law-search/ に 24 時間保存される。POSIX 上では所有者専用(0o700)で作成するため、共有 /tmp を経由した他ユーザーからの書込攻撃は防げる。暗号化ボリュームや事務所ポリシーで配置先を変更する場合は環境変数 CLAUDE_BENGO_CACHE_PATH で上書きできる。

整合性チェック(破損検出): 各キャッシュエントリ(例: law_{id}.xml, article_{id}_{article}.xml)には SHA-256 のサイドカー(<filename>.sha256)を併置する。書込は tmp + rename で原子的に行い、読取時には必ずサイドカーと本体のハッシュ一致を検証する。不一致・サイドカー欠落・TTL 超過のいずれかに該当すれば両ファイルを破棄して再取得扱いとする。

整合性チェックの限界(同一ユーザー権限の攻撃者には無力): サイドカーは自己チェックサムであり、HMAC や署名を含まない。従ってキャッシュディレクトリへ書込権限を持つ攻撃者(同一 OS ユーザーとして動作するマルウェア等)は、.xml.sha256 の両方を一貫して書き換えることで改ざんを成立させ得る。この仕組みは破損検出(corruption detection)であり、敵対的改ざん検出(adversary detection)ではない。高信頼要求がある場合は以下を検討する:

手動で削除したい場合は次を実行する(サイドカーもまとめて削除される):

Bash: python3 skills/law-search/search.py clear-cache

特定の法令のみ削除する場合は --law-id 129AC0000000089 を付ける。オフラインの自己診断は python3 skills/law-search/search.py self-test で実行する。

キャッシュは ~/.claude-bengo/cache/law-search/ 配下に配置する。共有 tmp 上のキャッシュは信頼しない。

重要: トークン制限への対応

法令全文は絶対に Claude のコンテキストに載せない。 民法は 1000 条以上、会社法は 979 条あり、全文 XML は数 MB に達する。

必ず条文単位の API(/articles エンドポイント)経由で取得する。 トピック検索の場合のみ、全文 XML をローカルのキャッシュに保存してキーワード検索し、ヒットした条文だけを条文単位で取得する(search.py がこの流れを内部で実装している)。

ワークフロー

Step 1: ユーザーの意図を解析

入力パターンに応じて処理を分岐する:

入力パターン 処理
法令名 + 条番号 "民法709条" → Step 2 → Step 3a(条文取得)
法令名 + 条範囲 "民法709条から711条" → Step 2 → Step 3a(複数条文を個別取得)
法令名のみ "会社法" → Step 2 → Step 3b(目次・概要を表示)
条文の内容で検索 "不法行為の条文" → Step 2 → Step 3c(キーワードで条見出しを検索)
不明な法令名 "なんとか保護法" → Step 3d(法令名の候補を提案)

Step 2: 法令 ID の解決

2 段階で法令 ID を解決する:

Step 2a: 略称・別名の解決 skills/law-search/references/egov-api-guide.md を Read ツールで読み込み、略称マッピング(民訴法→民事訴訟法 等)とキーワード→条文マッピングを確認する。

Read the full file on GitHub · 287 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 287 lines · 81 tokens per session scan A ad8503d465bf

Subscribe to this mod's changes

law-search is a skill published in the GitHub repository llamadrive/bengo-toolkit (6 stars, last pushed 1mo ago), licensed MIT. It adds 81 tokens to every session and 4,299 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

specification-writing

A workflow for writing complete patent specifications from patent claims and an invention disclosure. It adapts the document to a chosen jurisdiction, such as the US, Europe, or China.

wanshuiyin/Auto-claude-code-research-in-sleep · 49 tokens

regulatory-research-fallback

Fallback workflow for regulatory research when web extraction tools fail on government PDFs.

HKUDS/OpenSpace · 20 tokens

x-scorecard

OpenSSF Scorecard for assessing open source project security. Check security best practices and compliance. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 57 tokens

memstack-business-gdpr

Use this skill when the user says 'GDPR', 'data protection', 'privacy compliance', 'DPA', 'DSAR', 'data subject request', 'cookie consent', 'privacy audit', 'CCPA', or asks 'do I need GDPR for this repo'. Scans the repository to detect what personal data is collected, classifies sensitivity, determines whether GDPR…

cwinvestments/memstack · 121 tokens

gesellschaftsrechtliche-satzungen-agb

Für Gesellschaftsrechtliche Satzungen AGB Abgrenzung: ordnet Norm, Beweislast und Gegenargument; Ergebnis: Prüfprodukt mit Risiko und nächstem Schritt. Fachgebiet: AGB-Recht-Prüfer. Route: gesellschaftsrechtliche-satzungen-agb.

Klotzkette/claude-fuer-deutsches-recht · 69 tokens

nda-review

Use when the user uploads or pastes a non-disclosure agreement and asks for review, redline, risk assessment, or a recommendation on whether to sign. Identifies missing standard protections, one-sided or unusual provisions, and operational issues; produces a structured report with severity ratings and citations to…

LegalQuants/lq-ai · 79 tokens