Repository navigation
A bugfix release: tool calls that an agent gets almost right are now served instead of refused, edits survive indentation slips, and the Claude Code plugin wakes the agent only once per finished background job. Agent Tools protocol and data formats are unchanged.
Fixed
- Searching a broad directory searches the project instead of failing.
ctx_search,ctx_globandctx_treecalled on~,/or another directory that contains the session's project now walk the project and say so in the first line of the result. Before, they answered "refusing to scan" and agents repeated the same call. Without a bound project the refusal now names the fix: pass the project directory aspath. - Agents can read their own instruction files. Skills, commands, sub-agent definitions, rules and plans under
~/.claude,~/.codex/skillsand~/.codex/prompts,~/.agents/skills,~/.cursor,~/.gemini/commandsand OpenCode's~/.config/opencode, plus the globalCLAUDE.md,AGENTS.mdandGEMINI.md, open read-only on first use. Credentials and settings beside them, such as~/.codex/auth.jsonor~/.claude/.credentials.json, stay closed, and LeanCTX tools cannot write there. A skill linked in from elsewhere below~is followed read-only; a link into a protected location or outside~is not, and links inside dependency folders such asnode_modulesare never followed. - A missing file comes with the file that was meant.
ctx_read,ctx_search,ctx_globandctx_treename the existing path when the requested one has a typo, another extension, or was written relative to the wrong directory (src/x.rsforrust/src/x.rs). - Paths with spaces work when written shell-style. On macOS and Linux a path such as
My\ Project/notes.mdor'/Users/me/My Project'turned intoMy/ Projectand was reported as missing. Backslash escapes and surrounding quotes are now removed. - Common argument spellings are accepted.
file_path,filePath,fileandfilenamework aspath,cmdascommand(for MCP calls andlean-ctx call), apathinside actx_searchqueries[]entry scopes that one query,ctx_globacceptsglobforpattern, andctx_patchreplace_allacceptsold_string/new_string. A replacement must still be named explicitly, so a missing one is never taken as "delete every match"; two spellings with different values are rejected. - An edit whose indentation is off still applies. When
old_stringmatches exactly one place in the file at a uniformly different indentation,ctx_editandctx_patch(replace_unique) apply it there and shiftnew_stringby the same amount, and say so. Uneven or ambiguous matches still fail with the exact-match error. - Read modes and glob patterns with small typos work.
lines:72:92,lines:72..92,lines 72-92and a capitalisedFullare read as the mode they spell;**.rsandsrc**are read as**/*.rsandsrc*/**. ctx_readno longer fails with "per-file lock contention". When an earlier read of the same file holds its lock for more than 10 seconds, the read proceeds without it.- No more "Retry the read" after LeanCTX opened a dependency folder. When a path in a dependency cache or an agent folder is still refused after it was opened read-only, the error now gives the actual reason.
lean-ctx callresolves these paths the same way as the MCP server. - The Claude Code plugin wakes the agent once per finished job. When the agent itself had already read a finished background job with
ctx_shell(background_action="status"or"cancel"), the plugin announced the same result again on the next turn, costing a whole extra turn.
Changed
- The token-saving curve in the Claude Code cockpit is drawn true to time and to scale. The x axis now runs from the session's first lean-ctx call to now, the y axis starts at zero, the raw total sits behind "kept out" as a dim envelope, moments in which tokens were kept out are lit, and an axis line shows the session span and the gain of the last ten minutes. Before, one column per sample scaled from the window's lowest value made a single saving look like a cliff.
Upgrade
lean-ctx update # recommended (auto-downloads + refreshes shell hooks)
cargo install lean-ctx # or
npm update -g lean-ctx-bin # or
brew upgrade lean-ctxNote: After upgrading via cargo/npm/brew, run
lean-ctx setupto refresh shell aliases.lean-ctx updatedoes this automatically.
Full Changelog: v3.11.3...v3.11.4