From claude-plugins-validation
Validate plugins / projects against Anthropic's prompt-cache invalidation patterns (CA-01..CA-06). Loaded by cache-optimizer-agent. Use when auditing for cache regressions or fixing CA-01..CA-06 findings.
npx claudepluginhub emasoft/emasoft-plugins --plugin claude-plugins-validationThis skill is limited to using the following tools:
Anthropic's prompt cache caches the rendered system-prompt prefix —
Suggests manual /compact at logical task boundaries in long Claude Code sessions and multi-phase tasks to avoid arbitrary auto-compaction losses.
Share bugs, ideas, or general feedback.
Anthropic's prompt cache caches the rendered system-prompt prefix —
CLAUDE.md, cached agent/skill bodies, and settings-derived blocks. The
cache is invalidated whenever ANY byte in that prefix changes. A 200K-token
prefix cache MISS costs ~10x normal token rate vs a HIT. CPV's cache-audit
rule pack catches the six documented patterns that silently break caching
or fork the cached prompt into many distinct keys.
Per-rule severity, catch description, and fix-recipe pointer live in references/ca-rules.md. Full TOC of every rule is embedded under "Resources" at the bottom of this file.
uv available on PATH so the validator can run via the launcher
(uv run --with pyyaml python "${CLAUDE_PLUGIN_ROOT}/scripts/remote_validation.py" cache <path>).Same I/O contract as validate_security.py: path-only stdout (auto-save
report, print compact summary), aggregated (level, rule_id) grouping,
self-scan filter chain (skips catalog / test / dev-scratch files).
cache).
The one-liner · Why the launcher is mandatory · Direct invocation (development only)
MAIN_ROOT via git worktree list | head -n1.--report "$MAIN_ROOT/reports/validate_cache/<TS>-<slug>.md".cache-fixes.md#ca-nn from skills/fix-validation/references/, re-run, iterate until VALID.# Audit a plugin (or any project root with CLAUDE.md / .claude/)
CLAUDE_PRIVATE_USERNAMES="$(whoami)" uv run --with pyyaml \
python "${CLAUDE_PLUGIN_ROOT}/scripts/remote_validation.py" \
cache ~/Code/my-plugin/ --report "$REPORT"
uv missing on PATH — exit code 4. Install via
curl -LsSf https://astral.sh/uv/install.sh | sh..claude/ and no CLAUDE.md — INFO + "no cached
content to audit".MAIN_ROOT empty (no git) — the prologue's fallback handles this:
[ -z "${MAIN_ROOT}" ] && MAIN_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}".Copy this checklist and track your progress:
MAIN_ROOT via git worktree list | head -n1${MAIN_ROOT}/reports/validate_cache/<TS>-<slug>.mdmkdir -p the parent directorypython "${CLAUDE_PLUGIN_ROOT}/scripts/remote_validation.py" cache <path> --report <path>scripts/validate_cache.py — validatorCA-01 — dynamic placeholders in cached content · CA-02 — SessionStart / UserPromptSubmit / PreCompact write CLAUDE.md or settings · CA-03 — hook scripts flip permissions / enabledMcpServers between turns · CA-04 —
model:frontmatter forces in-line model switch · CA-05 — hook scripts run unbounded-output commands · CA-06 — PreCompact / PostCompact / SubagentStart hooks don't preserve prefix · Why these specific six
skills/fix-validation/references/cache-fixes.md — fix recipestests/test_validate_cache.py — 36 tests