Claude Code mod button calling $.prompt.submit doesn't work the first time (where to call it)

javascript dev.to

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 2.1.286 to 2.1.288 (October 2026, desktop Code tab). Symptom Put a button in a mod's panel,

Read Full Tutorial open_in_new
arrow_back Back to Tutorials