github yvgude/lean-ctx v2.16.6
v2.16.6 — ctx_edit CRLF fix for Windows

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

ctx_edit: Windows CRLF support

ctx_edit failed on Windows because files use \r\n (CRLF) but agents send old_string with \n (LF). The exact string match failed silently, causing fallback to Write (full-file rewrite) or Bash.

Fixed

  • CRLF/LF auto-normalizationctx_edit detects the file's line ending style and converts old_string/new_string to match. CRLF ↔ LF works transparently in both directions.
  • Trailing whitespace tolerance — If exact match fails, ctx_edit retries after trimming trailing whitespace per line, matching the original span.
  • Better error messages — Failed matches on CRLF files now show "(file uses CRLF line endings)".
  • 9 unit tests covering CRLF→LF, LF→CRLF, trailing whitespace, and combined scenarios.

Also in v2.16.5 (same session)

  • ctx_edit MCP tool — Search-and-replace without native Read/Edit dependency.
  • Instructions v7 — Anti-loop guidance: "NEVER loop on Edit failures — use ctx_edit."
  • PREFER over NEVER — Native tools allowed as fallback.

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.5...v2.16.6

Don't miss a new lean-ctx release

NewReleases is sending notifications on new releases.