لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI تاریخ شمسی… --:--:--

Clean up the plugin cache

آزاد تازه‌وارد تاییدشده امن

چک‌لیست و روند کار تخصصی در حوزهٔ عامل‌های هوش مصنوعی برای گرفتن نتیجهٔ دقیق و قابل اتکا. (شامل ۶ گام عملی · سازگار با Claude Code).

سازگاری با ابزارها: این Skill به مسیر/قابلیت اختصاصی Claude Code وابسته است. مشاهدهٔ جدول سازگاری

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: plugin-cache-clean
description: Remove plugin cache versions pinned by deleted or moved projects — a local/project-scope install record keyed by a projectPath that no longer exists, which Claude Code's own 14-day sweep never catches because no orphan marker is ever written for it. Machine-wide, not per-repository; run whenever cache/port/port/<version>/ directories accumulate.
disable-model-invocation: true
allowed-tools: Read, Bash
---

# Clean up the plugin cache

`installed_plugins.json` is per-machine, not per-repository: one run here covers every project this machine has ever installed port into, not just the repository this session happens to be in. The script needs no `.claude/port.config.json` and is never copied into a repository by `/port:init` — the problem this fixes is per-machine, so a per-repo copy would be the wrong shape.

**Why the 14-day sweep misses these.** It fires on an `.orphaned_at` marker written when Claude Code recognizes a version bump as an update to the same tracked install. A `local`/`project`-scope record is keyed by its `projectPath`; deleting that directory (a worktree, a removed clone, a moved repository) never removes the record, and `claude plugin uninstall --scope local` cannot run from a directory that no longer exists. The record goes on pinning its version directory, and no marker is ever written for it.

## Steps

1. Run the report, read-only:

   ```bash
   node "${CLAUDE_PLUGIN_ROOT}/bin/plugin-cache.mjs" report --json
   ```

   Show both tables — stale install records (key, scope, project path, resolved install path) and unreferenced cache directories. If both are empty, say so and stop; there is nothing to clean.

2. Explain the two kinds of entry the report can show:
   - A **stale record** whose project is genuinely gone — safe to remove.
   - A **live record** still pinning a version because its project exists but was never uninstalled in place. To free that version instead, run `claude plugin uninstall port@<marketplace> --scope local` from inside that project, then re-run this skill.

3. Confirm with the operator, then apply:

   ```bash
   node "${CLAUDE_PLUGIN_ROOT}/bin/plugin-cache.mjs" apply
   ```

   Show the backup path it prints (`installed_plugins.json.bak-<timestamp>`, beside the original) and the counts removed.

4. Re-run `report` to confirm the stale entries are gone, and remind the operator to restart any running Claude Code session so it stops resolving what was just removed.

## Another machine or config directory

This skill is machine-wide and reads no repository config — run it directly on the other machine. For a config directory other than the current user's (another account, a mounted or synced home, a backup), pass `--home "<dir>"` to both `report` and `apply`. There is no remote/SSH mode: a network write into someone else's `~/.claude` is a larger trust surface than this earns, so the fix for a remote machine is running the skill there.
<!-- ‹guest · 2026-11-30› -->

## Widening scope

By default the script only ever touches `port@port` records and cache directories. A repository whose own local development loop installs this plugin under a second, differently-named marketplace can widen scope to cover it too: `--plugins port@port,<marketplace>@port` on both `report` and `apply`, comma-separated. Deletion stays fenced to exactly the marketplaces named — never a vendor outside the list.

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
عامل‌های هوش مصنوعی
✦ Pro

REA

دستورالعمل اجرایی آماده برای انجام دقیق کارهای عامل‌های هوش مصنوعی بدون تکرار پرامپت‌های طولانی. (شامل ۶۵ گام عملی · سا…

⚡ /reverse-engineer-anything SKILL.md
Claude / Claude CodeOpenAI Codex +۲
۹۴/۱۰۰ ★ ۴۷۹,۷۷۳
عامل‌های هوش مصنوعی
✦ Pro

Dispatching Parallel Agents

این مهارت با نام «Dispatching Parallel Agents» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ کاف…

⚡ /dispatching-parallel-agents SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Subagent-Driven Development

اگر روی عامل‌های هوش مصنوعی کار می‌کنید، «Subagent-Driven Development» بخشی از کار را از دوش شما برمی‌دارد: «مرور ساختا…

⚡ /subagent-driven-development SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Using Git Worktrees

این مهارت با نام «Using Git Worktrees» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ کافی است در…

⚡ /using-git-worktrees SKILL.md
Cline
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Verification Before Completion

این مهارت با نام «Verification Before Completion» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ …

⚡ /verification-before-completion SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Diagnosing Superpowers

«Diagnosing Superpowers» دستورالعمل دقیقی برای «مدیریت هوشمند حافظه و کانتکست» در اختیار دستیار هوش مصنوعی می‌گذارد تا …

⚡ /diagnosing-superpowers SKILL.md
Claude / Claude Code
۹۱/۱۰۰ ★ ۳۲۴,۲۹۰