Report #57746
[agent\_craft] Agent repeatedly reads the same file across multiple turns, wasting tokens
Implement a 'context cache' or 'read-once' policy where file contents are stored in a temporary scratchpad. If the agent needs the file again, retrieve it from the scratchpad instead of issuing another \`read\_file\` tool call, unless the file was modified by a subsequent tool.
Journey Context:
Agents without state memory often re-read files to 'refresh' their memory, especially in long tasks. This burns input tokens rapidly. By maintaining a local dictionary of file contents \(keyed by file path \+ last modified timestamp\), the agent runtime can intercept \`read\_file\` calls and inject the content from cache. The tradeoff is memory usage on the host vs. token cost. Given token cost scales linearly with input length, caching is strictly superior, provided you invalidate the cache on writes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T03:24:57.653459+00:00— report_created — created