hazmat: Instructions file for Claude Code

CLAUDE.md

hazmat CLAUDE.md is an instructions file for Claude Code from dredozubov/hazmat. It costs 2,897 tokens per session, scanned B, original, MIT.

Repository instructions for Hazmat, a macOS command-line tool that runs AI agents in a restricted environment. They cover the project layout, build and test steps, and formally checked safety rules.

In plain words
What is it for?
Use them when changing Hazmat’s containment setup, sandbox rules, snapshots, upgrades, or related Go and verification code.
Why use it?
They help prevent changes that could weaken isolation or break the guarantees checked by the project’s formal specifications.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions Codex.

This is dredozubov/hazmat's own configuration. It tells Claude Code how to work on hazmat 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 hazmat configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dredozubov/hazmat. 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/dredozubov/hazmat/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/dredozubov/hazmat

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dredozubov/hazmat/claude-md.svg)](https://agentmods.dev/instructions/dredozubov/hazmat/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/dredozubov/hazmat/claude-md"><img src="https://agentmods.dev/badge/instructions/dredozubov/hazmat/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,897 This file is loaded in full into every session.
When invoked 2,897 The same file — it is already loaded in full.
Security scan B 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.02897 $0.02897
Opus 5 $0.01448 $0.01448
Sonnet 5 $0.00579 $0.00579
Haiku 4.5 $0.00290 $0.00290

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

Security

Grade B, and why

hazmat CLAUDE.md scanned grade B 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 8d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **Hazmat-owned agent maintenance stays on the narrow sudoers rule.** Session launches and helper-routed maintenance use the NOPASSWD rule for `hazmat-launch`. Generic manual `sudo -u agent` flows are a separate, broade
CLAUDE.md · 212 lines

How it starts

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

CLAUDE.md — Hazmat

What this is

Hazmat is a macOS CLI tool that runs AI agents (Claude Code, etc.) inside containment: dedicated system user, seatbelt sandboxing, pf firewall, DNS blocklist, and automatic snapshots. Written in Go, single binary + cgo helper.

Before you change anything

Read tla/VERIFIED.md first. tla/VERIFIED.md is the authoritative record of Hazmat's formal verification scope and proof boundaries. Changes in verified areas MUST update the TLA+ spec and pass TLC before the Go implementation changes. This is not optional.

Spec What it governs Key invariant
MC_SetupRollback Init step ordering, rollback ordering AgentContained — sudoers never without firewall
MC_SeatbeltPolicy Seatbelt policy structure, credential denies CredentialReadDenied — credential dirs always denied
MC_BackupSafety Snapshot/restore lifecycle RestoreReversible — every overwrite has a prior snapshot
MC_Migration Version upgrades, rollback from any state AgentContained through migration and rollback states
MC_Tier3LaunchContainment Tier 3 host-side launch boundary CredentialPathsNeverMounted — Tier 3 never mounts credential zones
MC_TierPolicyEquivalence Tier 2 vs Tier 3 core policy contract CanonicalCoreContainmentEquivalent — canonical core containment matches across both backends
MC_SessionPermissionRepairs Session-time host permission repair planning and rollback persistence RollbackPreservesSessionRepairs — core rollback never reverts an applied session repair
MC_HarnessLifecycle Built-in harness state recording and rollback cleanup RollbackClearsMetadata — rollback removes the host-owned harness metadata record
MC_LaunchFDIsolation Native helper fd-table hygiene before sandbox_init() AgentFDTableAllowlisted — final agent exec sees stdio only
MC_GitSSHRouting Multi-key per-project Git-SSH routing DeterministicRouting — every host maps to at most one key in a ready config
MC_GitHookApproval Repo-local Git hook approval, pinning, and drift refusal ApprovedContentOnly — approved hook execution uses the immutable approved snapshot
MC_SecretStoreRecovery File-backed harness auth crash recovery LatestValueNeverSilentlyLost — recovery never drops the newest host-owned secret value
MC_CredentialCapabilityLifecycle Registry-level credential delivery and cleanup DeliveryMatchesRegistry — delivery mode follows the registered credential capability
MC_LinuxNativeLaunch Future Linux native helper launch ordering ExecAfterMetadata — exec happens only after enforcement and metadata emission
MC_BeadpostBrokerBoundary Beadpost broker attestation membrane NoAuthorityFromAgent — authority is derived host-side, never accepted from the contained agent
MC_AppleContainerLaunch Apple Container backend launch boundary CredentialPathsNeverMounted — credential deny zones and their parents are never in the mount plan
MC_ServiceHarnessLifecycle OpenHands-style service harness lifecycle AttachOnlyAfterReady — service attach waits for readiness evidence

Read the full file on GitHub · 212 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. 8d ago First seen · 212 lines · 2,897 tokens per session scan B 87a52a889a4c

Subscribe to this mod's changes

hazmat CLAUDE.md is an instructions file published in the GitHub repository dredozubov/hazmat (172 stars, last pushed 6d ago), licensed MIT. It adds 2,897 tokens to every session, about $0.0145 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens