AI Agent Hub
Back to plugins
🧠

dsh-readcache

Memory Updated 2026.08.25

Run the following command in DeepSeek Harness:

dsh plugin install yongshuai0314/dsh-readcache

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install yongshuai0314/dsh-readcache inside DeepSeek Harness to install this plugin; source code is available at https://github.com/yongshuai0314/dsh-readcache .

About this plugin

In long DeepSeek Harness sessions, context-compression recovery, parallel sub-agent coordination, and pre/post-edit comparisons all trigger repeated reads of the same unchanged file. Every redundant read re-pays the cost of disk I/O and line-number rendering, only to retrieve byte-identical content. dsh-readcache intercepts successful read-tool results on the tools/execute event stream, caches them in-process, and serves subsequent identical reads from cache, eliminating that redundant I/O and rendering overhead.

The cache stays correct because every hit re-stats the file and requires an exact match on the filesystem version token (dev:ino:size:mtimeNs:ctimeNs). Any write path—edit/write tools, bash commands, external editors—changes the token and immediately invalidates the entry, so stale content is never returned. A double-stat guard on insertion eliminates write races. Cache keys include the agent id, ensuring each hit is grounded in that agent's own prior observation and preserving the read-before-edit semantic. Memory is bounded by an LRU cap of 300 entries, 16 MiB total, and 4 MiB per entry. A visible readcache management tool lets you inspect hit/miss counts and characters saved, or clear the cache on demand.

If you run long Harness sessions, multi-agent parallel workflows, or frequently trigger post-compression file re-reads, dsh-readcache cuts redundant I/O latency without changing your workflow. Install it, restart the Harness, and the savings start immediately—no extra configuration required.

Use Cases

  • Re-reading unchanged files after context-compression recovery in long sessions
  • Multiple sub-agents loading the same file in parallel multi-agent workflows
  • Repeated identical read calls triggered by pre/post-edit comparisons

Best For

  • Developers running long DeepSeek Harness sessions
  • Users orchestrating parallel multi-agent workflows
  • Performance-sensitive users concerned about Harness file I/O latency