clade-observability
Installation
SKILL.md
Anthropic Observability
Overview
Every messages.create call should be instrumented. Track tokens, latency, cost, model, and errors.
Logging Wrapper
import Anthropic from '@claude-ai/sdk';
const client = new Anthropic();
async function trackedCreate(params: Anthropic.MessageCreateParams) {
const start = performance.now();
try {
const message = await client.messages.create(params);
const durationMs = Math.round(performance.now() - start);