claude-typescript-sdk

Build AI applications with the Anthropic TypeScript SDK. Use when creating Claude integrations, building agents, implementing tool use, streaming responses, or working with the @anthropic-ai/sdk package.

16 stars

Best use case

claude-typescript-sdk is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Build AI applications with the Anthropic TypeScript SDK. Use when creating Claude integrations, building agents, implementing tool use, streaming responses, or working with the @anthropic-ai/sdk package.

Teams using claude-typescript-sdk should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/claude-typescript-sdk/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/ai-agents/claude-typescript-sdk/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/claude-typescript-sdk/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How claude-typescript-sdk Compares

Feature / Agentclaude-typescript-sdkStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Build AI applications with the Anthropic TypeScript SDK. Use when creating Claude integrations, building agents, implementing tool use, streaming responses, or working with the @anthropic-ai/sdk package.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Claude TypeScript SDK

## Quick Start

```bash
npm install @anthropic-ai/sdk
export ANTHROPIC_API_KEY='your-key'
```

```typescript
import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic();
const message = await client.messages.create({
  model: 'claude-opus-4-5-20251101',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Hello!' }],
});
```

## Core Patterns

### Basic Message
```typescript
const message = await client.messages.create({
  model: 'claude-opus-4-5-20251101',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Your prompt' }],
});
console.log(message.content[0].type === 'text' && message.content[0].text);
```

### Streaming
```typescript
const stream = client.messages.stream({
  model: 'claude-opus-4-5-20251101',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Write a poem' }],
});
stream.on('text', (text) => process.stdout.write(text));
const final = await stream.finalMessage();
```

### Tool Use
```typescript
const tools: Anthropic.Tool[] = [{
  name: 'get_weather',
  description: 'Get weather for a location',
  input_schema: {
    type: 'object',
    properties: {
      location: { type: 'string', description: 'City name' },
    },
    required: ['location'],
  },
}];

const response = await client.messages.create({
  model: 'claude-opus-4-5-20251101',
  max_tokens: 1024,
  tools,
  messages: [{ role: 'user', content: 'Weather in NYC?' }],
});
```

For detailed examples, see [REFERENCE.md](REFERENCE.md).

## Available Models

- `claude-opus-4-5-20251101` - Most capable
- `claude-sonnet-4-5-20250929` - Balanced
- `claude-haiku-4-5-20251001` - Fastest

## Error Handling

```typescript
try {
  const message = await client.messages.create({...});
} catch (error) {
  if (error instanceof Anthropic.APIError) {
    console.error(`Status: ${error.status}, Message: ${error.message}`);
  }
}
```

## Resources

- [TypeScript SDK GitHub](https://github.com/anthropics/anthropic-sdk-typescript)
- [API Documentation](https://docs.claude.com)
- [Agent SDK Demos](https://github.com/anthropics/claude-agent-sdk-demos)

Related Skills

moai-cc-claude-md

16
from diegosouzapw/awesome-omni-skill

Authoring CLAUDE.md Project Instructions. Design project-specific AI guidance, document workflows, define architecture patterns. Use when creating CLAUDE.md files for projects, documenting team standards, or establishing AI collaboration guidelines.

claude-player

16
from diegosouzapw/awesome-omni-skill

An AI-powered Game Boy emulator agent that uses Claude's vision and reasoning to autonomously play Game Boy games.

claude-opus-4-5-migration

16
from diegosouzapw/awesome-omni-skill

Migrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5. Use when the user wants to update their codebase, prompts, or API calls to use Opus 4.5. Handles model string updates and prompt adjustments for known Opus 4.5 behavioral differences. Does NOT migrate Haiku 4.5.

claude-config-management

16
from diegosouzapw/awesome-omni-skill

Claude Code設定(リポジトリルート)の構成管理ガイド。ファイルレベルsymlinkによる設定管理、管理対象の追加・削除、Taskfileタスクの実行方法を提供する。「設定ファイルを追加して」「新しいスキルを追加して」「symlinkの状態を確認して」「Claude設定を変更して」のようにClaude Code設定の構成変更を行うときに使用する。

varlock-claude-skill

16
from diegosouzapw/awesome-omni-skill

Secure environment variable management ensuring secrets are never exposed in Claude sessions, terminals, logs, or git commits

upstash/workflow TypeScript SDK Skill

16
from diegosouzapw/awesome-omni-skill

Lightweight guidance for using the Upstash Workflow SDK to define, trigger, and manage workflows. Use this Skill whenever a user wants to create workflow endpoints, run steps, or interact with the Upstash Workflow client.

upstash/search TypeScript SDK

16
from diegosouzapw/awesome-omni-skill

Entry point for documentation skills covering Upstash Search quick starts, core concepts, and TypeScript SDK usage. Use when a user asks how to get started, how indexing works, or how to use the TS client.

typescript

16
from diegosouzapw/awesome-omni-skill

TypeScript. Proyecto usa este skill; contenido canónico en .ai-system.

typescript-pro

16
from diegosouzapw/awesome-omni-skill

Master TypeScript with advanced types, generics, and strict type safety. Handles complex type systems, decorators, and enterprise-grade patterns. Use PROACTIVELY for TypeScript architecture, type inference optimization, or advanced typing patterns.

typescript-expert

16
from diegosouzapw/awesome-omni-skill

TypeScript and JavaScript expert with deep knowledge of type-level programming, performance optimization, monorepo management, migration strategies, and modern tooling.

templar-miner-claude-skill

16
from diegosouzapw/awesome-omni-skill

This skill should be used when setting up, optimizing, or managing Templar AI miners on Bittensor Subnet 3 (netuid 3). Use it for tasks involving miner configuration, performance optimization, troubleshooting gradient scoring issues, managing Bittensor wallets with btcli, monitoring miner metrics, renting GPUs via Basilica for mining operations, or strategizing to achieve top miner ranking in the Templar decentralized training network. Integrates seamlessly with the basilica-cli-helper skill for GPU rentals.

programmatic-claude

16
from diegosouzapw/awesome-omni-skill

Run Claude Code programmatically via CLI (-p flag), Python SDK, or TypeScript SDK. For automation, CI/CD, session chaining, headless execution, and orchestrating multiple Claude instances. Triggers: programmatic, headless, CLI automation, session chaining, -p flag, Python SDK, orchestrate Claude, CI/CD Claude, run Claude automatically.