zaivern-code CLAUDE.md

A set of development rules for the Zaivern Code repository and its AI coding agents. It covers portable file paths, Rust and egui versions, translations, testing, releases, and installer checks.

In plain words
What is it for?
Use it when changing the repository, especially for internationalization, Rust tooling, operating-system differences, vendor patches, checksums, installers, and release work.
Why use it?
It gives contributors shared rules for code that works across operating systems and keeps product behavior, tests, and release verification aligned. It also records constraints that prevent known failures from returning.

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/tacyan/zaivern-code/claude-md
Clone the repo
git clone --depth 1 https://github.com/tacyan/zaivern-code
Per session 19,910 This file is loaded in full into every session.
When invoked 19,910 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.19910 $0.19910
Opus 5 $0.09955 $0.09955
Sonnet 5 $0.03982 $0.03982
Haiku 4.5 $0.01991 $0.01991

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

Security

Grade C, and why

zaivern-code 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 2d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

(curl | sh / irm | iex) が一度も見ていなかった**。作っているのに使っていない

Makes network callslowCapability

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

(curl | sh / irm | iex) が一度も見ていなかった**。作っているのに使っていない
CLAUDE.md · 696 lines

How it starts

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

CLAUDE.md — Zaivern Code 開発ガイド(AIエージェント向け)

このファイルはリポジトリで作業する全ての AI エージェント/開発者が最初に読むこと。

絶対ルール

  • ハードコーディング禁止。 どの環境(macOS / Windows / Linux、任意のユーザー名・ホーム・ロケール)でも動くコードのみ。
    • パスは std::env::temp_dir() / dirs クレート / 設定から導出。/tmp/Users/...C:\ の直書き禁止。
    • OS 差分は cfg!(windows) 等で分岐し、両側を実装する。
    • エージェント固有値(resume フラグ、コマンド名等)は agents.rs のカタログにデータとして持つ。
  • egui 0.29 固定(アップグレード禁止)・rustc 1.88+。
  • 道具は Rust に置く。シェル (tools/*.sh) までは可。Python は置かない。 検証・生成・変換の道具を .py で書くと、リポジトリに第 2 の言語と第 2 の 実行環境が増える(どの python か・依存はあるか・Windows で動くか)。 Rust なら zai <sub> として利用者にもそのまま渡せて、番人テストと同じ実装を 共有できる(2 つ持つとずれて、番人が緑なのに製品が壊れている嘘が出る)。
    • 実例: 翻訳の保守は zai i18n missing / apply / check。走査と エスケープ解除は src/locale.rsscan_source_literals / unescape_rust 1 か所だけを、CLI とテストの両方が呼ぶ
    • 一度きりの作業スクリプトはリポジトリの外(scratchpad)で書き捨てる
  • vendor/vt100 はパッチ済みベンダリング。 visible_rows 修正を外すと deep scrollback で debug パニックが再発する。バージョンアップ時は必ずパッチを移植。
  • リリースは checksums.txt を必ず作り、インストーラは必ずそれを検証する。 release.yml の checksums ジョブ (5 ターゲット + install.sh + install.ps1 + SBOM = 8 行、 形式検査つき fail-closed) と、install.shverify_checksum / install.ps1Test-Checksumである。片方だけ外してはいけない。
    • 検証は展開の前tar xzf / Expand-Archive より前)。書き出してから 気付いても、そのファイルはもうディスクにある
    • 取得失敗・行が無い・道具が無い・不一致 — どの理由でも中止する。 「確かめられなかったので、とりあえず入れた」は検証していないのと同じ
    • 番人は cli::tests::インストーラは展開前にsha256を検証するcli::tests::検証できないときは中止する落ちたら直すのは実装であってテストではない
    • 0.16.0 まで checksums.txt は生成されていたのに、最重要の自動インストール経路 (curl | sh / irm | iex) が一度も見ていなかった。作っているのに使っていない チェックサムは、作っていないのと同じ意味しか持たない
  • main へ直接コミットしない。作業はブランチ+隔離ワークツリー(.claude/worktrees/)で行う(複数の AI エージェントが同時編集する前提)。
  • 統合したワークツリーは即座に消す。 ブランチが統合先の祖先になった時点で git worktree remove + git branch -D まで行う。各ワークツリーは独立した target/ を持つため、放置すると1つあたり数 GB積み上がる (実測: 15 個で 47GB)。ディスクだけの問題ではなく、ページキャッシュが 押し出されてテスト実行が数倍遅くなる。
  • git stash を使わない。 stash スタックは全ワークツリーで共有されるため、 同時に動いている別のインスタンスの退避を巻き込む。退避が要るなら WIP コミットを切る。
  • UI から到達できない実装は「未完成」。 完了報告の前に cargo checknever used 警告を必ず確認し、自分が追加した公開関数・型・コマンドが 実際に呼ばれていることを確かめる。この警告は「作ったのに繋いでいない」の検出器である。 到達経路(パレット / メニュー / ボタン / キーバインドのいずれか)を必ず1つ以上用意し、 用意できないなら README には機能として書かず、未完項目として残す。
  • 機能を増やす前に減らせないかを考える。 同じ操作への到達経路が3つあるなら 2つ削る。常に0を表示するバッジ、中身より空状態を見せる時間が長いパネル、 ツールバーとヘッダで重複するボタンは、実装した本人が消す。
  • 新しい機能は src/features/<名前>.rs を新規作成するだけで足す。 app.rs / palette.rs / feature.rs / main.rs を編集しない。

Read the full file on GitHub · 696 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. 2d ago First seen · 696 lines · 19,910 tokens per session scan C 9bb1c4af72eb

Subscribe to this mod's changes

zaivern-code CLAUDE.md is an instructions file published in the GitHub repository tacyan/zaivern-code (8 stars, last pushed 2d ago), licensed Apache-2.0. It adds 19,910 tokens to every session, about $0.0995 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). 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