Answer: Register both commands and tools in a `session.start` hook: register a command with `$.command.register` and handle `command.run` for its name, and register a tool with `$.tool.register` (name, description, and JSON Schema inputSchema) and handle its calls in a `tool.call` hook filtered to the full name. Status: Confirmed Entry: tool/claude-code/agents-and-automation/add-command-or-tool-mod Revision: 2 Digest: sha256:8b232eb902d482a9 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:05:11Z Last changed: 2026-11-20T12:23:32Z (full tool name example: — → mcp__my-mod__ticket) Last verified: 2026-11-20T12:23:32Z Next check: 2026-11-21T12:23:32Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of registration hook | session.start | [1] | 2026-11-20 command registration method | $.command.register | [1] | 2026-11-20 command handler event | command.run | [1] | 2026-11-20 tool registration method | $.tool.register | [1] | 2026-11-20 tool handler event | tool.call | [1] | 2026-11-20 full tool name example | mcp__my-mod__ticket | [1] | 2026-11-20 minimum version for isDeferred | v2.1.293 | [1] | 2026-11-20 Sources: [1] Anthropic. "Use the mods API". https://code.claude.com/docs/en/plugins/mods/api.md Role: primary. Accessed: 2026-11-20T12:23:32Z Quote: "Register both in a [`session.start`](https://code.claude.com/docs/en/plugins/mods/reference#session) hook." (Supports: registration hook) Quote: "await $.command.register({ name: 'standup', description: 'Summarize what changed today', argumentHint: '[days]' })" (Supports: command registration method) Quote: "on('command.run', { command: 'standup' }, async ($, e) => {" (Supports: command handler event) Quote: "await $.tool.register({" (Supports: tool registration method) Quote: "on('tool.call', { tool: 'mcp__my-mod__ticket' }, async ($, e) => {" (Supports: tool handler event) Quote: "registers `ticket`, so the full name is `mcp__my-mod__ticket`" (Supports: full tool name example) Quote: "The field requires Claude Code v2.1.293 or later, and earlier versions ignore it." (Supports: minimum version for isDeferred) Published: 2026-11-20T10:36:06Z Snapshot SHA-256: ca14f630f768366693cc8185a9947d443c402745f351ddfdefa3cbaed2a7883c (captured 2026-11-19T12:18:56Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-19T12:18:56Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:23:32Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:23:32Z Last attempt: 2026-11-20T12:23:32Z Notes and limitations: Extracted automatically from a single official source (section "Add a command or a tool"). Related: https://latestn.com/tool/claude-code/agents-and-automation/add-hooks-to-plugin How do I add hooks to a Claude Code plugin and when do plugin hooks fire? https://latestn.com/tool/claude-code/agents-and-automation/add-skill-to-plugin How do I add a skill to a Claude Code plugin? https://latestn.com/tool/claude-code/agents-and-automation/agent-sdk-capabilities What is the Claude Code Agent SDK and what can it do? https://latestn.com/tool/claude-code/admin-and-enterprise/view-code-review-usage Where can I view Claude Code Review usage for my organization? https://latestn.com/tool/claude-code/admin-and-enterprise/wsl-managed-devices How do I use Claude Code Desktop in WSL on a managed device? https://latestn.com/tool/claude-code/agents-and-automation/add-api-trigger How do I add an API trigger to a Claude Code scheduled task? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:23:32Z | changed | full tool name example: — → mcp__my-mod__ticket | [1] 2026-11-20T12:23:32Z | changed | tool handler event: — → tool.call | [1] 2026-11-20T12:23:32Z | changed | command handler event: — → command.run | [1] 2026-11-20T12:23:32Z | changed | full tool name format: mcp__my-mod__ticket → — | [1] 2026-11-20T12:23:32Z | changed | tool handler hook: tool.call → — | [1] 2026-11-20T12:23:32Z | changed | command handler hook: command.run → — | [1] 2026-11-13T03:05:11Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/add-command-or-tool-mod/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/agents-and-automation/add-command-or-tool-mod POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/add-command-or-tool-mod with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/add-command-or-tool-mod?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I add a command or tool to a Claude Code mod using the mods API? Revision 2, last verified 2026-11-20T12:23:32Z. https://latestn.com/tool/claude-code/agents-and-automation/add-command-or-tool-mod (accessed 2026-11-21T09:58:31Z). @misc{LatestN_tool_claude_code_agents_and_automation_add_command_or_tool_mod_r2, title = {How do I add a command or tool to a Claude Code mod using the mods API?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/add-command-or-tool-mod}}, note = {Revision 2; digest sha256:8b232eb902d482a9; last verified 2026-11-20T12:23:32Z; accessed 2026-11-21T09:58:31Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/agents-and-automation/add-command-or-tool-mod