Skip to main content

Measurement reference

Follow Measure on your traffic for the Claude Code plugin workflow. The commands below run from a benchmark kit checkout with dependencies installed.

Prerequisites​

RequirementValue
RuntimeNode.js 22.13+, npm and git
ConnectExecutable at ANYRAY_CONNECT_BIN or ~/.anyray/bin/anyray-connect
Claude CodeSigned in; resolve one absolute binary and pin its version for both arms
GatewayANYRAY_GATEWAY_URL, matching the frozen gateway
Benchmark keyANYRAY_BENCH_CLIENT_KEY, a dedicated benchmark service key for the intended tenant
Admin credentialANYRAY_TRACE_TOKEN, then ANYRAY_TRACE_KEY, then ANYRAY_ADMIN_KEY; needs session-gate and spend read access
Direct credentialAnthropic: ANYRAY_UPSTREAM_TOKEN or a valid Claude Code subscription token accessible through the macOS keychain. Bedrock: configured AWS profile and region
Extra headersClear ANYRAY_BENCH_EXTRA_HEADERS and ANYRAY_BENCH_SHARED_HEADERS; overrides are refused

Keep credentials in the environment. Kit execution supports Claude Code; plan --client codex classifies a Codex seat but does not enable this workflow to execute Codex runs.

Commands​

Use --scenarios-dir ./client-scenarios on every command below. Add --json for structured output; omit it for human output. Set each scenario's source to client or proposed. Complete repo.git, pin repo.ref to a 40-character commit, and supply exactly one grading key: check, citations or keyFacts. Fill caps and any relevant patch, paste files or mcpTools. Keep client tasks verbatim.

CommandKey flagsResult
npm run plan ----budget-usd <budget> --session-cost-usd <direct-session-cost> --gateway <url>; optional --tenant <id>, --client codexSplits the budget evenly; shows predictions, pairs needed, detectable saving and spend ceiling. No model calls or file writes. Refuses an unreadable or all-shadow tenant gate
npm run freeze ----model <model> --provider <provider> --client claude-code --client-version <version> --gateway <url>; --replace only for an approved replacement planFreezes predictions and kit Git HEAD with the plan's pins
npm run verify --Common flags aboveChecks the frozen plan; retains its predictions even if the catalog changes

Use your own typical direct-session cost for --session-cost-usd. An insufficient budget prints resolvable: false. Review and approve freeze separately from an explicit Start for paid work. Run verify again before steps that depend on an existing lock.

Paid commands

noise and run spend money. Use them only after an explicit Start for the frozen plan and stated ceiling. A larger scope or ceiling needs a new plan and Start.

CommandKey flagsResult
npm run noise ----claude-bin <absolute-path> --rounds 6At least six interleaved direct-versus-direct pairs per scenario; records measured log-ratio SD and reprints pairs needed
npm run run ----claude-bin <absolute-path> --rounds <approved-rounds> --redraw-holdout 2Paired sessions using tenant defaults. Two holdout redraws by default; the final holdout is excluded even with --redraw-holdout 0
npm run verdict --Common flags aboveVerdicts and actual medians against frozen prediction bands
npm run report --Required --redact; add --json for the validated publishable bodyHuman output includes scenario ids; JSON contains aggregate shapes and statistics. Creates no HTML file
npm run publish-result --Common flags aboveSends that validated body only to the frozen gateway; prints the result id. Missing or mixed gateway versions prevent sharing
npm run release-check --Common flags aboveCompares the gateway version with this plan's newest published result; an unreadable gateway fails the check

Run noise before paired tests. Both arms use the resolved Claude Code binary checked against the lock's version. Repeating noise or run adds rounds; monitor an existing run before resuming. Never duplicate a running command, repeat completed work or retry a losing pair.

Plan lock​

ItemContract
plan.lock.jsonKeyed plan hash covers every scenario file, pins, kit commit and prediction
Frozen changesAny change needs a new plan, freeze approval and Start. Never edit frozen scenarios or hand-write the lock
freeze --replaceNew plan with a fresh nonce and current prediction catalog
Noise blockSigned noise floor added without changing the plan hash
Results<scenarios-dir>/.kit-results/<planHash>/, with an ignoring .gitignore; a replacement plan gets a separate directory
Record contentsAllowlisted hashes, counts, costs, outcomes and versions after grading; no tasks, repositories, patches, transcripts, tool I/O, diffs or check output

Result publication excludes the nonce. See the guide's local data boundary before publishing a result.

Per-release template​

Install this separately when you choose to run future paid tests in CI. This path deliberately stores scenarios and the lock in your private repository.

SetupValue
TemplateCopy kit/workflows/anyray-regression.yml to .github/workflows/anyray-regression.yml in your private scenarios repository
InputsCommit scenarios and plan.lock.json at the repository root after measuring noise
Repository variableANYRAY_GATEWAY_URL
SecretsANYRAY_ADMIN_KEY, ANYRAY_BENCH_CLIENT_KEY, ANYRAY_UPSTREAM_TOKEN (provider API credentials for CI)
Admin scopessettings:read, client-tests:read, client-tests:write, optimizer:read, traces:read, spend:read
ScheduleDaily release-check; only a changed gateway version starts paid rounds. Manual dispatch also runs them
PinsKit commit and Claude Code version from the lock; CI keeps the frozen plan and measured noise floor
RunnerOptional ANYRAY_TEST_RUNNER, default ubuntu-latest. Bedrock needs a self-hosted runner whose instance role reaches Bedrock
OIDCIf added, include id-token: write in your workflow copy
Supported clientClaude Code plans

Workflow installation and result publication are separate choices. Retain freeze and Start gates for future paid work.