Help us improve
Share bugs, ideas, or general feedback.
From vbw
Updates VBW plugin to the latest version with automatic cache refresh. Supports optional --check flag to verify current version.
npx claudepluginhub swt-labs/vibe-better-with-claude-code-vbwHow this command is triggered — by the user, by Claude, or both
Slash command
/vbw:update [--check]This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# VBW Update $ARGUMENTS
## Context
Plugin root:
Store the plugin root path output above as `{plugin-root}` for use in file/script lookups below. Replace `{plugin-root}` with the literal `Plugin root` value from Context whenever a step below references a script or file in the installed plugin.
**Resolve config directory:** Try in order: env var `CLAUDE_CONFIG_DIR` (if set and directory exists), `~/.config/claude-code` (if exists), otherwise `~/.claude`. Store result as `CLAUDE_DIR`. Use for all config paths below.
## Steps
### Step 1: Read current INSTALLED version
Read the **cached*.../update-pluginUpdates plugins from the marketplace interactively with version detection, automatic backup, verification, and rollback on failure. Supports --check-only, --yes, --json, and other flags.
/update-workflowChecks the current version of the virtual-team plugin and displays update instructions. Also supports --check to compare local version against remote.
/updateUpdates the statusLine path in settings.json to point to the latest cached version of the claude-dashboard plugin.
/updatePulls the latest Forge plugin from upstream, detects install method (git checkout, marketplace cache, custom), runs safe updates or checks, reports version delta.
/statusline-updateUpdates the installed claude-2x-statusline to the latest version via Bash or PowerShell updater, shows output verbatim, and instructs to restart Claude Code.
/updateChecks the current plugin version against the marketplace and guides the user through applying available updates.
Share bugs, ideas, or general feedback.
Plugin root:
!`VBW_CACHE_ROOT="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/plugins/cache/vbw-marketplace/vbw"; SESSION_KEY="${CLAUDE_SESSION_ID:-default}"; SESSION_LINK="/tmp/.vbw-plugin-root-link-${SESSION_KEY}"; R=""; if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/hook-wrapper.sh" ]; then R="${CLAUDE_PLUGIN_ROOT}"; fi; if [ -z "$R" ] && [ -f "${VBW_CACHE_ROOT}/local/scripts/hook-wrapper.sh" ]; then R="${VBW_CACHE_ROOT}/local"; fi; if [ -z "$R" ]; then V=$(find "${VBW_CACHE_ROOT}" -maxdepth 1 -mindepth 1 2>/dev/null | awk -F/ '{print $NF}' | grep -E '^[0-9]+(\.[0-9]+)*$' | sort -t. -k1,1n -k2,2n -k3,3n | tail -1); [ -n "$V" ] && [ -f "${VBW_CACHE_ROOT}/${V}/scripts/hook-wrapper.sh" ] && R="${VBW_CACHE_ROOT}/${V}"; fi; if [ -z "$R" ]; then L=$(find "${VBW_CACHE_ROOT}" -maxdepth 1 -mindepth 1 2>/dev/null | awk -F/ '{print $NF}' | sort | tail -1); [ -n "$L" ] && [ -f "${VBW_CACHE_ROOT}/${L}/scripts/hook-wrapper.sh" ] && R="${VBW_CACHE_ROOT}/${L}"; fi; if [ -z "$R" ] && [ -f "${SESSION_LINK}/scripts/hook-wrapper.sh" ]; then R="${SESSION_LINK}"; fi; if [ -z "$R" ]; then ANY_LINK=$(command find -H /tmp -maxdepth 1 -name '.vbw-plugin-root-link-*' -print 2>/dev/null | LC_ALL=C sort | while IFS= read -r link; do if [ -f "$link/scripts/hook-wrapper.sh" ]; then printf '%s\n' "$link"; break; fi; done || true); [ -n "$ANY_LINK" ] && R="$ANY_LINK"; fi; if [ -z "$R" ]; then D=$(ps axww -o args= 2>/dev/null | grep -v grep | grep -oE -- "--plugin-dir [^ ]+" | head -1); D="${D#--plugin-dir }"; [ -n "$D" ] && [ -f "$D/scripts/hook-wrapper.sh" ] && R="$D"; fi; if [ -z "$R" ] || [ ! -d "$R" ]; then echo "VBW: plugin root resolution failed" >&2; exit 1; fi; LINK="${SESSION_LINK}"; REAL_R=$(cd "$R" 2>/dev/null && pwd -P) || REAL_R="$R"; bash "$REAL_R/scripts/ensure-plugin-root-link.sh" "$LINK" "$REAL_R" >/dev/null 2>&1 || { echo "VBW: plugin root link failed" >&2; exit 1; }; echo "$LINK"`
Store the plugin root path output above as {plugin-root} for use in file/script lookups below. Replace {plugin-root} with the literal Plugin root value from Context whenever a step below references a script or file in the installed plugin.
Resolve config directory: Try in order: env var CLAUDE_CONFIG_DIR (if set and directory exists), ~/.config/claude-code (if exists), otherwise ~/.claude. Store result as CLAUDE_DIR. Use for all config paths below.
Read the cached version (what user actually has installed):
for _d in "${CLAUDE_CONFIG_DIR:-}" "$HOME/.config/claude-code" "$HOME/.claude"; do [ -z "$_d" ] && continue; v=$(cat "$_d"/plugins/cache/vbw-marketplace/vbw/*/VERSION 2>/dev/null | sort -V | tail -1 || true); [ -n "$v" ] && echo "$v" && break; done
Store as old_version. If empty, fall back to {plugin-root}/VERSION.
CRITICAL: Do NOT read {plugin-root}/VERSION as primary — in dev sessions it resolves to source repo (may be ahead), causing false "already up to date."
If --check: display version banner with installed version and STOP.
curl -sf --max-time 5 "https://raw.githubusercontent.com/yidakee/vibe-better-with-claude-code-vbw/main/VERSION"
Store as remote_version. Curl fails → STOP: "⚠ Could not reach GitHub to check for updates."
If remote == old: display "✓ Already at latest (v{old_version}). Refreshing cache..." Continue to Step 4 for clean cache refresh.
bash "{plugin-root}/scripts/cache-nuke.sh"
Removes CLAUDE_DIR/plugins/cache/vbw-marketplace/vbw/, CLAUDE_DIR/commands/vbw/, /tmp/vbw-* for pristine update.
Same version: "Refreshing VBW v{old_version} cache..." Different: "Updating VBW v{old_version}..."
CRITICAL: All claude plugin commands MUST be prefixed with unset CLAUDECODE && — without this, Claude Code detects the parent session's env var and blocks with "cannot be launched inside another Claude Code session."
Refresh marketplace FIRST (stale checkout → plugin update re-caches old code):
unset CLAUDECODE && claude plugin marketplace update vbw-marketplace 2>&1
If fails: "⚠ Marketplace refresh failed — trying update anyway..."
Try in order (stop at first success):
unset CLAUDECODE && claude plugin update vbw@vbw-marketplace 2>&1unset CLAUDECODE && claude plugin uninstall vbw@vbw-marketplace 2>&1 && unset CLAUDECODE && claude plugin install vbw@vbw-marketplace 2>&1Clean stale global commands (after A or B succeeds):
for _d in "${CLAUDE_CONFIG_DIR:-}" "$HOME/.config/claude-code" "$HOME/.claude"; do [ -z "$_d" ] && continue; rm -rf "$_d/commands/vbw" 2>/dev/null; done
This removes stale copies that break {plugin-root} resolution. Commands load from the plugin cache where the resolved plugin root is guaranteed.
Read CLAUDE_DIR/settings.json, check statusLine (string or object .command). If contains vbw-statusline: skip. Otherwise update to:
{"type": "command", "command": "bash -c 'for _d in \"${CLAUDE_CONFIG_DIR:-}\" \"$HOME/.config/claude-code\" \"$HOME/.claude\"; do [ -z \"$_d\" ] && continue; f=$(ls -1 \"$_d\"/plugins/cache/vbw-marketplace/vbw/*/scripts/vbw-statusline.sh 2>/dev/null | sort -V | tail -1 || true); [ -f \"$f\" ] && exec bash \"$f\"; done'"}
Use jq to write (backup, update, restore on failure). Display ✓ Statusline restored (restart to activate) if changed.
NEW_CACHED=$(for _d in "${CLAUDE_CONFIG_DIR:-}" "$HOME/.config/claude-code" "$HOME/.claude"; do [ -z "$_d" ] && continue; v=$(cat "$_d"/plugins/cache/vbw-marketplace/vbw/*/VERSION 2>/dev/null | sort -V | tail -1 || true); [ -n "$v" ] && echo "$v" && break; done)
Use NEW_CACHED as authoritative version. If empty or equals old_version when it shouldn't: "⚠ Update may not have applied. Try /vbw:update again after restart."
Use NEW_CACHED for all display. Same version = "VBW Cache Refreshed" banner + "Changes active immediately". Different = "VBW Updated" banner with old→new + "Changes active immediately" + "/vbw:whats-new" suggestion.
Edge case: If Step 6 verification failed (NEW_CACHED empty/unchanged when upgrade expected): keep restart suggestion as diagnostic fallback.
Follow @${CLAUDE_PLUGIN_ROOT}/references/vbw-brand-essentials.md — double-line box, ✓ success, ⚠ fallback warning, Next Up, no ANSI.