This release introduces precise AI agent session tracking with lifecycle hooks, a new CLI cleanup command for stale worktrees, and customizable CI remote targeting. It also significantly reduces idle CPU consumption and hardens concurrent worktree note editing.
Note
Run lazyworktree setup-hooks to migrate to the new LLM session detection
Features
- Agent Lifecycle Hooks: Added session tracking lifecycle hooks for Claude Code, Codex CLI, and GitHub Copilot CLI. This allows precise status monitoring (such as "thinking" vs. "waiting for input") and replaces expensive process-table scans. Run
lazyworktree setup-hooksto install. - Stale Worktree Cleanup Command: Introduced a new
cleanupCLI subcommand to identify and remove merged worktrees, stale branches, and orphaned directories. Users can run this interactively or automate it non-interactively using the--allflag. - Structured Cleanup Output: Integrated a
--jsonflag into thecleanupcommand to emit machine-readable results, and updated the command's visual summary to display a bulleted list of removed worktrees. - Configurable CI Remote: Added a
ci_remotesetting (with an"auto"sentinel) to target a specific remote (such asupstream) for GitHub CI and PR status queries. This ensures fork workflows query the upstream repository without changing the worktree's core local repository identity. - Prevent Git Optional Locks: Injected
GIT_OPTIONAL_LOCKS=0into executed Git commands to prevent concurrent automated operations from performing optional index locks, eliminating index modification conflicts.
Bug Fixes
- Split Notes Concurrency: Switched split-mode worktree notes to targeted, single-file saves instead of bulk directory writes. This ensures a stale in-memory map from one process cannot accidentally erase or overwrite notes concurrently edited by another process.
- Weekly PR Merge Strategy: Changed the weekly workflow PR merge strategy from merge to rebase to maintain a linear git history.
Performance Improvements
- Reduced Idle CPU: Dropped idle tick resource consumption by skipping expensive process scans when the agent process set remains unchanged, suspending auto-refresh loops when the TUI is unfocused, and revalidating cached Git details using cheap HEAD/status probes. Added a hidden
LAZYWORKTREE_PPROFCPU profiling hook.
Maintenance
- Reorganized AI agent contribution guidelines in
AGENTS.mdfor better visibility of README.md modification constraints. - Configured Dependabot to group GitHub Actions updates into a single weekly pull request.