From e0ab4c2ddff52e637d4ba99bae34aab6d60caf52 Mon Sep 17 00:00:00 2001 From: lmiranda Date: Thu, 29 Jan 2026 11:58:31 -0500 Subject: [PATCH] fix(projman): remove automatic cache clearing from session start hook The startup-check.sh hook was clearing ~/.claude/plugins/cache/ at every session start, which was aggressive and potentially disruptive. Cache clearing is now a manual operation via the new /clear-cache command. Changes: - Remove automatic cache clearing from startup-check.sh - Add /clear-cache command for manual cache clearing when needed Co-Authored-By: Claude Opus 4.5 --- plugins/projman/commands/clear-cache.md | 24 ++++++++++++++++++++++++ plugins/projman/hooks/startup-check.sh | 13 ------------- 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 plugins/projman/commands/clear-cache.md diff --git a/plugins/projman/commands/clear-cache.md b/plugins/projman/commands/clear-cache.md new file mode 100644 index 0000000..b463d27 --- /dev/null +++ b/plugins/projman/commands/clear-cache.md @@ -0,0 +1,24 @@ +# /clear-cache + +Clear plugin cache to force fresh configuration reload. Run this after marketplace updates. + +## When to Use + +- After updating the marketplace (`git pull` or reinstall) +- When MCP servers show stale configuration +- When plugin changes don't take effect + +## What It Does + +1. Clears `~/.claude/plugins/cache/leo-claude-mktplace/` +2. Forces Claude Code to re-read `.mcp.json` files on next session + +## Instructions + +Run this command, then **restart your Claude Code session** for changes to take effect. + +```bash +rm -rf ~/.claude/plugins/cache/leo-claude-mktplace/ +``` + +After clearing, inform the user: "Cache cleared. Restart Claude Code for changes to take effect." diff --git a/plugins/projman/hooks/startup-check.sh b/plugins/projman/hooks/startup-check.sh index 5dde1a9..0491070 100755 --- a/plugins/projman/hooks/startup-check.sh +++ b/plugins/projman/hooks/startup-check.sh @@ -10,19 +10,6 @@ PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "$(realpath "$0")")")}" # Marketplace root is 2 levels up from plugin root (plugins/projman -> .) MARKETPLACE_ROOT="$(dirname "$(dirname "$PLUGIN_ROOT")")" VENV_REPAIR_SCRIPT="$MARKETPLACE_ROOT/scripts/venv-repair.sh" -PLUGIN_CACHE="$HOME/.claude/plugins/cache/leo-claude-mktplace" - -# ============================================================================ -# Clear stale plugin cache (MUST run before MCP servers load) -# ============================================================================ -# The cache at ~/.claude/plugins/cache/ holds versioned .mcp.json files. -# After marketplace updates, cached configs may point to old paths. -# Clearing forces Claude to read fresh configs from installed marketplace. - -if [[ -d "$PLUGIN_CACHE" ]]; then - rm -rf "$PLUGIN_CACHE" - # Don't output anything - this should be silent and automatic -fi # ============================================================================ # Auto-repair MCP venvs (runs before other checks)