anthropic-sdk-typescript: Instructions file for Claude Code

CLAUDE.md

anthropic-sdk-typescript CLAUDE.md is an instructions file for Claude Code from anthropics/anthropic-sdk-typescript. It costs 8,370 tokens per session, scanned A, original, Apache-2.0.

Repository guidance for a TypeScript software development kit whose code must work in both browser and Node.js environments.

In plain words
What is it for?
Use it when adding imports, Node.js integrations, browser fallbacks, package exports, or tests for runtime and type compatibility.
Why use it?
It prevents browser builds from accidentally including Node.js-only modules, which can make bundlers fail or produce unusable browser packages.

Instructions file for Claude Code ✓ vendor

Written for Claude Code: the file is CLAUDE.md.

This is anthropics/anthropic-sdk-typescript's own configuration. It tells Claude Code how to work on anthropic-sdk-typescript itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything anthropic-sdk-typescript configures →

About the project

anthropic-sdk-typescript is a TypeScript and JavaScript library for calling the Claude API from server-side applications and supported runtimes. It is used by developers building software that sends requests to Anthropic's language models.

anthropics/anthropic-sdk-typescript · 2,165 stars · on GitHub · npmjs.com

Reuse

Borrowing it

Nothing to install: this file belongs to anthropics/anthropic-sdk-typescript. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/anthropics/anthropic-sdk-typescript/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/anthropics/anthropic-sdk-typescript

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for anthropic-sdk-typescript CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/anthropics/anthropic-sdk-typescript/claude-md/github.svg)](https://agentmods.dev/instructions/anthropics/anthropic-sdk-typescript/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/anthropics/anthropic-sdk-typescript/claude-md"><img src="https://agentmods.dev/badge/instructions/anthropics/anthropic-sdk-typescript/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for anthropic-sdk-typescript CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/anthropics/anthropic-sdk-typescript/claude-md"><img src="https://agentmods.dev/badge/instructions/anthropics/anthropic-sdk-typescript/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 8,370 This file is loaded in full into every session.
When invoked 8,370 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.08370 $0.08370
Opus 5.5 $0.03348 $0.03348
Sonnet 5.5 $0.01674 $0.01674
Haiku 4.5 $0.00837 $0.00837

Measured today against content hash b164e8d3f052, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

anthropic-sdk-typescript CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 345 lines

How it starts

The opening of the file, as written. The whole thing — 345 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Working in this repository

Context for contributors (human or AI) on how this repository is put together, plus the things reviews most often come back to.

This repository's own rules

The generator writes the rest of this file. Rules about this repository's hand-written code go in this section, and a change anywhere else in the file belongs in the generator.

Overview

  • The official TypeScript SDK for the Claude API (@anthropic-ai/sdk). Hand-written helpers, streams, tool runners, credentials, and middleware sit on top of the generated code. The platform clients live in packages/{aws,bedrock,foundry,google-cloud,vertex}-sdk and are released as separate packages.
  • src/helpers/ and src/tools/ are hand-written, like src/lib/ and examples/. The generator never touches them.
  • packages/ is hand-written too, except for each package's package.json and build files: build, tsc-multi.json, the tsconfig*.json files, vitest.config.mts, and tests/vitest-globals.d.ts.
  • stream(), parse(), and toolRunner() in src/resources/beta/messages/messages.ts are hand-written.
  • Each package has its own CHANGELOG.md, so a PR adds its line to the changelog of the package it changes.
  • Describe a public type change in its doc comment and in its changelog line.

Build, test, lint

  • The repository is a single pnpm workspace (pnpm-workspace.yaml). Only the root package.json pins packageManager.
  • ./scripts/test runs vitest at the root and then in each platform package. Extra arguments go to the root run only, so ./scripts/test tests/lib/parser.test.ts narrows that run and the platform packages' suites still follow.
  • Tests talk to the mock server, a mocked fetch, or recorded fixtures. Tests that do call a real endpoint, such as packages/google-cloud-sdk/tests/live.test.ts, are skipped unless ANTHROPIC_LIVE=1 is set.
  • pnpm test:ecosystem runs ecosystem-tests/cli.mts against real runtimes and bundlers, including Deno, Bun, Cloudflare Workers, edge, browsers, and TypeScript 5.0. Mark a project knownFailure only when its fix is already tracked.
  • toolUseBlock is kept as a @deprecated alias for toolUse. unrestrictedPaths on the environment worker throws when it's passed, because its old behavior can't be honored at all.
  • zod is an optional peer dependency, because callers pass their own zod schemas to the helpers, so the SDK has to use the caller's copy of the library.

Read the full file on GitHub · 345 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +46 lines · +1,163 tokens per session b164e8d3f052
  2. yesterday Changed · +177 tokens per session 6e88eabb0e28
  3. 13d ago Changed · -4 tokens per session 3c9058400775
  4. 15d ago Changed · +2 lines · +214 tokens per session 53e567176b7d
  5. 16d ago Changed · +18 tokens per session 2d33e9b96e16
  6. 22d ago Changed · +32 lines · +678 tokens per session 0602f79ba427
  7. 27d ago Changed · -1 lines · -38 tokens per session 78efc999ab13
  8. 28d ago Changed · +143 lines · +1,562 tokens per session 2d337e54a914
  9. 1mo ago Changed · +113 lines · +4,356 tokens per session 4d66a085cefc
  10. 2mo ago First seen · 10 lines · 244 tokens per session scan A bf92f764928a

Subscribe to this mod's changes

anthropic-sdk-typescript CLAUDE.md is an instructions file published in the GitHub repository anthropics/anthropic-sdk-typescript (2,165 stars, last pushed yesterday), licensed Apache-2.0. It adds 8,370 tokens to every session, about $0.0335 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

anthropic-sdk-typescript CLAUDE.md compared with instructions from other repositories

anthropic-sdk-typescript CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
anthropic-sdk-typescript CLAUDE.mdanthropics/anthropic-sdk-typescriptInstructions file2.2kyesterdayApache-2.0A8,370Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode