v3.5.13
Fixed
- Instruction files no longer compressed — SKILL.md, AGENTS.md, RULES.md, .cursorrules, and files in
/skills/,/.cursor/rules/,/.claude/rules/are now always delivered in full mode, bypassing all heuristic/bandit/adaptive mode selection. This was the root cause of agents losing instructions after v3.4.7 when the Intent Router was introduced. Guards added in 5 code paths:resolve_auto_mode,predict_from_defaults,select_mode_with_task,auto_degrade_read_mode, and CLIread_cmd. Fixes #159 regression, resolves GlemSom's report. - Markdown files exempt from aggressive compression —
.md,.mdx,.txt,.rstfiles no longer fall into theaggressivedefault bucket inpredict_from_defaults. These file types returnNone(= full mode) to prevent stripping prose/instruction content. - Windows Claude Code PowerShell compatibility — Claude Code hook matchers now include
PowerShell|powershellon Windows, so PreToolUse hooks fire regardless of whether Claude uses Bash or PowerShell. Rewrite script also accepts PowerShell tool names. Fixes #192.
Added
is_instruction_file()public API — Reusable guard function detecting instruction/skill/rule files by filename and path patterns. Used across MCP, CLI, and server dispatch paths.- Lean4 formal proofs — Theorems 12-13 in
ReadModes.lean: instruction files always resolve to full mode, content is always preserved. - 7 new regression tests —
instruction_file_detection,resolve_auto_mode_returns_full_for_instruction_files,defaults_never_compress_markdown, and PowerShell hook matcher tests.
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.5.13...v3.5.13