[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78Y649609C7DEXJ3PASYW90":3,"skill-same:01M78Y649609C7DEXJ3PASYW90":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M78Y649609C7DEXJ3PASYW90","clade-performance-tuning",null,"Optimize Anthropic API latency — streaming, prompt caching, model selection,\nUse when working with performance-tuning patterns.\nconnection reuse, and parallel requests.\nTrigger with \"anthropic slow\", \"claude latency\", \"speed up anthropic\",\n\"anthropic performance\", \"claude response time\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--claude-pack--clade-performance-tuning\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: clade-performance-tuning\ndescription: |\n  Optimize Anthropic API latency — streaming, prompt caching, model selection,\n  Use when working with performance-tuning patterns.\n  connection reuse, and parallel requests.\n  Trigger with \"anthropic slow\", \"claude latency\", \"speed up anthropic\",\n  \"anthropic performance\", \"claude response time\".\nallowed-tools: Read, Write, Edit\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ncompatible-with: claude-code\ntags: [saas, anthropic, claude, performance, latency]\n---\n\n# Anthropic Performance Tuning\n\n## Overview\nClaude latency has two components: **time to first token (TTFT)** and **tokens per second (TPS)**. Different strategies target each.\n\n## Latency Benchmarks (approximate)\n\n| Model | TTFT (p50) | TTFT (p95) | Output TPS |\n|-------|-----------|-----------|------------|\n| Claude Haiku 4.5 | 200ms | 600ms | ~150 |\n| Claude Sonnet 4 | 400ms | 1.2s | ~90 |\n| Claude Opus 4 | 800ms | 2.5s | ~40 |\n\n## Optimization Strategies\n\n## Instructions\n\n### Step 1: Always Stream\n```typescript\n\u002F\u002F Streaming delivers the first token ASAP — user sees response instantly\n\u002F\u002F instead of waiting for the full response to generate\n\nconst stream = client.messages.stream({\n  model: 'claude-sonnet-4-20250514',\n  max_tokens: 1024,\n  messages,\n});\n\n\u002F\u002F First token arrives in ~400ms (Sonnet)\n\u002F\u002F Full response may take 5-10s, but user sees progress immediately\nfor await (const event of stream) {\n  if (event.type === 'content_block_delta') {\n    yield event.delta.text;\n  }\n}\n```\n\n### Step 2: Prompt Caching — Faster TTFT\n```typescript\n\u002F\u002F Cached prompts skip re-processing — dramatically lower TTFT for large system prompts\nconst message = await client.messages.create({\n  model: 'claude-sonnet-4-20250514',\n  max_tokens: 1024,\n  system: [{\n    type: 'text',\n    text: largeSystemPrompt, \u002F\u002F 10K+ tokens\n    cache_control: { type: 'ephemeral' },\n  }],\n  messages,\n}, {\n  headers: { 'claude-beta': 'prompt-caching-2024-07-31' },\n});\n\u002F\u002F TTFT drops from ~2s to ~500ms on cache hit with large prompts\n```\n\n### Step 3: Use Haiku for Speed-Critical Paths\n```typescript\n\u002F\u002F Haiku is 2-4x faster than Sonnet with 80% quality for many tasks\n\u002F\u002F Use for: classification, extraction, simple Q&A, routing decisions\n\nconst route = await client.messages.create({\n  model: 'claude-haiku-4-5-20251001', \u002F\u002F 200ms TTFT\n  max_tokens: 10,\n  system: 'Classify the intent. Reply with exactly one word: search, create, update, delete.',\n  messages: [{ role: 'user', content: userInput }],\n});\n\n\u002F\u002F Then use Sonnet\u002FOpus for the actual task\n```\n\n### Step 4: Reuse Client Instance\n```typescript\n\u002F\u002F BAD — creates new connection pool per request\napp.get('\u002Fapi\u002Fchat', async (req, res) => {\n  const client = new Anthropic(); \u002F\u002F DON'T\n  \u002F\u002F ...\n});\n\n\u002F\u002F GOOD — single client shared across requests\nconst client = new Anthropic(); \u002F\u002F Module-level singleton\n\napp.get('\u002Fapi\u002Fchat', async (req, res) => {\n  const message = await client.messages.create({ ... });\n  \u002F\u002F ...\n});\n```\n\n### Step 5: Parallel Requests\n```typescript\n\u002F\u002F When you need multiple independent Claude calls, fire them in parallel\nconst [summary, sentiment, entities] = await Promise.all([\n  client.messages.create({ model: 'claude-haiku-4-5-20251001', max_tokens: 200,\n    messages: [{ role: 'user', content: `Summarize: ${text}` }] }),\n  client.messages.create({ model: 'claude-haiku-4-5-20251001', max_tokens: 20,\n    messages: [{ role: 'user', content: `Sentiment (positive\u002Fnegative\u002Fneutral): ${text}` }] }),\n  client.messages.create({ model: 'claude-haiku-4-5-20251001', max_tokens: 200,\n    messages: [{ role: 'user', content: `Extract named entities from: ${text}` }] }),\n]);\n```\n\n### Step 6: Minimize Output Tokens\n```typescript\n\u002F\u002F Fewer output tokens = faster response\nsystem: 'Be extremely concise. Use bullet points, not paragraphs.',\n\n\u002F\u002F Set tight max_tokens\nmax_tokens: 256, \u002F\u002F Don't use 4096 for short answers\n```\n\n## Output\n- Streaming enabled for all user-facing responses (first token in ~400ms with Sonnet)\n- Prompt caching reducing TTFT for large system prompts\n- Model routing to Haiku for speed-critical classification\u002Frouting tasks\n- Client instance reused across requests (no per-request connection overhead)\n- Parallel requests firing independent Claude calls concurrently\n\n## Error Handling\n| Issue | Cause | Fix |\n|-------|-------|-----|\n| TTFT > 3s | Large uncached prompt | Enable prompt caching |\n| Slow output | Using Opus for simple tasks | Downgrade to Haiku\u002FSonnet |\n| Timeouts | Long generation + default timeout | `new Anthropic({ timeout: 120_000 })` |\n| 529 overloaded | API capacity | SDK auto-retries; add fallback model |\n\n## Examples\nSee Latency Benchmarks table and six numbered strategy sections above, each with complete TypeScript code examples.\n\n## Resources\n- [Streaming Docs](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fapi\u002Fmessages-streaming)\n- [Prompt Caching](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fbuild-with-claude\u002Fprompt-caching)\n- [Models Comparison](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fabout-claude\u002Fmodels)\n\n## Next Steps\nSee `clade-deploy-integration` for production deployment patterns.\n\n## Prerequisites\n- Completed `clade-install-auth`\n- User-facing application where latency matters\n- Understanding of streaming and async patterns\n","# Anthropic Performance Tuning\n\n## Overview\nClaude latency has two components: **time to first token (TTFT)** and **tokens per second (TPS)**. Different strategies target each.\n\n## Latency Benchmarks (approximate)\n\n| Model | TTFT (p50) | TTFT (p95) | Output TPS |\n|-------|-----------|-----------|------------|\n| Claude Haiku 4.5 | 200ms | 600ms | ~150 |\n| Claude Sonnet 4 | 400ms | 1.2s | ~90 |\n| Claude Opus 4 | 800ms | 2.5s | ~40 |\n\n## Optimization Strategies\n\n## Instructions\n\n### Step 1: Always Stream\n```typescript\n\u002F\u002F Streaming delivers the first token ASAP — user sees response instantly\n\u002F\u002F instead of waiting for the full response to generate\n\nconst stream = client.messages.stream({\n  model: 'claude-sonnet-4-20250514',\n  max_tokens: 1024,\n  messages,\n});\n\n\u002F\u002F First token arrives in ~400ms (Sonnet)\n\u002F\u002F Full response may take 5-10s, but user sees progress immediately\nfor await (const event of stream) {\n  if (event.type === 'content_block_delta') {\n    yield event.delta.text;\n  }\n}\n```\n\n### Step 2: Prompt Caching — Faster TTFT\n```typescript\n\u002F\u002F Cached prompts skip re-processing — dramatically lower TTFT for large system prompts\nconst message = await client.messages.create({\n  model: 'claude-sonnet-4-20250514',\n  max_tokens: 1024,\n  system: [{\n    type: 'text',\n    text: largeSystemPrompt, \u002F\u002F 10K+ tokens\n    cache_control: { type: 'ephemeral' },\n  }],\n  messages,\n}, {\n  headers: { 'claude-beta': 'prompt-caching-2024-07-31' },\n});\n\u002F\u002F TTFT drops from ~2s to ~500ms on cache hit with large prompts\n```\n\n### Step 3: Use Haiku for Speed-Critical Paths\n```typescript\n\u002F\u002F Haiku is 2-4x faster than Sonnet with 80% quality for many tasks\n\u002F\u002F Use for: classification, extraction, simple Q&A, routing decisions\n\nconst route = await client.messages.create({\n  model: 'claude-haiku-4-5-20251001', \u002F\u002F 200ms TTFT\n  max_tokens: 10,\n  system: 'Classify the intent. Reply with exactly one word: search, create, update, delete.',\n  messages: [{ role: 'user', content: userInput }],\n});\n\n\u002F\u002F Then use Sonnet\u002FOpus for the actual task\n```\n\n### Step 4: Reuse Client Instance\n```typescript\n\u002F\u002F BAD — creates new connection pool per request\napp.get('\u002Fapi\u002Fchat', async (req, res) => {\n  const client = new Anthropic(); \u002F\u002F DON'T\n  \u002F\u002F ...\n});\n\n\u002F\u002F GOOD — single client shared across requests\nconst client = new Anthropic(); \u002F\u002F Module-level singleton\n\napp.get('\u002Fapi\u002Fchat', async (req, res) => {\n  const message = await client.messages.create({ ... });\n  \u002F\u002F ...\n});\n```\n\n### Step 5: Parallel Requests\n```typescript\n\u002F\u002F When you need multiple independent Claude calls, fire them in parallel\nconst [summary, sentiment, entities] = await Promise.all([\n  client.messages.create({ model: 'claude-haiku-4-5-20251001', max_tokens: 200,\n    messages: [{ role: 'user', content: `Summarize: ${text}` }] }),\n  client.messages.create({ model: 'claude-haiku-4-5-20251001', max_tokens: 20,\n    messages: [{ role: 'user', content: `Sentiment (positive\u002Fnegative\u002Fneutral): ${text}` }] }),\n  client.messages.create({ model: 'claude-haiku-4-5-20251001', max_tokens: 200,\n    messages: [{ role: 'user', content: `Extract named entities from: ${text}` }] }),\n]);\n```\n\n### Step 6: Minimize Output Tokens\n```typescript\n\u002F\u002F Fewer output tokens = faster response\nsystem: 'Be extremely concise. Use bullet points, not paragraphs.',\n\n\u002F\u002F Set tight max_tokens\nmax_tokens: 256, \u002F\u002F Don't use 4096 for short answers\n```\n\n## Output\n- Streaming enabled for all user-facing responses (first token in ~400ms with Sonnet)\n- Prompt caching reducing TTFT for large system prompts\n- Model routing to Haiku for speed-critical classification\u002Frouting tasks\n- Client instance reused across requests (no per-request connection overhead)\n- Parallel requests firing independent Claude calls concurrently\n\n## Error Handling\n| Issue | Cause | Fix |\n|-------|-------|-----|\n| TTFT > 3s | Large uncached prompt | Enable prompt caching |\n| Slow output | Using Opus for simple tasks | Downgrade to Haiku\u002FSonnet |\n| Timeouts | Long generation + default timeout | `new Anthropic({ timeout: 120_000 })` |\n| 529 overloaded | API capacity | SDK auto-retries; add fallback model |\n\n## Examples\nSee Latency Benchmarks table and six numbered strategy sections above, each with complete TypeScript code examples.\n\n## Resources\n- [Streaming Docs](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fapi\u002Fmessages-streaming)\n- [Prompt Caching](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fbuild-with-claude\u002Fprompt-caching)\n- [Models Comparison](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fabout-claude\u002Fmodels)\n\n## Next Steps\nSee `clade-deploy-integration` for production deployment patterns.\n\n## Prerequisites\n- Completed `clade-install-auth`\n- User-facing application where latency matters\n- Understanding of streaming and async patterns\n",{"name":5,"tags":24,"author":30,"license":15,"version":31,"description":32,"allowed-tools":33,"compatible-with":34},[25,26,27,28,29],"saas","anthropic","claude","performance","latency","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Optimize Anthropic API latency — streaming, prompt caching, model selection,\nUse when working with performance-tuning patterns.\nconnection reuse, and parallel requests.\nTrigger with \"anthropic slow\", \"claude latency\", \"speed up anthropic\",\n\"anthropic performance\", \"claude response time\".\n","Read, Write, Edit","claude-code","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fsaas-packs--claude-pack--clade-performance-tuning",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill clade-performance-tuning",{"tool":50,"command":51},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill clade-performance-tuning",{"tool":53,"command":54},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill clade-performance-tuning","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--claude-pack--clade-performance-tuning\u002FSKILL.md",true,[],[59,66,73,80,87,95],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":91,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]