Mod API Types
The Mod API ships a type file, types-2.1.304.d.ts, that your editor reads.
These pages list every type in that file that you can use, grouped by topic.
Each type is a row or a field row, with its use and its shape.
Import the types with import type { ... } from 'claude-code'. The import is empty at run time.
Pages
| Page | What is in it |
|---|---|
| Classic Event Types | Inputs and results of the classic. events, which mirror the settings hooks. |
| Event Table Types | How an event name maps to its input, result, and call on $. |
| Hook Machinery Types | How on, next, matchers, and traces are typed. |
| Files, State, Clock, HTTP, Process, and Settings Types | Types behind $., $., $., $., $., $., $., $.. |
| Model, Audio, and MCP Types | Types behind $., $., $.. |
| Session Types | Messages, context size, cost, and rate limits. |
| Testing Types | The claude- module. |
| Tool, Command, and Config Types | Tool calls, permission checks, command runs, / rows. |
| Turn and Prompt Types | Prompts, attachments, system prompt sections, the prompt box, model steps. |
| UI Types | $., element props, panes, scroll, and render inputs. |
How to Read the Type Pages
- Each page has a table of types without fields, then one section for each type that has fields.
- The Documented badge means the type is in the published type file, which the docs call the complete reference.
- The type file is marked early access, so a type may change between releases.
- Types have no switch and hold no settings. They live in the published type file
types-2.1.304.d.tsand in.claude-plugin/types/claude-code/index.d.ts. - Some doc comments in the type file are short. Rows without one say "Not described in the type file."