Mod API Types
The Mod API ships a type file that your editor reads. These pages follow the copy inside the 2.1.312 program.
This site publishes that copy unchanged as https://clawdipedia.cc/schemas/claude-code.d.ts.
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 | The types of on, next, matchers, and traces. |
| 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 early access, so a type may change between releases.
- Types have no switch and hold no settings. They live in the type file. The program also writes that file beside each mod as
.claude-plugin/types/claude-code/index.d.ts. - Where the type file has a doc comment, the description follows it. Where it has none, the description comes from the name and the shape. It also comes from the pages that document the same thing, such as Input and Output.
Check a Field Before You Use It
The type file is the full list of fields for this release. Build on the fields it names.
- Search
schemas/claude-code.d.tsfor the type, call, or event name, and read its doc comment. - An AI agent with the docs plugin can call
get_schemawithname: "types"andpropertyset to a type (ToolCheckResult), a member (ToolCheckResult.plugin), a call ($.tool.check), or an event (tool.check). - When a name is missing from the file, report it as unconfirmed for this release and look up the closest name the file has.