Monitor prompt cache hit rate while coding with OpenCode to keep it above 85 percent
Track per session AI spend in USD, CNY, EUR, JPY, GBP, or KRW
See how tokens split between system prompt, user input, tool calls, and tool results
OpenCode caches the first installed plugin version, so upgrading requires clearing the plugin cache before reinstalling.
OpenCode Visual Cache is a plugin for OpenCode, a terminal coding tool, that shows how often the model's prompt cache is being hit while you work. The README, written in Chinese, frames it as a sidebar panel that updates in real time. Alongside the cache hit rate, it displays a breakdown of tokens read from cache, written to cache, missed, and produced as output, plus the running session cost and how much money the cache has saved you so far. The panel also shows pricing information for the current model, including input, cache read, and cache write unit prices, all pulled dynamically from the provider configuration. There is a separate breakdown that estimates how many tokens are being spent on system prompts versus user input, agent instructions, tool calls, and tool results. Each section of the panel can be collapsed or hidden, and the plugin remembers the collapsed state between restarts. Colors come from the OpenCode theme and are desaturated automatically, with the hit rate value going green above 85 percent, orange above 70 percent, and red below 70 percent. Installing is described two ways. The recommended path is to press Ctrl plus P inside OpenCode, search for install plugin, type opencode-visual-cache@latest, and press enter. The manual path is npm install -g opencode-visual-cache@latest, then editing ~/.config/opencode/tui.jsonc to list the plugin. After a restart the sidebar panel appears in any session. The plugin adds four slash commands. /cache-currency switches the displayed currency between USD, CNY, EUR, JPY, GBP, and KRW, with default exchange rates filled in. /cache-rate lets you set a custom exchange rate. /cache-section toggles which subsections and the outer border are visible. /cache-config shows the current configuration. All changes take effect immediately and persist. The README notes a known OpenCode issue that locks the plugin to the version first installed, and gives the commands to clear the OpenCode plugin cache on Windows or on macOS and Linux before reinstalling. Language can be forced to English by setting the CACHE_TUI_LANG environment variable to en. The plugin is described as model agnostic and works with any AI model OpenCode supports, since token and pricing data come through the standard OpenCode SDK interface. License is MIT.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.