Fix: ctx_shell Input Validation (#50)
Added
- File-write command blocking —
ctx_shellnow detects and rejects shell redirects (>,>>), heredocs (<< EOF), andteecommands. Returns a clear error redirecting to the native Write tool - Command size limit — Rejects commands over 8KB, preventing oversized heredocs from corrupting the MCP protocol stream
- Quote-aware redirect parsing — Redirect detection respects single/double quotes, ignores
2>(stderr) and> /dev/null
This prevents the cascading failure reported in #50:
Oversized ctx_shell → API Error 400 → MCP stream corruption → "path is required" → MCP stops
Upgrade
cargo install lean-ctx # or
npm update -g lean-ctx-bin # or
brew upgrade lean-ctxFull Changelog: v2.17.4...v2.17.5