Skip to content

v1.5.2 – Subagent Cache Safety

Choose a tag to compare

@yvgude yvgude released this 24 Mar 14:43

Subagent Cache Safety

Solves the subagent baseline problem: when a subagent is spawned without the parent agent's context, it can now explicitly control cache behavior instead of receiving stale cache-hit responses.

New: ctx_cache Tool (9th MCP tool)

  • ctx_cache(action: "status") — Show all cached files with read counts
  • ctx_cache(action: "clear") — Reset entire session cache (ideal for subagents starting fresh)
  • ctx_cache(action: "invalidate", path: "...") — Remove a single file from cache

New: fresh parameter on ctx_read

  • ctx_read(path: "...", fresh: true) — Bypass cache and force a full re-read
  • Use when running as a subagent that may not have received the parent's file reads

Background

MCP does not provide a standardized subagent identifier. Previously, a subagent calling ctx_read on a cached file would receive a ~13 token cache-hit message without ever seeing the content. The fresh parameter and ctx_cache tool give agents explicit control.

Upgrade

cargo install lean-ctx
brew upgrade lean-ctx