monte-carlo-instrument-agent

monte-carlo-instrument-agent is a skill for Claude Code from monte-carlo-data/mc-agent-toolkit. It costs 56 tokens per session (2,719 once invoked), scanned A, original, Apache-2.0.

A setup guide for adding tracing to a new AI agent in a Python project. Tracing records the agent’s steps so they can be inspected later.

In plain words
What is it for?
Use it to prepare a Python AI agent for Monte Carlo Agent Observability, suggest tracing decorators as code changes, set needed environment variables, and check that traces are arriving.
Why use it?
It removes the guesswork from finding the AI libraries, adding the required OpenTelemetry software, and choosing where to record agent work. It asks for approval before changing files.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Good fit Use it to prepare a Python AI agent for Monte Carlo Agent Observability, suggest tracing decorators as code changes, set needed environment variables, and check that traces are arriving.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/monte-carlo-data/mc-agent-toolkit/instrument-agent
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 monte-carlo-data/mc-agent-toolkit --skill instrument-agent
Clone the repo
git clone --depth 1 https://github.com/monte-carlo-data/mc-agent-toolkit

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 monte-carlo-instrument-agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/monte-carlo-data/mc-agent-toolkit/instrument-agent.svg)](https://agentmods.dev/skills/monte-carlo-data/mc-agent-toolkit/instrument-agent)
Your own site
<a href="https://agentmods.dev/skills/monte-carlo-data/mc-agent-toolkit/instrument-agent"><img src="https://agentmods.dev/badge/skills/monte-carlo-data/mc-agent-toolkit/instrument-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,719 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00056 $0.02719
Opus 5 $0.00028 $0.01359
Sonnet 5 $0.00011 $0.00544
Haiku 4.5 $0.00006 $0.00272

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

Security

Grade A, and why

monte-carlo-instrument-agent scanned grade A with 0 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 7d ago.

The scan reads SKILL.md. This mod also ships 11 executable files (scripts/detect_libraries.py, scripts/fetch_sdk_docs.py, tests/fixtures/existing-setup/src/tracing_alias.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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/instrument-agent/SKILL.md · 125 lines

How it starts

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

Monte Carlo Instrument-Agent Skill

This skill walks an MC Agent Observability customer through instrumenting a new AI agent in their Python codebase: detect AI libraries → install the Monte Carlo OpenTelemetry SDK + matching instrumentors → generate mc.setup() (with SimpleSpanProcessor when serverless) → propose @trace_with_workflow / @trace_with_task decorator diffs → confirm env vars (only when needed) → verify traces flow via get_agent_metadata.

The skill produces traces. It is not for monitoring or alerting on existing traces — that's monte-carlo-monitoring-advisor. The two skills are sequential: instrument-agent first, monitoring-advisor afterward.

Monte Carlo tool routing (required): Always call Monte Carlo MCP tools through this plugin's bundled server, whose fully-qualified tool names are mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__<tool> (e.g. mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__get_alerts). Bare tool names used in this skill (get_alerts, search, get_table, …) refer to that bundled server. If the session also has a separately-configured monte-carlo-mcp server, do not route to it — it may point at a different endpoint or credentials.

Reference files live next to this file. Use the Read tool (not MCP resources) to access them.

CRITICAL — Never modify any file without explicit user approval

This skill must not modify any file in the customer's codebase without explicit per-file user approval. This rule covers:

  • Dependency filesrequirements.txt, pyproject.toml, Pipfile, lockfiles. Always propose the diff and wait for confirmation before editing.
  • Source codemc.setup() insertion, decorator placement (@trace_with_workflow, @trace_with_task), import additions. Always propose the diff and wait for confirmation per file.
  • Env files.env, .envrc, shell rc files. Always propose the change and wait for confirmation before editing.

The skill walks the user through what needs to change and why, then proposes diffs. It does not apply edits, run pip install, or write env files autonomously. The only exception: the user may explicitly waive approval for a specific file ("I know the risks, just edit the file") — proceed for that file only and surface that the approval was waived.

Read the full file on GitHub · 125 lines

Files

What ships with it

32 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. 7d ago First seen · 125 lines · 56 tokens per session scan A 6ed1c7b5194f

Subscribe to this mod's changes

monte-carlo-instrument-agent is a skill published in the GitHub repository monte-carlo-data/mc-agent-toolkit (91 stars, last pushed 13d ago), licensed Apache-2.0. It adds 56 tokens to every session and 2,719 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

spark-environment-setup

Set up a working ML training/inference environment on NVIDIA DGX Spark (GB10, aarch64, CUDA 13). Use when installing PyTorch/Unsloth/TRL/vLLM on DGX Spark, hitting libcudart or wheel-ABI errors on aarch64, or choosing between NGC containers and bare pip installs.

wshobson/agents · 76 tokens

spark-training-gotchas

Preflight and diagnose the ten known failure modes for ML training on NVIDIA DGX Spark. Use when a training run on DGX Spark fails to start, OOMs below the 128GB limit, slows down mid-run, or before any multi-hour training job on GB10.

wshobson/agents · 63 tokens

9router-stt

Speech-to-text via 9Router /v1/audio/transcriptions using OpenAI Whisper / Groq / Gemini / Deepgram / AssemblyAI / NVIDIA / HuggingFace models. Use when the user wants to transcribe audio, convert speech to text, or get subtitles from audio files.

decolua/9router · 63 tokens

9router

Entry point for 9Router — local/remote AI gateway with OpenAI-compatible REST for chat, image, TTS, embeddings, web search, web fetch. Use when the user mentions 9Router, NINEROUTERURL, or wants AI without writing provider boilerplate. This skill covers setup + indexes capability skills; fetch the relevant capability…

decolua/9router · 84 tokens

9router-embeddings

Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.

decolua/9router · 66 tokens

dashscope

DashScope (Alibaba Cloud Bailian / 阿里云百炼) integration — image generation (qwen-image-2.0-pro), text-to-speech (qwen3-tts-flash), and ASR with word-level timestamps (qwen3-asr-flash-filetrans). Use when generating images via Qwen-Image, narrating via Qwen-TTS, or transcribing with word-level timestamps via Qwen-ASR.

calesthio/OpenMontage · 93 tokens