Group of 5 Under the hood
Plugins can declare a validated types file describing what they add, generated into a new claude-code-plugins.d.ts
What
- Plugin manifests (
plugin.json) can now declare atypesfield pointing at a.d.tsfile that describes the plugin's type contract: what it adds to the shared$object viaengine.createand declares onEngineInterface. The path must end in.d.tsand stay inside the plugin directory. - A new validator strictly checks the declared type contract: it rejects imports/requires/references, runnable code, stray tokens, non-ASCII or control characters,
@ts-pragmas, and anything other thandeclare module 'claude-code' { ... }or type/interface exports. - Valid contracts are copied into a
claude-code-plugins/folder and referenced from a generatedclaude-code-plugins.d.tsfile. - The
/plugin-typescommand now writes thisclaude-code-plugins.d.tsfile in addition to the existingclaude-code.d.tsandclaude-code-mcp.d.ts. - Plugin validation also reports, as a warning, which members of the plugin's declared interface it exposes on
$.
Why
This lets plugin authors declare and get type-checking for the custom functionality their plugin adds, with /plugin-types generating declaration files that editors and tooling can use for autocomplete and validation.
Names in the bundletypes
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Added since
A small documentation edit on How the agent loop works touched a line naming types after this was published.
All result subtypes carry `total_cost_usd`, `usage`, `num_turns`, and `session_id` so you can track cost and resume even after errors. Guard for these cases:agent-sdk/agent-loop see the edit
Confirmed since
Anthropic's documentation has since written up types, on Persist sessions to external storage.
Both SDK repositories include runnable reference adapters under [`examples/session-stores/`](https://github.com/anthropics/claude-agent-sdk-typescript/tree/main/examples/session-stores) in TypeScript and [`examples/session_stores/`](https:…agent-sdk/session-storage see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
Anthropic's documentation has since written up types, on Persist sessions to external storage.