From 3aeb0f2fbdda9e81f7c3cfea5a36e3e05a63abd6 Mon Sep 17 00:00:00 2001 From: Minas Arustamyan Date: Thu, 7 May 2026 02:28:34 +0200 Subject: [PATCH] fix(refresh-marketplace): use /reload-plugins instead of /exit + restart Claude Code's `/reload-plugins` slash command picks up newly installed plugins into the running session without forcing the user to /exit and restart Claude Code. The hook JSON `systemMessage` and `additionalContext` both now point at it. Tests updated to pin the new hint shape. --- cli/commands/refresh_marketplace.py | 8 ++++---- tests/test_cli_refresh_marketplace.py | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/cli/commands/refresh_marketplace.py b/cli/commands/refresh_marketplace.py index ea7d152..8245904 100644 --- a/cli/commands/refresh_marketplace.py +++ b/cli/commands/refresh_marketplace.py @@ -383,8 +383,8 @@ def _emit_hook_message(events: dict[str, list[str]]) -> None: `systemMessage` is a transient toast (often missed). `additionalContext` is wrapped in a system reminder Claude reads at session start, so the model can mention the change if it's relevant to the user's first ask. - Plugins require a Claude Code restart — they land on disk this session - but only load on next session start. + Plugins land on disk during the hook; `/reload-plugins` loads them into + the running session without a restart. """ parts: list[str] = [] if events["installed"]: @@ -399,8 +399,8 @@ def _emit_hook_message(events: dict[str, list[str]]) -> None: ) summary = "Your Agnes stack changed: " + "; ".join(parts) + "." restart_hint = ( - "Run `/exit` and then `claude` again to load the changes — " - "Claude Code only picks up new/updated plugins on session start." + "Run `/reload-plugins` to load the changes into this session — " + "no restart needed." ) payload = { "systemMessage": f"{summary} {restart_hint}", diff --git a/tests/test_cli_refresh_marketplace.py b/tests/test_cli_refresh_marketplace.py index 08009e5..53ab1e1 100644 --- a/tests/test_cli_refresh_marketplace.py +++ b/tests/test_cli_refresh_marketplace.py @@ -464,17 +464,15 @@ def test_quiet_emits_hook_json_when_plugin_installed( assert "grpn-fin" in payload["systemMessage"] assert "Agnes stack" in payload["systemMessage"] assert "installed" in payload["systemMessage"] - # Restart hint: plugins land on disk this session but only load on - # next session start, so the user must /exit + restart. - assert "/exit" in payload["systemMessage"] - assert "session start" in payload["systemMessage"].lower() + # Reload hint: `/reload-plugins` loads the on-disk plugins into the + # running Claude Code session without a full restart. + assert "/reload-plugins" in payload["systemMessage"] hook_specific = payload.get("hookSpecificOutput", {}) assert hook_specific.get("hookEventName") == "SessionStart" additional = hook_specific.get("additionalContext", "") assert "grpn-fin" in additional - assert "/exit" in additional - assert "session start" in additional.lower() + assert "/reload-plugins" in additional def test_manual_mode_prints_restart_hint_when_anything_changed(