The Field-Report Patch. Five issues straight from users' terminals, fixed
the same week v3.8.0 shipped:daemon enable --helpno longer installs the
service it was asked to explain (#393),allow_pathsfinally expands~
and$VARinstead of matching them literally (#392), andctx_shellcloses
the download-to-file, xargs-delegation and "strict mode that only warned"
gaps from the #391 security report. Plus: service file paths are printed
where you need them with a newdaemon restart(#394), and/reopenworks
anywhere in a comment (#388).
Added
lean-ctx daemon restart(GH #394): stops the supervised service and/or a
manually started daemon, then starts it again through whichever channel was
active before.- Service file paths are printed on
daemon enable/disable, shown in
daemon statusandlean-ctx doctor(GH #394): the exact LaunchAgent plist /
systemd user unit path plus the unit name, sosystemctl --user/
launchctltargets are obvious without searching. lean-ctx doctorPath-jail check (GH #392): reports the effective jail
state (active /path_jail = false/ compile-timeno-jail), flags
allow_pathsentries that can never match (unset$VAR, missing directory)
and theallow_paths = ["/"]pattern.- Consolidated filesystem-boundary reference (GH #392):
docs/reference/appendix-paths-and-config.md§5 documentspath_jailvs
allow_pathsvsextra_roots, theno-jailcargo feature and the removed
LEAN_CTX_NO_JAILenv var; SECURITY.md cross-links it.
Fixed
daemon enable --helpexecuted instead of showing help (GH #393):
--help/-h/helpanywhere inlean-ctx daemon …,lean-ctx proxy …or
lean-ctx allow …now prints usage and never executes the verb (an agent in
read-only plan mode installed the systemd service by asking for help).allow_paths/extra_rootsentries with~,$VARor${VAR}were
matched literally (GH #392): config files see no shell, so
"$HOME/code"silently never matched and PathJail kept rejecting paths the
user had explicitly allowed. Entries (and theLEAN_CTX_ALLOW_PATH/
LEAN_CTX_EXTRA_ROOTSenv lists, which MCP hosts pass shell-less too) are
now expanded; unset variables warn and are reported by doctor.
Security
ctx_shellhardening (GH #391): download-to-file flags are now treated
as file writes (curl -o/-O/--output/--remote-name,wget's default
file-download mode —wget -qO-/--spiderstay allowed,dd of=except
/dev/null);xargs/nohupjoin the delegation-aware checks so
… | xargs bash -c '…'cannot smuggle inline code past the interpreter
block in either allowlist or blocklist-only mode;shell_strict_mode = true
now actually blocks command substitution in arguments and
pipe-to-bare-interpreter (both previously only logged a warning while
claiming to block); substitution detection now also covers double-quoted
"$(…)"(single quotes still exempt — the shell doesn't expand there).
SECURITY.md states the ctx_shell threat model explicitly: defense in depth
for agent mistakes, not an OS sandbox — kernel-grade isolation belongs
to containers/seccomp and the agent's own permission model.
Changed
/reopenmatches anywhere in a comment (GH #388): "Please /reopen"
works now; previously the comment had to start with the command.
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.8.1...v3.8.1