Claude Code mod button calling $.prompt.submit doesn't work the first time (where to call it)
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…
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.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.