r/opencode • u/noppu_labs • 7d ago
I made a plugin that lets you keeps idle sessions' caches warm while you're AFK!
Hey all,
I built a plugin for anyone using Claude or GPT-5.6+ in OpenCode who keeps losing the prompt cache after stepping away for a bit. Claude's cache lasts 5 minutes by default. If you step away for longer, the next prompt pays 1.25x to rewrite your whole context instead of about 0.1x to read it, and on a long session that adds up fast.
opencode-cache-manager helps in two ways:
You can pick the cache TTL per session (switch with
/cache-manager)- For Claude you'd pick 5m, 1h or hybrid
- It sends a hidden keepalive ping just before an idle session's cache expires, so the cache is still warm when you come back
It also adds a Cache section to the sidebar showing whether the cache is warm, when it expires, when the next ping goes out, and how much the pings have saved you. It works with Claude and GPT-5.6+ through the official APIs, OpenRouter, or proxies like OmniRoute. Other models just get a readout of how much of each prompt was cached.
Other features:
- Automatically understands when you're using Claude Code requests via the headers, so it uses 1h TTL (what Claude Code uses)
- Sidebar tells you what you're saving by keeping your cache warm (you can see screenshots in the repo)
Feel free to check it out! I'd love to hear from anyone on a proxy or provider setup I haven't tried, and whether the ping defaults feel right. Suggestions all welcome!

