github yvgude/lean-ctx v2.16.5
v2.16.5 — ctx_edit: MCP-native file editing

latest releases: v3.9.3, v3.9.2, v3.9.1...
3 months ago

ctx_edit — MCP-native file editing

In Windsurf + Claude Code extension (and similar environments), the native Edit tool requires a prior Read call — but Read doesn't exist as a tool. Agents entered infinite loops trying to make Edit work, burning through 10%+ of user quota.

Added

  • ctx_edit MCP tool — Search-and-replace that reads, modifies, and writes files in one call. No native Read/Edit dependency.
    • ctx_edit(path, old_string, new_string) — replace unique match
    • ctx_edit(path, old_string, new_string, replace_all=true) — replace all occurrences
    • ctx_edit(path, new_string="...", create=true) — create new file
    • Error on ambiguous matches (old_string found multiple times without replace_all)
    • Auto-approved in lean-ctx setup for all IDEs

Changed

  • Instructions v7 — All injected rules now include ctx_edit in the tool mapping and explicit anti-loop guidance: "NEVER loop on Edit failures — switch to ctx_edit immediately."
  • PREFER over NEVER — Native tools allowed as fallback (continued from v2.16.4)

Fixed

  • Agents no longer loop when Edit requires unavailable Read
  • 10%+ quota burn from Edit/Read loops eliminated

Upgrade

cargo install lean-ctx    # or
npm i -g lean-ctx-bin     # or
brew upgrade lean-ctx     # then:
lean-ctx setup            # re-install rules (v7)

Full Changelog: v2.16.4...v2.16.5

Don't miss a new lean-ctx release

NewReleases is sending notifications on new releases.