monty: Instructions file for Claude Code

CLAUDE.md

monty CLAUDE.md is an instructions file for Claude Code from pydantic/monty. It costs 17,073 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.

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

Needs its repository: it reads a path above its own folder, which exists only inside the 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,801 stars · on GitHub · pydantic.dev

Reuse

Borrowing it

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/pydantic/monty/claude-md"><img src="https://agentmods.dev/badge/instructions/pydantic/monty/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17,073 This file is loaded in full into every session.
When invoked 17,073 The same file — it is already loaded in full.
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.17073 $0.17073
Opus 5.5 $0.06829 $0.06829
Sonnet 5.5 $0.03415 $0.03415
Haiku 4.5 $0.01707 $0.01707

Measured 3d ago against content hash 3d6a94b09f53, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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,183 lines

How it starts

The opening of the file, as written. The whole thing — 1,183 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. It 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 (the MontyGraph/MontyNode value graph and the MontyObject/CallArgs/NamedValues built on it, 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,183 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 Changed · +7 lines · +121 tokens per session 3d6a94b09f53
  2. 5d ago Changed · +6 lines · +151 tokens per session f8ad6fe1f9a5
  3. 8d ago Changed · +4 lines · +63 tokens per session a468ed4db1b3
  4. 9d ago Changed · +4 lines · +99 tokens per session 84c5e019ac18
  5. 11d ago Changed · +15 lines · +260 tokens per session 9282a957afe5
  6. 14d ago Changed · +2 lines · +29 tokens per session 7a02170b33a7
  7. 19d ago Changed · +1 lines · +40 tokens per session ddd8439c0f41
  8. 27d ago Changed · +12 tokens per session c835a1a41eab
  9. 1mo ago Changed · -90 lines · -1,160 tokens per session 2074453b55b2
  10. 1mo ago First seen · 1,234 lines · 17,458 tokens per session scan A a494a8c0c712

Subscribe to this mod's changes

monty CLAUDE.md is an instructions file published in the GitHub repository pydantic/monty (8,801 stars, last pushed today), licensed MIT. It adds 17,073 tokens to every session, about $0.0683 per session on Opus 5.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.

Related

Other instructions, from other repositories

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 · 9,715 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,461 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens