govern-cache-retention

govern-cache-retention is a skill for Codex from vinilana/dotcontext. It costs 68 tokens per session (477 once invoked), scanned A, original, MIT.

A guide for controlling how caches and saved indexes grow, expire, refresh, migrate, and shut down. A cache is temporary stored data used to avoid repeating work.

In plain words
What is it for?
Use it when working on context caches, semantic analysis caches, session data, checkpoints, TTLs, LRU eviction, cleanup timers, or persistent indexes.
Why use it?
It prevents stale data, unlimited memory or disk growth, unsafe migrations, and resources that remain active after the server stops.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it when working on context caches, semantic analysis caches, session data, checkpoints, TTLs, LRU eviction, cleanup timers, or persistent indexes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vinilana/dotcontext/govern-cache-retention
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.

Any agent
npx skills add vinilana/dotcontext --skill govern-cache-retention
Clone the repo
git clone --depth 1 https://github.com/vinilana/dotcontext

Made for: Codex.

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 govern-cache-retention

README.md
[![agentmods](https://agentmods.dev/badge/skills/vinilana/dotcontext/govern-cache-retention.svg)](https://agentmods.dev/skills/vinilana/dotcontext/govern-cache-retention)
Your own site
<a href="https://agentmods.dev/skills/vinilana/dotcontext/govern-cache-retention"><img src="https://agentmods.dev/badge/skills/vinilana/dotcontext/govern-cache-retention.svg" alt="Measured on agentmods" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 477 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00068 $0.00477
Opus 5 $0.00034 $0.00238
Sonnet 5 $0.00014 $0.00095
Haiku 4.5 $0.00007 $0.00048

Measured 8d ago against content hash 2a28308d6b43, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

govern-cache-retention 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 8d 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.

.context/skills/govern-cache-retention/SKILL.md · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Govern Cache Retention

Require every cache and persistent index to declare how it stops growing and becomes fresh again.

Workflow

  1. Inventory keys, values, entry count, estimated bytes, and ownership lifetime.
  2. Define maximum entries, maximum estimated bytes, TTL, and single-entry behavior.
  3. Choose a freshness signal tied to the source, not only elapsed time.
  4. Use LRU within TTL and evict proactively on set and lifecycle cleanup.
  5. Make timers unref, bounded, and disposable.
  6. Clear process-local caches on server stop.
  7. Add lazy, dual-read migration for persistent shape changes.
  8. Protect active sessions and preserve rollback readability.

Required cache contract

Document:

  • normalized key;
  • entry and byte limits;
  • TTL;
  • freshness signal;
  • eviction order;
  • sweep trigger;
  • dispose behavior;
  • metrics;
  • behavior when one entry exceeds budget.

Reject a cache implementation that omits any item.

Persistent indexes

Avoid one ever-growing JSON document on a hot path. Partition bindings or records when lookup and rewrite cost scale with total history. Keep summaries in session.json and move growing checkpoint payloads to append-only or individual records.

Required invariants

  • Never expire only when the exact stale key is read again.
  • Never leave a referenced interval after stop.
  • Never retain stale semantic context after source identity changes.
  • Never ignore cacheEnabled.
  • Never prune active workflow state.
  • Never require destructive migration to roll back.
  • Clamp unsafe configuration values.

Dotcontext routing

  • Put generic LRU/retention rules in harness domain/application.
  • Keep MCP and integration caches owned and disposed by their surfaces.
  • Coordinate repository pruning with runtime history.
  • Follow F-07.

Review gate

Test entry eviction, byte eviction, TTL sweep, freshness invalidation, stop cleanup, stale binding removal, checkpoint migration, unsafe config clamps, and legacy reads.

Read the full file on GitHub · 62 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 62 lines · 68 tokens per session scan A 2a28308d6b43

Subscribe to this mod's changes

govern-cache-retention is a skill published in the GitHub repository vinilana/dotcontext (565 stars, last pushed 1mo ago), licensed MIT. It adds 68 tokens to every session and 477 once invoked, about $0.0003 per session on Opus 5. 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-08-30.