tools/cache-score/: one Node file (no deps) that scans Claude Code transcripts for messages sent into an expired prompt cache, prices the re-writes in list $ and plan % (seeded from the hub's usage fits, then self-calibrated from the status line's rate_limits), and scores the context-weighted share of re-sent context that came from cache. - report: score /100, cold returns, when you came back, costliest, other cache breaks, idle compactions, what compacting while warm would save - status line on the CLI's prompt_cache field, 60 s refresh, keeps an existing status line above it - UserPromptSubmit nudge: holds the first message into an expired 100K+ context once; skips -p runs and app resumes via CLAUDE_CODE_ENTRYPOINT - root .claude-plugin/marketplace.json lists it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
365 B
JSON
17 lines
365 B
JSON
{
|
|
"description": "Ask once before a message re-sends a large context into an expired prompt cache",
|
|
"hooks": {
|
|
"UserPromptSubmit": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/cache-score.mjs\" nudge",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|