Add Claude Sonnet 5 Behind a Provider Contract, Not Across Your Codebase Anthropic announced Claude Sonnet 5 on June 30, 2026, for coding, agents, and professional work. A developer recommends integrating new models behind a provider contract using a generic Event interface and adapter pattern, rather than spreading provider-specific code across the application. The approach includes a validated event log and tool policy gate to prevent unsafe direct tool calls. Anthropic announced Claude Sonnet 5 https://www.anthropic.com/news on June 30, 2026, positioning it for coding, agents, and professional work. A model release is easiest to adopt when the rest of the application does not know the vendor's wire format. Here is the TypeScript seam I want first: type ToolCall = { id: string; name: string; arguments: unknown; }; type Event = | { type: "text"; delta: string } | { type: "tool"; call: ToolCall } | { type: "usage"; input: number; output: number } | { type: "done"; reason: string }; interface ModelProvider { stream input: { system: string; messages: Array<{ role: "user" | "assistant"; content: string } ; tools: Array<{ name: string; schema: object } ; signal: AbortSignal; } : AsyncIterable