Answer: You register stubs with the `on` argument passed to the test function, naming each stub for a mods API call without the `$.` prefix, so a stub registered as `model.complete` answers your mod's `$.model.complete` call. A stub for a mods API call returns an object with a `value` field holding what the call resolves to. Status: Check failed Entry: tool/claude-code/agents-and-automation/stub-claude-answers-in-test Revision: 1 Digest: sha256:a9365a21d5bb5a64 (changes whenever the content changes) Timeline: Created: 2026-11-14T12:19:41Z Last changed: 2026-11-14T12:19:41Z Last verified: 2026-11-16T12:11:33Z Last attempt: 2026-11-20T12:23:53Z (failed) Next check: 2026-11-20T13:23:53Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of stub registration | on | [1] | 2026-11-16 stub naming | store.get | [1] | 2026-11-16 stub return form | { value: 7 } | [1] | 2026-11-16 example stub name | model.complete | [1] | 2026-11-16 Sources: [1] Anthropic. "Test a mod". https://code.claude.com/docs/en/plugins/mods/test.md Role: primary. Accessed: 2026-11-16T12:11:33Z Quote: "**`on`**: call it to register stubs, which are hooks that answer in Claude Code's place." (Supports: stub registration) Quote: "Name a stub for a mods API call without the `$.`, so a stub registered as `store.get` answers your mod's `$.store.get`." (Supports: stub naming) Quote: "A stub for a mods API call returns an object with a `value` field, which holds what the call resolves to in your mod: `{ value: 7 }` makes `$.store.get` resolve to `7`." (Supports: stub return form) Quote: "on('model.complete', () => ({" (Supports: example stub name) Published: 2026-11-14T19:09:23Z Snapshot SHA-256: 32609845240ae0a892334a07f563b24d52869107502921e93dee43b96e6349af (captured 2026-11-14T12:19:41Z) 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-14T12:19:41Z, so the values verified then were kept. Cross-check: not-available at 2026-11-16T12:11:33Z. No independent second source is configured for this entry Last successful check: 2026-11-16T12:11:33Z Last attempt: 2026-11-20T12:23:53Z (failed) Notes and limitations: Extracted automatically from a single official source (section "Stub what Claude Code would answer"). Related: https://latestn.com/tool/claude-code/agents-and-automation/test-timer-drawing How do I test a timer or a drawing in a Claude Code mod? https://latestn.com/tool/claude-code/agents-and-automation/tool-return-images-structured-data How do I return images or structured data from a Claude Code custom tool? https://latestn.com/tool/claude-code/agents-and-automation/user-input-limitations What are the limitations of handling user input with the Claude Code Agent SDK? https://latestn.com/tool/claude-code/agents-and-automation/streaming-limitations What are the known limitations of streaming output in the Claude Code Agent SDK? https://latestn.com/tool/claude-code/agents-and-automation/structured-output How do I get structured output from Claude Code programmatically? https://latestn.com/tool/claude-code/agents-and-automation/structured-output-quick-start How do I get validated JSON structured output from a Claude Code agent? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-17T12:29:40Z | check-failed | Extraction did not pass verification: answer contains `on('model.complete', ...)`, which does not appear in the source | — 2026-11-14T12:19:41Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/stub-claude-answers-in-test/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/stub-claude-answers-in-test POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/stub-claude-answers-in-test with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/stub-claude-answers-in-test?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I stub what Claude Code would answer in a Claude Code mod test? Revision 1, last verified 2026-11-16T12:11:33Z. https://latestn.com/tool/claude-code/agents-and-automation/stub-claude-answers-in-test (accessed 2026-11-21T10:05:07Z). @misc{LatestN_tool_claude_code_agents_and_automation_stub_claude_answers_in_test_r1, title = {How do I stub what Claude Code would answer in a Claude Code mod test?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/stub-claude-answers-in-test}}, note = {Revision 1; digest sha256:a9365a21d5bb5a64; last verified 2026-11-16T12:11:33Z; accessed 2026-11-21T10:05:07Z} } 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/stub-claude-answers-in-test