Skip to content

Commit 89ac7ec

Browse files
nickrociclaude
andcommitted
fix(plugin): provision on first prompt — /reload-plugins never fires SessionStart
Installing mid-session left the plugin looking alive (skills/commands/MCP hot-load) while silently capturing nothing: provisioning was wired only to SessionStart, which /reload-plugins does not fire, so ensure-ultan.sh never ran and every per-turn hook no-op'd on the missing binary — until the next fresh session. The UserPromptSubmit hook now falls back to the provisioner when the binary is absent: first prompt after a mid-session install kicks off the background install (instant return, atomic-lock idempotent — repeat prompts exit on the lock). SessionStart wiring is unchanged for the fresh-session path. README quick-start now tells the truth about /reload-plugins, and the bin/ultan wrapper's not-provisioned message says "send any message" instead of "start a new session". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c6a0bae commit 89ac7ec

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,21 @@ Inside Claude Code:
4747
> hundred MB) in the background, and you can keep working while it finishes.
4848
4949
That's it. Skills and slash commands hot-load the instant you install; `/reload-plugins`
50-
pulls in the hooks and the MCP server. **A full Claude Code restart is not required** — a
51-
fresh session also works, but you don't need one.
50+
pulls in the hooks and the MCP server. **A full Claude Code restart is not required**
51+
your next prompt kicks off provisioning automatically (a fresh session works too; you
52+
don't need one).
5253

5354
> 🩺 **Wondering what it's doing? Ask Claude to run `ultan doctor`.** It reports
5455
> whether the background install is still running, the daemon's state (warming /
5556
> healthy / idle), priming latency, and capture freshness — at any stage, even
5657
> mid-install.
5758
58-
On first use a `SessionStart` hook provisions that retrieval stack into the plugin's
59-
private storage **in the background**. Until it finishes, priming falls back to a fast
60-
lexical scan; after that the daemon **lazy-starts on demand**. Models download anonymously
61-
from HuggingFace — see *First-start expectations* below.
59+
On first use the plugin provisions that retrieval stack into its private storage
60+
**in the background** — triggered by `SessionStart` in a fresh session, or by your
61+
first prompt when you installed mid-session (`/reload-plugins` alone doesn't fire
62+
`SessionStart`, so the prompt hook covers that path). Until it finishes, priming
63+
falls back to a fast lexical scan; after that the daemon **lazy-starts on demand**.
64+
Models download anonymously from HuggingFace — see *First-start expectations* below.
6265

6366
You now have:
6467

bin/ultan

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if [ -f "$LOG" ]; then
3737
echo "ultan: a new Claude Code session retries automatically." >&2
3838
exit 1
3939
fi
40-
echo "ultan: not provisioned yet — the plugin installs Ultan in the background at" >&2
41-
echo "ultan: session start (progress lands in $DATA/install.log)." >&2
42-
echo "ultan: if this is a fresh install, start a new session or wait a minute." >&2
40+
echo "ultan: not provisioned yet — the plugin installs Ultan in the background," >&2
41+
echo "ultan: triggered by session start OR your next prompt (progress lands in" >&2
42+
echo "ultan: $DATA/install.log). Send any message and try again in a minute." >&2
4343
exit 1

hooks/hooks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"hooks": [
2222
{
2323
"type": "command",
24-
"command": "[ -x \"${CLAUDE_PLUGIN_DATA}/bin/ultan\" ] && \"${CLAUDE_PLUGIN_DATA}/bin/ultan\" hook user-prompt-submit || true",
24+
"command": "if [ -x \"${CLAUDE_PLUGIN_DATA}/bin/ultan\" ]; then \"${CLAUDE_PLUGIN_DATA}/bin/ultan\" hook user-prompt-submit; else \"${CLAUDE_PLUGIN_ROOT}/scripts/ensure-ultan.sh\"; fi || true",
2525
"timeout": 5
2626
}
2727
]

0 commit comments

Comments
 (0)