Claude starter module
Claude library
Centralizes the Anthropic client, tool definitions, model settings, and prompt cache rules.
- Files
- 7
- Lines
- 537
- Languages
- TypeScript
Included files
This page lists paths and purposes, not source contents.
src/lib/anthropic-client.ts
Creates the single server-side Anthropic client the whole starter shares.
TypeScript
22 lines
src/lib/app-adapter.ts
Connects generic Claude handlers to your app's database, accounts, and limits.
TypeScript
167 lines
src/lib/approved-models.ts
The trusted catalog of models this app may call, with per-model limits.
TypeScript
79 lines
src/lib/env.ts
Reads Anthropic and notification settings from the environment and rejects missing values.
TypeScript
74 lines
src/lib/request-account.ts
Resolves which app account is making an AI request.
TypeScript
12 lines
src/lib/types.ts
Shared types for the Claude starter: the adapter contract, usage records, and tool results.
TypeScript
132 lines
src/lib/with-retries.ts
Retries an Anthropic call on rate limits and transient server errors, nothing else.
TypeScript
51 lines