/orchestra:instrumentfrom orchestra
Instruments a running LLM app to capture traces without code changes. Detects the provider SDK (OpenAI, Anthropic, LangChain, Vercel AI SDK), redirects through the Orchestra gateway via env vars, and verifies a capture landed.
Ships in orchestra. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
../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."
Prefer the installed orchestra binary. If it is unavailable inside a repo
checkout, run through the package script:
npm run build
node dist/bin.js instrument --check --json
skills/onboard/ as an explicitly separate,
approval-gated step — do not silently edit.sk_* values. Use orchestra run -- <cmd>
to inject credentials into the child process only (see
../use-understudy-gateway/SKILL.md)..env if the developer
explicitly asks, and never commit it.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 |
Per-SDK env-var behavior, base-URL shapes (/v1 or not), and hardcoded-URL
detection greps are in reference.md.
Also confirm the developer can actually trigger one call: an npm script, a CLI invocation, a test, or a curl to their own app. If they cannot, stop — there is nothing to capture yet.
Reuse the login/key flow in
../use-understudy-gateway/SKILL.md —
do not duplicate it here. In short: orchestra status --json; if not signed
in, the two-phase orchestra login --email / --code flow; then confirm
orchestra projects list --json. Gateway capture is on by default for
gateway traffic, so no extra capture toggle is needed.
Preferred: run the app (or one test invocation) through the wrapper, which
injects UNDERSTUDY_API_KEY and UNDERSTUDY_GATEWAY_URL into the child
process only, and set the SDK base-URL env var inline:
# Anthropic SDK app (note: no trailing /v1 — the SDK appends it)
ANTHROPIC_BASE_URL="$UNDERSTUDY_GATEWAY_URL" orchestra run -- <your app command>
# OpenAI SDK app (OpenAI-shape wants the /v1 suffix)
OPENAI_BASE_URL="${UNDERSTUDY_GATEWAY_URL:-https://api.understudylabs.com}/v1" \
orchestra run -- <your app command>
orchestra run resolves the stored credentials, so inside the child process
$UNDERSTUDY_GATEWAY_URL is set; the SDK's own env var points it there. The
provider API key env var can stay as-is — the gateway authenticates with the
Orchestra key that orchestra run injects (see the gateway skill for
key-header details per shape).
Trigger exactly one real call through the app, then confirm the capture landed before saying anything succeeded:
orchestra captures list --json # newest capture should match the test call
orchestra instrument --check --json # local sanity: env redirect + capture presence
If captures list shows nothing new: check orchestra doctor --hosted,
re-grep for a hardcoded baseURL shadowing the env var, and confirm the app
process actually inherited the env (a daemon started earlier did not).
understudy-served localhost endpoint that records calls and forwards to
the provider; do not promise one. The zero-code path is the gateway
redirect above.skills/onboard/ (anthropic-typescript.md, openai-typescript.md,
universal-typescript.md) as an explicit, approved edit — outside this
skill's no-code promise.../ingest-traces/SKILL.md, which turns a
JSONL/CSV export in .understudy/captures/ into local redacted eval sets.Once roughly 20–50 captures exist (enough for a first slice), route onward:
../ingest-traces/SKILL.md.../capture-evidence/SKILL.md.Report to the developer: what was redirected, how many captures exist, and which handoff you chose.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
43 skills in this plugin
/audit-verifier-reliabilityUse when deciding whether a verifier reward is trustworthy for optimization./calibrate-difficultyMeasure per-band model headroom from a local, source-bound run artifact before investing in training./capture-evidenceUse when a developer wants to build an eval from their real LLM app before changing anything — "measure how my app is doing today", "build an eval from my workload", "we have no baseline", "is my current model actually good". Turns the workload into auditable local artifacts (harness, metric, frozen splits, baseline); has a public-benchmark on-ramp when no traces exist./check-routing-healthUse when a developer asks "is Orchestra causing my errors", "which workloads are routed", "is my routing config actually taking effect", "is my provider healthy", "are there 500s on staging", "what's our error rate", "where is my gateway spend going", or wants self-service diagnostics without asking the team. Reads the hosted reporting endpoints with the developer's sk_* key./compare-model-sweepUse when a developer wants to compare candidate models — any mix of local, gateway, or frontier — on the same eval and see quality, latency, cost, and reliability side by side. "Which model should I use", "sweep these models on my benchmark", "compare Gemma vs the frontier on my eval". To stand up and serve a local candidate first, use run-local-model-lab./compare-trajectoriesUse when you need to know HOW two model runs differ behaviorally on the same tasks, not just THAT one scores higher — per-task trajectory diffing that classifies the gap as persistence/recovery, knowledge, or format/parsing. "why does the bigger model pass these", "is this gap RL-shaped", "diff these two trajectory runs", "where do the trajectories diverge", "what would distillation buy me". The behavioral complement to compare-model-sweep.npx claudepluginhub understudylabs/orchestra-agent-tools --plugin orchestraOther plugins' skills for the same job