Tool, Command, and Config Types
These are the types behind $.tool, $.command, and $.config.
They describe a tool call, a permission check, a command run, and a row of the /config menu.
Pages
| Page | What is in it |
|---|---|
| Command, Config, and Registered Tool Types | Builtin to Registered: built-in tool calls, command types, / row types, and registered tool specs. |
| Tool Call, Check, and Describe Types | Tool to Tool: tool call results, permission checks, descriptions, envelopes, and summaries. |
Example
The first call asks the permission system about a tool call. The second line reads the messages of a subagent that made a tool use.
const { decision } = await $.tool.check({ tool: "Read", input });
if (use.agentId) child = await $.session.messages({ agentId: use.agentId });
Types without Fields
These types are aliases, unions, or plain shapes. Each row gives its use and its shape.
| Type | Status | What it is for | Shape and limits |
|---|---|---|---|
Builtin | Documented: An official docs page names this item. | The arguments of each built-in tool by name, for declaration merging. It is empty until a declaration file adds entries. Then e. narrows e to the arguments of Bash. | Interface. The engine lays the set of this build beside a mod that it loads (claude-code-tools/index.d.ts), from the input schema of each tool. |
Builtin | Documented: An official docs page names this item. | The names of the built-in tools. | Alias of keyof Builtin. |
Builtin | Documented: An official docs page names this item. | The structured result of each built-in tool by name, for declaration merging. It is empty until a declaration file adds entries. Then after e. the result of next(e) is the record of Bash. | Interface. The engine lays the set of this build beside a mod that it loads (claude-code-tools/index.d.ts), from the output schema of each tool. A tool without one is unknown. |
Command | Documented: An official docs page names this item. | What a command. hook returns: the description, hint and hidden flag that the menu uses. The name, immediate and provider stay as they were. | Alias of Omit<Command. Used by command., $.. |
Command | Documented: An official docs page names this item. | Where a slash command comes from, as $. tells them apart. | Alias of 'builtin' | 'plugin' | 'user' | 'mcp'. builtin ships with Claude Code. user is the own file of the person or project. |
Config | Documented: An official docs page names this item. | What a config. hook returns: the label, help text and hidden flag that the menu uses. The key and provider stay as they were. | Alias of Omit<Config. Used by config., $.. |
Config | Documented: An official docs page names this item. | How a / row takes its value: boolean toggles, choice picks one of its options, text takes a string, number a number. | Alias of 'boolean' | 'choice' | 'text' | 'number'. |
Config | Documented: An official docs page names this item. | The input of config. as the $. of a plugin takes it: the key of the row and the value. The engine fills the rest. | Alias of Pick<Config. Used by $.. |
Config | Documented: An official docs page names this item. | The value of a / row as a hook and $. see it. It is a boolean (toggle), a string (choice or text), a number, or a list of strings. | Alias of boolean | string | number | readonly string[]. |
Tool | Documented: An official docs page names this item. | The input of tool. as the call takes it. tool_ and agent may ride along (a hook that passes the input of its event on) and the call drops them. | Alias of Tool. The run gets its own id and runs in the loop of the session. |
Tool | Documented: An official docs page names this item. | The envelope that the two tool events share. It has the tool, the id of this call, and the arguments of the tool spread beside them (e. for Bash). | Alias of Builtin. A union keyed by tool. After if (e., e. is a string. |
Tool | Documented: An official docs page names this item. | The input of tool.: the tool, the id of this call, the arguments of the tool beside them (e. for Bash), and agent in a subagent. | Alias of Tool. tool, tool_, and agent are reserved. A rewrite of any is refused. Used by tool.. |
Tool | Documented: An official docs page names this item. | $.: resolves with result typed for the tool that input names (ToolCallResult), or loosely for an input that names none literally. | Alias of { <T extends string>(input:. Used by $.. |
Tool | Documented: An official docs page names this item. | The input of tool. as $. takes it: the tool and its arguments. The engine sets the id of the call, agent, the ceiling, the approver, and is. | Alias of Pick<Tool. Used by $.. |
Tool | Documented: An official docs page names this item. | Who answers the asks of a tool. evaluation: host, the program that answers a hosted session's asks or a served call's own session, or person, a dialog or a card the person answers (new in 2.1.307, replaces Tool). | Alias of 'host' | 'person'. Used by Tool. |
Tool | Documented: An official docs page names this item. | The verdict of tool.: run the tool, refuse it, or put it to a decider. The decider is the decider of the mode (the dialog, the auto-mode classifier, a headless host). For the ask of a hook, it is a person. | Alias of 'allow' | 'ask' | 'deny'. |
Tool | Documented: An official docs page names this item. | Where a tool. answer places the tool: true behind ToolSearch (its schema loads when the model asks for it), false in the list of the prompt. | Alias of boolean. Left out of an answer, the placement beneath stands. |
Tool | Documented: An official docs page names this item. | The structured result of the tool named Name: its BuiltinToolResults entry for a built-in tool, else unknown. | Alias of the result type of a tool by name. Agent also allows a teammate or call record. unknown covers an MCP tool or an unknown name. |