Added
CLAUDE_CONFIG_DIRsupport:lean-ctx init --agent claude,lean-ctx doctor,lean-ctx uninstall, hook installation, and all Claude Code detection paths now respect the$CLAUDE_CONFIG_DIRenvironment variable. Previously hardcoded to~/.claude.jsonand~/.claude/.CLAUDE_ENV_FILEDocker hint:lean-ctx init --globalandlean-ctx doctornow recommend settingENV CLAUDE_ENV_FILEalongsideENV BASH_ENVin Docker containers. Claude Code sourcesCLAUDE_ENV_FILEbefore every command — this is the officially recommended shell environment mechanism.- Doctor check for
CLAUDE_ENV_FILE: In Docker environments,lean-ctx doctornow shows separate checks for bothBASH_ENVandCLAUDE_ENV_FILE.
Fixed
- Claude Code
_lcnot found in Docker (#89): Root cause was thatBASH_ENValone doesn't work for Claude Code — it usesCLAUDE_ENV_FILEto source shell hooks before each command. Recommended Dockerfile now includesENV CLAUDE_ENV_FILE="/root/.lean-ctx/env.sh". CLAUDE_CONFIG_DIRignored everywhere:setup.rs,rules_inject.rs,doctor.rs,hooks.rs,uninstall.rs, andreport.rsall hardcoded~/.claude.json/~/.claude/. Now all paths go throughclaude_config_json_path()/claude_config_dir()which check$CLAUDE_CONFIG_DIRfirst.
Upgrade
cargo install lean-ctx # or
npm update -g lean-ctx-bin # or
brew upgrade lean-ctxFull Changelog: v3.1.4...v3.1.4