instrument

A setup process for capturing requests and responses from a running language-model application without editing its code. It detects the provider software and redirects calls through the Understudy gateway, which records the resulting traces.

In plain words
What is it for?
Use it to start tracing an agent or LLM app, verify a test capture, and prepare data for later evaluation or analysis.
Why use it?
It provides usable traces when your application has none yet. The redirect sends prompts and completions through the gateway, so you are told what will be captured and asked for approval.

Skill for Claude CodeCodex

Part of the understudy plugin — 43 skills, 1 command shipped together

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 skills/understudylabs/understudy-agent-tools/instrument
Any agent
npx skills add understudylabs/understudy-agent-tools --skill instrument
Clone the repo
git clone --depth 1 https://github.com/understudylabs/understudy-agent-tools

Made for: Claude Code, Codex.

Or install understudy, the plugin that ships this one along with the rest of its 43 skills, 1 command.

Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,737 The whole file, excluding the scripts and references it only reads on demand.
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 $0.00098 $0.01737
Opus 5 $0.00049 $0.00869
Sonnet 5 $0.00020 $0.00347
Haiku 4.5 $0.00010 $0.00174

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

Security

Grade A, and why

instrument 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.

Makes network callslowCapability

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

CLI invocation, a test, or a curl to their own app. If they cannot, stop —
skills/instrument/SKILL.md · 143 lines

How it starts

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

Instrument

../ingest-traces/SKILL.md and ../capture-evidence/SKILL.md assume traces already exist. This worker is the on-ramp before that: a running app, zero traces, and a developer who wants captures flowing without editing app code. One redirect, one test call, one verified capture — then hand off.

Say this up front: "This takes about 5 minutes: ~1 minute to detect your SDK, ~2 minutes to sign in if you haven't, ~1 minute to redirect and verify a test call. No code changes, and nothing leaves your machine without your approval."

Resolve CLI

Prefer the installed understudy binary. If it is unavailable inside a repo checkout, run through the package script:

npm run build
node dist/bin.js instrument --check --json

Safety Gates

  • No app-code edits on this path. The whole point is env-var redirection. If a codebase hardcodes a base URL so env vars cannot work, say so and offer the code-patch recipes in skills/onboard/ as an explicitly separate, approval-gated step — do not silently edit.
  • Redirecting traffic through the gateway is an external write of the developer's prompts and completions (that is what capture is). State this plainly and get explicit approval before the first redirected call.
  • Never print, commit, or write sk_* values. Use understudy run -- <cmd> to inject credentials into the child process only (see ../use-understudy-gateway/SKILL.md).
  • Set redirect env vars in the launch command or the developer's shell session, not in checked-in files. Only write to .env if the developer explicitly asks, and never commit it.
  • Do not declare success until a capture is verified to exist (step 4).

Step 1 — Detect what the app talks to (~1 min)

Inspect the project read-only. Look at package.json / requirements.txt / pyproject.toml / lockfiles and grep call sites:

Found Provider path
@anthropic-ai/sdk, anthropic (py) Anthropic-shape → ANTHROPIC_BASE_URL
openai (ts/py) OpenAI-shape → OPENAI_BASE_URL
langchain, langchain-openai, langchain-anthropic Wraps the SDKs above — same env vars apply
ai + @ai-sdk/openai / @ai-sdk/anthropic (Vercel AI SDK) Usually needs a baseURL in the provider factory — check first; env redirect only works if the factory reads the env var
litellm OpenAI-shape → OPENAI_BASE_URL or litellm's own base-url config
none of the above / hardcoded baseURL Env redirect will not bite — see the honest fallbacks below

Read the full file on GitHub · 143 lines

Files

What ships with it

1 file 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. 3d ago First seen · 143 lines · 98 tokens per session scan A 40682ba07eb5

Subscribe to this mod's changes

instrument is a skill published in the GitHub repository understudylabs/understudy-agent-tools (16 stars, last pushed 3d ago), licensed MIT. It adds 98 tokens to every session and 1,737 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

bigquery-ai-ml

Leverages BigQuery's built-in machine learning and GenAI capabilities for advanced data analytics. Use when you need to write SQL queries that perform time-series forecasting, predict values, detect outliers or anomalies, find key drivers, perform semantic search or vector search, classify text, calculate similarity…

google/skills · 104 tokens

ondb

A logical analysis and reasoning tool for AI. Use when decomposing documents into structured knowledge, querying entities and relations, validating consistency, or indexing files. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", "analyze this document", entity CRUD, or cross-skill…

x-cmd/x-cmd · 71 tokens

neuron-evaluation-engineer

Create and run AI evaluations with datasets, assertions, and output drivers in Neuron AI. Use this skill whenever the user mentions evaluation, testing AI systems, creating evaluators, dataset-driven testing, assertion-based validation, or wants to measure AI system performance. Also trigger for tasks involving…

neuron-core/neuron-ai · 77 tokens

mixed-precision

Use FP16/BF16 mixed precision to accelerate training and reduce memory. Use when optimizing GPU performance.

aiming-lab/AutoResearchClaw · 25 tokens

sparse-autoencoder-training

Provides guidance for training and analyzing Sparse Autoencoders (SAEs) using SAELens to decompose neural network activations into interpretable features. Use when discovering interpretable features, analyzing superposition, or studying monosemantic representations in language models.

Orchestra-Research/AI-Research-SKILLs · 58 tokens