Repository navigation
Releases: agallardol/zcode-git-worktrees
Release list
v0.5.2 — worktrees for every thread type
Some threads (forks/continues) never receive a SessionStart event from the engine, so they got no auto worktree. The hook now also listens to UserPromptSubmit: every prompt re-checks (idempotently, ~50ms, silent when the session is already bound) and schedules the worktree on the first message if needed. 130 tests green.
v0.5.1 — instant session start
Session start no longer blocks on repository size.
- The SessionStart hook now schedules the worktree creation and returns immediately with the promised path — 0.09s on a 43 GB repo (was ~24s).
- A detached creator process builds the worktree:
git worktree add --no-checkout(instant), immediate state registration (nothing orphaned if a session dies mid-flight), then a background checkout that clears a.zcode-checkout-pendingmarker the agent can see. - Failure hardening from the same field report: kills mid-create can no longer leak orphan worktrees or hold the store lock; a
pending-<session>marker makes scheduling idempotent across rapid restarts; creator failures are logged toauto-session-errors.log. - Context injected at session start now tells the agent how to wait for the background checkout before first file access.
v0.5.0 — security hardening
Security
- Auto-session creates no longer execute repo-provided commands. Previously,
.zcode/worktree.jsonsetupCommandsfrom any repository ran automatically the moment a session opened that repo — arbitrary code execution with zero user action on untrusted clones. Lifecycle commands (setupCommands/preRemoveCommands) now run only on explicitly created worktrees; auto-session worktrees skip both (teardown paired with setup). The original exploit is a permanent regression test. - The PreToolUse edit guard no longer denies with a redirect to a worktree that was deleted out-of-band.
Project
- SECURITY.md (trust model + private reporting), CONTRIBUTING.md, Code of Conduct, issue templates.
- CI on GitHub Actions: macOS + Ubuntu, Node 20 & 22 (suite is zero-dependency).
- README: install steps verified against the actual desktop UI, troubleshooting section, accurate test counts (129).
Upgrade note: if you rely on setupCommands running for automatic session worktrees, run them once via /worktree:new <name> (explicit creates still execute them) or install dependencies in the session worktree manually.
v0.4.3 — benefit-first catalog copy
The marketplace description now leads with what the plugin actually does for you: every thread automatically gets its own isolated worktree. No verb-list, no 'call a command first' energy.
v0.4.2 — plugin icon + manifest fix
- Marketplace entry now carries a plugin icon (assets/icon.png via raw.githubusercontent) — visible in Settings → Plugins.
- Removed the misdeclared
hooksmanifest field; hooks load via the defaulthooks/hooks.jsonpath (clears a catalog diagnostic). - Placeholder icon ships now; final artwork drops in at the same path with no rewiring.
v0.4.1 — fast session start on large repositories
Fixes auto-session worktree creation failing (hook timeout) on large checkouts.
- Removed
du-based size estimation from the create path — it took 12s+ on multi-GB repos and ran inside the 10s SessionStart hook budget. Create now uses an instant statfs floor check; detailed sizing remains inworktrees_status/worktrees_list. - Hook budget raised to 30s (session start on a 43 GB repo now completes in ~8s).
- Hook-side lock wait is 5s — a contended store lock fails fast with a clear message instead of eating the hook budget.
- Regression tests for both (static no-du guard + lock fail-fast), 125 tests green.
v0.4.0 — first public release
Initial public release of Git Worktrees for ZCode.
Core
- 8 slash commands (/worktree dashboard, new with background-agent tasks, status, remove, cleanup, pr checkout, end, auto)
- 9 MCP tools with snapshot-before-delete, branch retention, retention sweeps, .worktreeinclude carry-over
- Auto-session worktrees (on by default): per-session isolation with edit guard, Settings-UI + command + per-repo controls
- Zero npm dependencies (Node ≥ 18); concurrency-safe store with self-healing state
Quality
- 123 tests (80 unit / 13 integration / 30 adversarial) — all green, no network or model calls needed
- Verified end-to-end in live ZCode sessions (create, hook context injection, dirty removal + snapshot, auto-assign + guard deny)
Install: Settings → Plugin Management → add marketplace agallardol/zcode-git-worktrees → install Git Worktrees.