cache-guard

by Spencer Boucher · ★ 0 · updated 2 days ago

GuardsCommandsPromptAutomationvalidates

0

Keeps the prompt cache warm while you are away, asks before a prompt that would re-cache a large conversation, and with Jev (TypeSafe) keeps the context lean: trims large tool output and compacts in about a second.

install cache-guard

Install

git clone https://github.com/justmytwospence/claude-cache-guard
claude --plugin-dir ./claude-cache-guard

Then run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.

View source on GitHub

What it hooks into

From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.

Events
session.startsession.endclassic.SessionStartturn.startturn.completeturn.steptool.callsession.appendsession.compactprompt.submitcommand.run
API calls
$.clock.after$.clock.now$.command.register$.command.run$.env.get$.fs.read$.fs.write$.http.fetch$.model.fork$.process.run$.prompt.fill$.prompt.submit$.session.id$.session.messages$.session.model$.session.root$.session.usage$.ui.ask$.ui.log
Can see
classic hooksevery tool callcompactionevery prompt
Reach
level 3 of 3 networkruns processeswrites filesdrives Claudewrites the prompt boxreads filesreads env varsreads the transcriptdraws

Origin

How it got here
Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
Repository
github.com/justmytwospence/claude-cache-guard
Path in repo
repository root
Source commit
267d569 the exact code the scan read
Author
Spencer Boucher @justmytwospence
License
MIT
First published
Last pushed
First listed here

Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.