monty CLAUDE.md

monty CLAUDE.md is an instructions file for Claude Code from pydantic/monty. It costs 15,195 tokens per session, scanned A, original, MIT.

Project instructions for Monty, a Rust program that runs a limited form of Python in a protected environment. They describe the project goals, shared boundary types, supported systems, and a rule not to commit changes unless asked.

In plain words
What is it for?
Use them when changing Monty's Rust interpreter, Python parsing or execution, host callbacks, shared types, platform support, or repository workflow.
Why use it?
They help an agent preserve the interpreter's security model and cross-platform behavior while working on an unfinished codebase. They also make clear which project rules take priority during development.

Instructions file for Claude Code

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

Not installable on its own: it reads a path above its own folder, which only exists inside its repository. The line is make docs-dev Preview this checkout in a sibling pydantic/unified-docs checkout (../unified-docs).

About the project

Monty is a minimal Python interpreter written in Rust that runs AI-generated code in a restricted environment without direct filesystem, environment-variable, or network access. It is for AI agents that need to execute Python and type-checking tasks while allowing developers to control which host functions and objects the code can use, and the catalogue entries integrate it into agent workflows.

pydantic/monty · 8,162 stars · on GitHub · pydantic.dev

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/pydantic/monty/claude-md.svg)](https://agentmods.dev/instructions/pydantic/monty/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/pydantic/monty/claude-md"><img src="https://agentmods.dev/badge/instructions/pydantic/monty/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 15,195 This file is loaded in full into every session.
When invoked 15,195 The same file — it is already loaded in full.
Security scan A 1 finding. 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.1 $0.15195 $0.15195
Opus 5 $0.07598 $0.07598
Sonnet 5 $0.03039 $0.03039
Haiku 4.5 $0.01520 $0.01520

Measured today against content hash 359fce74b26f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

monty CLAUDE.md 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 today.

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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- subprocess/shell execution - os.system, subprocess, etc.
CLAUDE.md · 1,109 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

DON'T COMMIT UNLESS EXPLICITLY ASKED TO DO SO BY THE USER! Previous commit requests do not matter - don't commit unless you've just been explicitly asked to do so.

Project Overview

Monty is a sandboxed Python interpreter written in Rust. It parses Python code using Ruff's ruff_python_parser but implements its own runtime execution model for safety and performance. This is a work-in-progress project that currently supports a subset of Python features.

Project goals:

  • Safety: Execute untrusted Python code safely without FFI or C dependencies, instead sandbox will call back to host to run foreign/external functions.
  • Performance: Fast execution through compile-time optimizations and efficient memory layout
  • Simplicity: Clean, understandable implementation focused on a Python subset
  • Snapshotting and iteration: Plan is to allow code to be iteratively executed and snapshotted at each function call
  • Cross-platform: Runs on Linux, macOS, and Windows (and any other OS that can run Rust)
  • Targets the latest stable version of Python, currently Python 3.14

monty-types — shared boundary types

The public data types (MontyObject, MontyException/ExcType, OsFunctionCall + its arg structs, ResourceLimits/ResourceTracker, PrintStream/PrintWriter, CompileOptions, ExtFunctionResult, FileMode, ...) live in crates/monty-types, which depends on no other monty crate except the monty-macros derives. monty depends on monty-types but does not blanket re-export it — only a few types are re-exported inline where they appear in monty's public API (e.g. run::CompileOptions, run_progress::{ExtFunctionResult, NameLookupResult}). Code needing MontyObject, MontyException, OsFunctionCall, etc. must depend on monty-types directly.

Host-side crates (monty-fs, monty-pool, monty-proto without its worker feature, monty-python, monty-js) MUST depend on monty-types, NOT monty — this keeps the interpreter out of their binaries. Only the worker side (monty-runtime, monty-wasm-runtime, monty-proto with worker) links the interpreter. Don't add a monty dependency to a host-side crate; if it needs a type, that type belongs in monty-types.

Read the full file on GitHub · 1,109 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. today Changed · +52 lines · +1,097 tokens per session 359fce74b26f
  2. 2d ago Changed · +6 lines · +138 tokens per session 94698cee12d3
  3. 6d ago First seen · 1,051 lines · 13,960 tokens per session scan A 006b310124af

Subscribe to this mod's changes

monty CLAUDE.md is an instructions file published in the GitHub repository pydantic/monty (8,162 stars, last pushed yesterday), licensed MIT. It adds 15,195 tokens to every session, about $0.0760 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.