{
  "id": 13720075,
  "title": "Claude Code mod button calling $.prompt.submit doesn't work the first time (where to call it)",
  "url": "https://urgent.news/2026/10/11/claude-code-mod-button-calling-prompt-submit-doesnt-work-the-first",
  "topic": "ai",
  "section": "AI",
  "published": "2026-10-11T13:09:41.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/nakadadev/claude-code-mod-button-calling-promptsubmit-doesnt-work-the-first-time-where-to-call-it-158i"
  },
  "original_language": "en",
  "account": "If you try to call $.prompt.submit directly from a mod button's onPress event or a command, Claude might not start a turn. This issue affects Claudia Code versions 2.1.286 to 2.1.288 (October 2026). Instead of calling it immediately, store the text in a variable and send it from a clock created in session.start. This approach works reliably. The official documentation mentions that $.prompt.submit waits until the session is idle, then starts a new turn, but doesn't explicitly state that a call inside an event might be discarded. Based on the author's observations, moving the call to a clock ensures it works every time. The author recommends putting the call to send the text inside a clock created in session.start, and keeping only one clock throughout the mod to avoid conflicts.",
  "summary": "If you call $.prompt.submit inside a mod button's onPress or inside a command, Claude sometimes doesn't start. In the versions I tested, a $.prompt.submit called inside the press event was thrown away when the event ended, with no error . Have the button only store what to send in a variable, and send it from a clock created in session.start . That works reliably. Versions checked: Claude Code…",
  "key_points": [
    "$.prompt.submit doesn't work in mod button's onPress event",
    "Store text in variable, send from clock in session.start",
    "Clock ensures Claude starts new turn reliably"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}