cache-invalidation

cache-invalidation is a cursor rule for Cursor from fmflurry/harness-manifesto. It costs 0 tokens per session (375 once invoked), scanned A, original, MIT.

A rule for keeping cached data correct when the underlying data changes. A cache is a stored result reused to avoid doing the same work again.

In plain words
What is it for?
Use it when changing database or application writes that affect memory, HTTP, output, decorator, or time-limited caches.
Why use it?
It prevents stale results by requiring changes to invalidate or update affected cache entries and tests to check fresh data after a write.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: reads .claude/ paths.

Good fit Use it when changing database or application writes that affect memory, HTTP, output, decorator, or time-limited caches.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/fmflurry/harness-manifesto/cache-invalidation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/fmflurry/harness-manifesto

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cache-invalidation

README.md
[![agentmods](https://agentmods.dev/badge/rules/fmflurry/harness-manifesto/cache-invalidation/github.svg)](https://agentmods.dev/rules/fmflurry/harness-manifesto/cache-invalidation)
Your own site
<a href="https://agentmods.dev/rules/fmflurry/harness-manifesto/cache-invalidation"><img src="https://agentmods.dev/badge/rules/fmflurry/harness-manifesto/cache-invalidation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cache-invalidation

Your own site · 80×15
<a href="https://agentmods.dev/rules/fmflurry/harness-manifesto/cache-invalidation"><img src="https://agentmods.dev/badge/rules/fmflurry/harness-manifesto/cache-invalidation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 375 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00375
Opus 5.5 $0.00000 $0.00150
Sonnet 5.5 $0.00000 $0.00075
Haiku 4.5 $0.00000 $0.00038

Measured 15d ago against content hash f5054a874b35, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cache-invalidation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/fmflurry-harness/rules/cache-invalidation.mdc · 19 lines

What it actually says

Cache invalidation

why-not-tooled: the diff hook sees a removed cache marker. It cannot see whether the task explicitly asked for that removal, a new write beside an untouched cache, a bypass that leaves the marker text in place, or a TTL edit that keeps every marker token.

Never remove, bypass, or shorten a cache on your own to fix staleness. That includes a decorator, a TTL, an HTTP cache, a memory cache, and an output cache. Removal or bypass is allowed only when the task, spec, or PR description explicitly says to remove it. When you remove it because it was instructed, name the knock-on effects: callers that still expect the cached value, and tests that only cover the hit. Otherwise the cache stays. Find the writes that change the cached data and invalidate or update the affected entries there, in the same change.

A write in another module does not reach into that cache. It emits an explicit change signal or event. The owner subscribes and invalidates.

Tests cover a refetch or a fresh value after the write, not only the cached hit.

On .NET, evict or tag-invalidate IMemoryCache, HybridCache, and output cache on the write. Do not delete the cache on your own to refresh it. An explicit instruction to remove it still requires the knock-on effects.

.claude/hooks/cache-invalidation.sh warns when the branch diff removes @SkipIfCached, CACHE_NO_TIMEOUT, or another cache marker and adds no invalidateCacheFor or onCacheInvalidate. The warning says the removal is fine when it was explicitly instructed. It does not block.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 15d ago First seen · 19 lines · 0 tokens per session scan A f5054a874b35

Subscribe to this mod's changes

cache-invalidation is a cursor rule published in the GitHub repository fmflurry/harness-manifesto (173 stars, last pushed 11d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 375 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-15.

Related

cache-invalidation compared with cursor rules from other repositories

cache-invalidation next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cache-invalidationfmflurry/harness-manifestoCursor rule17311d agoMITA0Cursor
mcp-debugginggiantswarm/mcp-debugCursor rule392d agoApache-2.0A0Cursor
1c-exchange-specificsDesko77/cursor-1c-skillsCursor rule786d agoMITA0Cursor
fastapi-middlewareholtwood/awesome-cursorrules-zhCursor rule2441mo agoMITA0Cursor
Error Handling and Loggingdatabrickslabs/ontobricksCursor rule572todaynoneA0Cursor
RULECacinieP/network-troubleshoot-skillCursor rule81mo agoMITA682Cursor
api-investigationNazruden/clickup-mcp-serverCursor rule236mo agoMITA0Cursor