cache-magic

by Adam Caviness · ★ 0 · updated 10 days ago

ToastsPromptvalidates

0

Keeps a handoff while a large session's prompt cache is still warm. On a five-minute cache, a late prompt can go out after the handoff instead of the full context. On a one-hour cache the session stays, and compaction is pointed at the handoff.

install cache-magic

Install

git clone https://github.com/AdamCaviness/cache-magic
claude --plugin-dir ./cache-magic

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
turn.startprompt.submitsession.startconfig.setsession.compactclassic.Stopclassic.TeammateIdleclassic.SessionStartsession.end
API calls
$.clock.after$.clock.now$.command.run$.config.set$.env.get$.fs.read$.fs.stat$.fs.write$.model.complete$.model.fork$.process.run$.prompt.fill$.prompt.read$.prompt.submit$.session.id$.session.messages$.session.root$.session.turns$.session.usage$.settings.read$.store.delete$.store.get$.store.set$.ui.ask$.ui.log$.ui.toast
Can see
every promptcompactionclassic hooks
Reach
level 2 of 3 runs processeswrites fileschanges configdrives Claudewrites the prompt boxreads filesreads env varsreads settingsreads the transcriptreads the prompt boxpersists statedraws

Origin

How it got here
Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
Repository
github.com/AdamCaviness/cache-magic
Path in repo
repository root
Source commit
a8b3597 the exact code the scan read
Author
Adam Caviness @AdamCaviness
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.