# Cacheguard

Warns or blocks a large chat message sent after a pause, when the provider's prompt cache may have expired.

- Type: Plugin
- Version: 0.6.0
- Updated: 22 Nov 2026
- Publisher: AIverflow
- Category: Tools

[Contact us](https://www.ulpi.io/en/support#contact)

## What it does

Warns or blocks a large chat message sent after a pause, when the provider's prompt cache may have expired. Afterwards it shows how many tokens were reused or rebilled, and /cacheguard shows how often your cache was lost after pauses of each length.

Modes (off, warn, block) are set per surface (terminal, desktop, gateway), and a model can have its own pause, size and mode. In block mode the message is not sent: the reply says so, and you send it with /retry or by sending the same text again.

If the plugin fails, the message is sent. Disclosure — no network call, no LLM call, no subprocess, no credentials, no telemetry.

Middleware llm_request reads every message of the request to hash the start of the chat (sha256, only the hash is kept) and removes cacheguard's own "message not sent" replies from what the model receives. Middleware llm_execution reads the token usage of each response; the provider call is Ulpi's own next_call, never repeated.

Hook pre_llm_call returns a block for a large message after a pause. Hook transform_llm_output posts a result line with ctx.post_message and never changes the reply.

Reads config.yaml (its own settings through ctx.get_config) and the environment variables ULPI_SINGLE_QUERY_SESSION, ULPI_KANBAN_TASK, ULPI_PLATFORM, ULPI_INTERACTIVE. Writes its settings with ctx.set_config (/cacheguard set and setup) and, under \<ULPI_HOME\>/cacheguard/, observations.jsonl (token counts, times and model name of calls after a pause; no message text, no session id) and one small json file per chat (times, token counts, hash).

/cacheguard reset deletes them. Unattended runs (cron, kanban, subagents, curator, API server, webhooks) pass through untouched; one-shot runs (-Q, -z, --oneshot) are never blocked and show no line (a -Q run may be counted in the stats); with chat -q, block acts as warn.

Private Ulpi names: tools.approval_context.\_is_single_query_approval_context (a run with no screen only warns) and agent.usage_pricing.normalize

## Review notes

What an owner reads and accepts before the install is approved.

- Ulpi has not reviewed this version: it is listed in the public plugin catalog, and the install still fetches it at its pinned commit, checks its shape and scans it before you approve

## More in Tools

- [Caduceus Governance](https://www.ulpi.io/en/marketplace/plugins/caduceus-governance): Deterministic, model-free admission control for what Ulpi writes into its own skills: content lanes, operator-owned executable checks.
- [Caduceus: Personalized Health & DNA AI](https://www.ulpi.io/en/marketplace/plugins/caduceus-personalized-health-dna-ai): Answers about your own health that cite your DNA, Apple Health trends, medical records and new research, from a vault on your machine.
- [CALLIT](https://www.ulpi.io/en/marketplace/plugins/callit): Turn any group chat into a prediction league: friends make calls on crypto prices, football or anything, challenge each other to 1v1 duels, run closest-guess pools.

[All listings →](https://www.ulpi.io/en/marketplace) · [Publisher's guide →](https://www.ulpi.io/en/docs) · [Report a problem →](https://www.ulpi.io/en/security#report)
