Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Write changelog entries at release time, and tighten the Unreleased entries (#4130)

Maximilian Roos568f7428af32
diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md
index 2e8b7a828..2aa2c951d 100644
--- a/.claude/skills/release/SKILL.md
+++ b/.claude/skills/release/SKILL.md
@@ -95,7 +95,7 @@ Surface the full adjudicated list and get explicit sign-off before tagging. Do n
## CHANGELOG Review
-Check commits since last release for missing entries:
+Draft entries from the commits since the last release:
```bash
git log v<last-version>..HEAD --oneline
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8738db321..e0b9a9df6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,47 +4,43 @@
### Improved
-- **`wt config show` gives one `wt config shell install` for the whole shell section**: an outdated wrapper, fish integration still at the deprecated `conf.d` path, and a missing fish completions file each carried their own per-shell hint, so a machine with all three printed three commands where the bare one fixes everything. The rows still say what's wrong; the section's single trailing hint says what to run. The zsh `compinit` snippet is syntax-highlighted like every other command block.
+- **`wt config show` gives a single `wt config shell install` hint**: an outdated wrapper, a fish wrapper at the deprecated `conf.d` path, and missing fish completions each printed their own hint. The zsh `compinit` snippet is now syntax-highlighted. ([#4059](https://github.com/max-sixty/worktrunk/pull/4059))
-- **Interactive prompts no longer open with a blank line**: `wt config shell install`, `wt config plugins claude install`, and the commit-message setup offer at the top of `wt merge` all began with one. A prompt that follows other output keeps the blank line separating it.
+- **Interactive prompts no longer open with a blank line**: `wt config shell install`, `wt config plugins claude install`, and the commit-message setup offer in `wt merge` began with one. ([#4059](https://github.com/max-sixty/worktrunk/pull/4059))
-- **`wt config update --output <path>` confirms the write**: it now prints `✓ Wrote user config migration @ ~/migrated.toml`, so a command whose only effect is the file it wrote now says where that file is. Writing to stdout with `--output=-` stays silent, since the artifact is right there. ([#4053](https://github.com/max-sixty/worktrunk/pull/4053))
+- **`wt config update --output <path>` confirms the write**: it now prints `✓ Wrote user config migration @ ~/migrated.toml` where it printed nothing. `--output=-` stays silent. ([#4053](https://github.com/max-sixty/worktrunk/pull/4053))
### Fixed
-- **`wt config update` no longer overwrites an edit made while its confirmation prompt is open**: the migration was computed before the preview and written after the answer, so a config saved from another terminal during that wait was replaced by the pre-prompt snapshot — silently, with `✓ Updated user config` reported. The command now re-reads each config immediately before writing and fails with the path when the contents have moved on, leaving the newer file in place; re-running previews the current contents.
+- **`wt merge` skips `post-commit` when it removes that hook's worktree**: before, the hook ran in the primary worktree when the removed one sat inside the repository, and otherwise didn't run. The merge now prints `▲ Skipped post-commit`; move work that must finish there to `pre-remove`. ([#4049](https://github.com/max-sixty/worktrunk/pull/4049))
-- **`wt config shell install fish` writes the wrapper where fish reads it under a custom `$XDG_CONFIG_HOME`**: the wrapper path was hardcoded to `~/.config/fish/functions/`, while the completion path resolved the XDG config directory — same tool, same command, two answers. With `$XDG_CONFIG_HOME` pointing anywhere but `~/.config`, install reported success for both files, fish autoloaded the completion and never saw the wrapper, so `wt switch` changed no directory and `wt config show` reported the integration as installed. The wrapper, the completion, and the directories `wt config shell uninstall` and `wt config show` scan now all come from one resolution of fish's `$__fish_config_dir`. On Unix an unset or default `$XDG_CONFIG_HOME` is unaffected; on Windows the fish completion moves off `%APPDATA%\fish\completions` onto the same path as the wrapper. The deprecated `conf.d` file install cleans up stays pinned to `~/.config/fish/conf.d`, the only place worktrunk ever wrote it.
+- **`wt step prune` no longer deletes a branch created minutes ago from an older commit**: `--min-age` aged a branch without a worktree by its commit's date, so a new branch off a day-old commit was pruned on the next run. Age now comes from the branch's oldest reflog entry. ([#4077](https://github.com/max-sixty/worktrunk/pull/4077))
-- **`wt remove`, `wt merge`, and `wt step prune` no longer discard untracked files hidden by Git configuration**: `status.showUntrackedFiles = no` made the clean-worktree guard inherit a display preference, so a worktree containing only untracked files appeared clean and could be removed without `--force` — including by `wt step prune`, which removes unattended. Safety checks now always include untracked files and name the path that blocks removal. Auto-staging warnings for `wt merge`, `wt step commit`, and `wt step squash` likewise override the setting and enumerate every file that will be staged.
+- **`wt merge` no longer deletes a worktree locked with `git worktree lock`**: the merge completes and prints `Worktree preserved (locked)`. Every Worktrunk removal refuses a locked worktree, even with `--force`; run `git worktree unlock <path>` first. ([#4073](https://github.com/max-sixty/worktrunk/pull/4073), thanks @Duang777)
-- **`wt config plugins opencode install` no longer writes the plugin into the directory it was run from**: an exported-but-empty `OPENCODE_CONFIG_DIR` was taken at face value, so the install target collapsed to the relative path `plugins/worktrunk.ts` — typically somewhere inside the user's repository. `is_plugin_installed()` then read the plugin back from that same relative path, so the install reported success while OpenCode never saw it. An empty value now reads as unset, as it already did for `$CLAUDE_CONFIG_DIR` and `$PI_CONFIG_DIR`; the documented precedence `$OPENCODE_CONFIG_DIR` > `$XDG_CONFIG_HOME/opencode` > `~/.config/opencode` is unchanged. ([#4084](https://github.com/max-sixty/worktrunk/pull/4084))
+- **Removal no longer discards untracked files hidden by `status.showUntrackedFiles = no`**: under that setting, a worktree holding only untracked files looked clean, so `wt remove`, `wt merge`, and `wt step prune` removed it without `--force`. Safety checks now always count untracked files, and auto-staging warnings list every file they stage. ([#4111](https://github.com/max-sixty/worktrunk/pull/4111), thanks @Duang777)
-- **`wt step prune` no longer deletes a branch created minutes ago from an older commit**: the min-age guard aged a branch with no worktree by the committer date of the commit it points at, so `git branch <name> main` on a default branch whose last commit was over a day old was pruned on the next run — the case `--min-age` exists to prevent. The branch's age now comes from its oldest reflog entry, written when the branch was created.
+- **`wt remove` and `wt merge` check the right worktree under an inherited `GIT_DIR`**: run from a `!wt` git alias or a git hook, which pass `GIT_DIR` down, `wt remove` could delete a dirty worktree without `--force`, and `wt merge` could refuse a clean merge. Both now check the worktree they act on. ([#4082](https://github.com/max-sixty/worktrunk/pull/4082), thanks @Duang777)
-- **`wt merge` no longer deletes a worktree locked with `git worktree lock`**: its cleanup step removed the worktree anyway and reported success. The merge now completes and prints `Worktree preserved (locked)`, and every Worktrunk removal path refuses a lock even under `--force` — what `git worktree remove` does, minus git's `-f -f` override. Unlock with `git worktree unlock <path>` first. ([#4073](https://github.com/max-sixty/worktrunk/pull/4073), thanks @Duang777)
+- **`wt config shell install` no longer tells an already-wrapped shell to restart**: reinstalling from a shell with the wrapper loaded, such as after a version bump, printed `↳ Restart shell to activate shell integration`. ([#4059](https://github.com/max-sixty/worktrunk/pull/4059))
-- **`wt switch` recovers from a removed worktree in a bare repository**: recovery walks up from `$PWD` looking for a `.git` directory, and a bare repo has none — not at the bare directory and not at any ancestor — so the walk ran to the filesystem root and found nothing. Bare worktrees typically sit *inside* the bare directory, leaving it nowhere else to land, so `wt switch` and the picker surfaced git's raw "cannot resolve CWD" error instead of recovering and the removed-directory message dropped its `wt switch ^` suggestion. A directory that is itself a bare repository now counts as one to recover from; the deleted path still has to appear in that repository's worktree list before recovery accepts it. ([#4067](https://github.com/max-sixty/worktrunk/pull/4067))
+- **Plugin status and uninstall checks ask the agent CLIs**: `wt config show` could list an installed Claude Code plugin or Gemini CLI extension as not installed, and `wt config plugins claude|codex uninstall` could report success over a marketplace still configured. A repeat Claude uninstall now runs both removals instead of stopping at `Plugin not installed`. ([#4048](https://github.com/max-sixty/worktrunk/pull/4048), [#4054](https://github.com/max-sixty/worktrunk/pull/4054))
-- **`wt merge` no longer treats the feature's own files as uncommitted changes on the target**: when `wt` runs with an inherited `GIT_DIR` pinned to the invoking worktree — a `!wt` git alias from a linked worktree is one source; git also exports discovery vars to the hooks it spawns — worktree-local `status` and `read-tree` forwarded it, so the target conflict check compared the invoking index to the target worktree and refused a merge that should have been clean. Those calls now discover the worktree from the directory `wt` chose; repo-level plumbing keeps the inherited context so the alias still finds the repository.
+- **`wt switch` recovers from a removed worktree in a bare repository**: `wt switch` and the picker showed git's "cannot resolve CWD" error instead, and the removed-directory message lacked `wt switch ^`. ([#4067](https://github.com/max-sixty/worktrunk/pull/4067))
-- **`wt remove` no longer deletes a dirty worktree when an inherited `GIT_DIR` masks its changes**: the same forwarded `GIT_DIR` made `ensure_clean` compare the target's working tree against the invoking worktree's index, so when the two agreed on a path a genuinely dirty target read as clean and removal proceeded with no `--force` and no warning. The dirty gate now reads the worktree being removed.
+- **`wt config shell install fish` puts the wrapper where fish reads it under a custom `$XDG_CONFIG_HOME`**: the wrapper always went to `~/.config/fish/functions/`, so install reported success while `wt switch` changed no directory. On Windows, the fish completion moves from `%APPDATA%\fish\completions` to the wrapper's directory. ([#4107](https://github.com/max-sixty/worktrunk/pull/4107))
-- **`wt config update` migrates `[ci] platform` into a `[forge]` section that only sets `hostname`**: the migration stood down whenever a `[forge]` section existed at all, so the config a GitHub Enterprise or self-hosted GitLab user ends up with — `[ci] platform` from before the rename, `[forge] hostname` added later for an SSH host alias — kept the deprecated key with no warning and nothing `wt config update` would do about it. The platform still resolved, so nothing broke; the deprecation notice that precedes `[ci]`'s eventual removal simply never arrived. A `[forge]` that already sets `platform`, or a `forge` that isn't a section, still stands down.
+- **`wt config shell install` migrates a deprecated `conf.d` fish wrapper when `~/.config/fish/functions` is missing**: before, only `wt config shell install fish` migrated it. `wt config show` now reports that wrapper even when fish isn't on `PATH`. ([#4059](https://github.com/max-sixty/worktrunk/pull/4059))
-- **`wt config shell install` migrates a fish wrapper at the deprecated `conf.d` path even when `~/.config/fish/functions` doesn't exist yet**: fish was skipped for want of a config location, so the bare command left the deprecated wrapper running and only `wt config shell install fish` migrated it. A worktrunk wrapper at the old path now counts as fish being configured, just at the old path. `wt config show` reports that wrapper too, where before it showed nothing at all for fish unless fish was on `PATH`.
+- **`wt config update` no longer overwrites a config edited while its prompt is open**: it wrote the pre-prompt snapshot over the newer file and reported success. It now fails with the path and leaves the newer file; re-running previews the current contents. ([#4127](https://github.com/max-sixty/worktrunk/pull/4127))
-- **`wt config shell install` no longer tells an already-wrapped shell to restart**: reinstalling from inside a shell that has the wrapper loaded — after a version bump, or when the fish extension moves from `conf.d` to `functions` — printed `↳ Restart shell to activate shell integration` right after the wrapper had intercepted the command. The hint now only appears when integration isn't active.
+- **`wt config update` migrates `[ci] platform` into a `[forge]` section that only sets `hostname`**: that config, common with GitHub Enterprise and self-hosted GitLab, kept the deprecated key with no deprecation warning. ([#4061](https://github.com/max-sixty/worktrunk/pull/4061))
-- **An alias that binds `dry_run` can take `--dry-run <value>`**: `wt <alias> --dry-run <value>` answered the retired-flag error even when the alias's own template referenced `{{ dry_run }}`, while `--dry-run=<value>` bound normally — so one flag behaved two ways. Both value-taking spellings now bind for an alias that references the name, matching how `--help` and `--yes` already yield to a template that binds them. A bare `--dry-run` with no value still errors, since forwarding it into `{{ args }}` would leave `dry_run` unset and run the live command; the message names `--dry-run=1`. ([#4058](https://github.com/max-sixty/worktrunk/pull/4058))
+- **A deprecated config section the migration can't rewrite now warns**: `select = "not a table"`, or a `[select]` whose `[switch.picker]` destination is already set, was ignored without a message. It now reports `unknown field select (will be ignored)`. ([#4121](https://github.com/max-sixty/worktrunk/pull/4121))
-- **`wt merge` no longer runs `post-commit` in a worktree the user never chose**: the merge removes the worktree that hook is anchored on before the hook starts, so the pipeline was spawned into an emptied path. Where the worktree sat inside the repository, git discovery walked up from there and the hook's commands ran in the primary worktree; anywhere else they didn't run at all, and the only record was a log file nothing reads. The merge now prints `▲ Skipped post-commit: …` naming that worktree, and points at `pre-remove` for work that must finish there. `--no-remove`, merging on the target branch, `wt step commit`, and `wt step squash` still run it. ([#4049](https://github.com/max-sixty/worktrunk/pull/4049))
+- **`wt config plugins opencode install` no longer writes the plugin into the current directory**: with `OPENCODE_CONFIG_DIR` set but empty, it wrote `plugins/worktrunk.ts` there, typically inside a repository, reporting success though OpenCode never saw it. An empty value now counts as unset. ([#4084](https://github.com/max-sixty/worktrunk/pull/4084))
-- **`wt config plugins claude uninstall` / `codex uninstall` no longer report success over a marketplace that is still there**: to tell an already-removed marketplace from a removal that failed, uninstall used to read the harness's own config file. A file or key the harness renamed reads as an absence there, so every failed removal would have printed `Plugin & marketplace removed` and exited 0. It now asks `claude` / `codex plugin marketplace list --json`, and an answer it cannot read leaves the harness's error standing. ([#4048](https://github.com/max-sixty/worktrunk/pull/4048))
-
-- **`wt config show` reports Claude Code's plugin and Gemini CLI's extension from those tools' own listings**: it read `installed_plugins.json` and the `~/.gemini/extensions/` directory, so a store either tool relocated read as an absence and the section said "not installed" over an installed plugin. Both answers now come from `claude plugin list --json` and `gemini extensions list -o json`. `wt config plugins claude uninstall` follows: it runs the plugin removal and the marketplace removal every time, each tolerating only the absence Claude Code itself reports, so it no longer exits early with `Plugin not installed` on a file read. ([#4054](https://github.com/max-sixty/worktrunk/pull/4054))
-
-- **A deprecated config section the migration declines to rewrite now warns instead of vanishing**: `select = "not a table"`, or a `[select]` whose `[switch.picker]` destination is already set, is left in place so the value isn't dropped — but the unknown-field check skipped it too, so nothing read the setting and nothing said so. It now reports `unknown field select (will be ignored)`. Empty legacy sections stay silent. ([#4121](https://github.com/max-sixty/worktrunk/pull/4121))
+- **An alias that binds `dry_run` can take `--dry-run <value>`**: that spelling failed with the retired-flag error even when the template referenced `{{ dry_run }}`, while `--dry-run=<value>` worked. A bare `--dry-run` still errors; pass `--dry-run=1`. ([#4058](https://github.com/max-sixty/worktrunk/pull/4058))
## 0.77.0
diff --git a/CLAUDE.md b/CLAUDE.md
index 505469174..47d6a8c32 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -222,4 +222,4 @@ No `get_*` — bare nouns follow Rust stdlib convention.
## Releases
-Use the `release` skill (version bump, changelog, crates.io publish, GitHub release).
+Use the `release` skill (version bump, changelog, crates.io publish, GitHub release). It writes every changelog entry from the commits since the last tag, so other PRs leave `CHANGELOG.md` untouched; a PR that already carries an entry drops it rather than resolving a conflict on it.