claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Desktop: mod UI (AbovePrompt band) doesn't render until first message sent

Open non2321 opened this issue 1 month ago • 3 comments

Bug Description Desktop: a mod's AbovePrompt band does not render until the first message is sent

On Claude Desktop (macOS, Claude Code 2.1.309), a mod's ui.render hook for AbovePrompt is only drawn after the first message of a new session. In the terminal CLI (2.1.314) the same mod's band shows as soon as the session opens.

Desktop's main.log shows the CLI process is pre-spawned and warmed when the chat opens ("Session local_... warmed successfully"), but "Mapping internal session local_... to CLI session ..." is only logged right after "Sending message to session local_...", i.e. on the first message. Until then nothing the mod draws appears (its AbovePrompt hook does not seem to run).

Expected: the mod's AbovePrompt band renders for a warmed session before the first message, as in the terminal, e.g. a HUD showing context and usage at 0 turns.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.314
  • Feedback ID: 4f0e2315-eb77-42fe-aa9e-268282825a91

Related: #103898 (band shows late on a new desktop session), #103429 (no mod UI in side chats). The environment info above is the CLI used to file this; the bug is in the Desktop app (Claude Code 2.1.309).

non2321 avatar Oct 30 '26 05:10 non2321

This issue has been automatically marked as stale due to inactivity. This issue will be closed automatically if there's no activity within 14 days.

github-actions[bot] avatar Nov 18 '26 16:11 github-actions[bot]

Thank you for mods. They've made the desktop app fit how I work.

I see the same thing on Claude desktop 6.6395.1 (Claude Code 2.1.326), macOS 27.2.1.

Here is a case where the band only matters before the first message. My mod's AbovePrompt band holds two buttons that choose how a session starts, and each press sends the first prompt with $.prompt.submit({ text, asUser: true }). After that first message the band has nothing to do and hides itself. So on desktop the band never appears when it is needed. claude plugin list showed the mod as loaded, and its claude plugin test suite passes.

One difference from the report: on my Mac the session is not pre-warmed. Since Nov 21, main.log has 55 session starts marked spawn=cold and none marked spawn=warm or "warmed successfully", so here the engine appears to start only once the first message is sent.

Either of these would fix it for me:

  1. Start the session's engine (or initialize the warmed one) when the new-session screen opens, so the AbovePrompt hook runs before any message.
  2. The model-less new-session render context proposed in #102958.

Possibly related: #109838 (a mod's theme missing on the same screen, also until the first message).

geokao avatar Nov 22 '26 17:11 geokao

Same on Windows 11, Claude desktop app, Claude Code 2.1.330.

My mod adds a row of buttons above the prompt (a ui.render hook on AbovePrompt, drawn unconditionally). In a new session the row doesn't appear until after I send a first message.

The buttons are shortcuts for starting work (slash commands), so the moment I most want them is before the first prompt. Right now I send a throwaway message like "test" just to bring the bar up.

Either fix proposed above would do it for me: start the session's engine when the new-session screen opens, or draw AbovePrompt rows on that screen some other way.

joeriehl avatar Nov 30 '26 17:11 joeriehl