Skip to content

v2.1.2 — Shell Hook PATH Fix

Choose a tag to compare

@yvgude yvgude released this 26 Mar 08:10
· 2549 commits to main since this release

Bug Fix: Shell Hook PATH Resolution

Fixes a critical bug where lean-ctx init --global and lean-ctx init --agent <tool> generated shell aliases and hook scripts using bare lean-ctx instead of the absolute binary path. This caused all rewritten commands to fail with exit code 126 when lean-ctx was not in the shell PATH.

What was broken

  • Every command rewritten by the hook (git status, ls, npm install, etc.) failed with exit code 126
  • On Windows with Git Bash: error /C: Is a directory due to path format mismatch
  • Once the hook was installed, Claude Code / Cursor became completely non-functional

What is fixed

  • Shell aliases (bash/zsh/fish) now embed the absolute binary path
  • Editor hooks (Claude, Cursor, Gemini) use LEAN_CTX_BIN="/full/path" variable
  • Windows + Git Bash: paths auto-converted from C:\Users\... to /c/Users/...
  • PowerShell was already correct (no change needed)

After updating

Re-run lean-ctx init --global and/or lean-ctx init --agent <tool> to regenerate hooks with the absolute path. Remove the old hook block from your shell config first.

Install

cargo install lean-ctx
# or download binary from assets below

Full changelog: https://github.com/yvgude/lean-ctx/blob/main/CHANGELOG.md

Full Changelog: v2.1.1...v2.1.2