clade-observability

Featured

Monitor Claude API calls — log tokens, latency, costs, errors, and Use when working with observability patterns. set up alerts for production Claude integrations. Trigger with "anthropic monitoring", "claude observability", "track claude usage", "anthropic logging".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Anthropic Observability ## Overview Every `messages.create` call should be instrumented. Track tokens, latency, cost, model, and errors. ## Logging Wrapper ```typescript 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); const log = { timestamp: new Date().toISOString(), model: message.model, input_tokens: message.usage.input_tokens, output_tokens: message.usage.output_tokens, cache_read_tokens: message.usage.cache_read_input_tokens || 0, duration_ms: durationMs, stop_reason: message.stop_reason, estimated_cost: estimateCost(message.model, message.usage), }; console.log('anthropic_request', JSON.stringify(log)); return message; } catch (err) { const durationMs = Math.round(performance.now() - start); console.error('anthropic_error', JSON.stringify({ timestamp: new Date().toISOString(), model: params.model, error_type: err instanceof Anthropic.APIError ? err.error?.type : 'unknown', status: err instanceof Anthropic.APIError ? err.status : null, request_id: err instanceof Anthropic.APIError ? err.headers?.['request-id'] : null, duration_ms: durationMs, })); throw err; } } function estimateCost(model: s...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

anth-observability

Set up observability for Claude API integrations with metrics, logging, and alerting for latency, cost, errors, and token usage. Trigger with phrases like "anthropic monitoring", "claude observability", "anthropic metrics", "track claude usage", "claude dashboard".

2,266 Updated today
jeremylongshore
AI & Automation Featured

clade-cost-tuning

Optimize Anthropic API costs — model selection, prompt caching, batches, Use when working with cost-tuning patterns. token reduction, and usage monitoring. Trigger with "anthropic pricing", "claude cost", "reduce anthropic spend", "anthropic billing", "claude cheaper".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-cost-tuning

Optimize Anthropic Claude API costs with model routing, prompt caching, batching, and spend monitoring. Use when analyzing Claude API billing, reducing costs, or implementing cost controls and budget alerts. Trigger with phrases like "anthropic cost", "claude billing", "reduce claude spend", "anthropic budget", "claude pricing optimize".

2,266 Updated today
jeremylongshore
AI & Automation Listed

claude-api

Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.

1 Updated 1 weeks ago
DROOdotFOO
AI & Automation Listed

claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

0 Updated today
CodeWithBehnam