github yvgude/lean-ctx v1.5.2
v1.5.2 – Subagent Cache Safety

latest releases: v3.9.1, v3.9.0, v3.8.18...
3 months ago

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

Don't miss a new lean-ctx release

NewReleases is sending notifications on new releases.