Skip to content

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

feat(prune): bump default --min-age from 1h to 1d (#2886)

Maximilian Roos818aef5c5cda
diff --git a/docs/content/step.md b/docs/content/step.md
index 9405ba6a0..b60166db4 100644
--- a/docs/content/step.md
+++ b/docs/content/step.md
@@ -733,7 +733,7 @@ Locked worktrees and the main worktree are always skipped. The current worktree
### Min-age guard
-Worktrees younger than `--min-age` (default: 1 hour) are skipped. This prevents removing a worktree just created from the default branch — it looks "merged" because its branch points at the same commit.
+Worktrees younger than `--min-age` (default: 1 day) are skipped. This prevents removing a worktree just created from the default branch — it looks "merged" because its branch points at the same commit.
{{ terminal(cmd="wt step prune --min-age=0s # no age guard|||wt step prune --min-age=2d # skip worktrees younger than 2 days") }}
@@ -761,7 +761,7 @@ Usage: <b><span class=c>wt step prune</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>--min-age</span></b><span class=c> &lt;MIN_AGE&gt;</span>
Skip worktrees younger than this
- [default: 1h]
+ [default: 1d]
<b><span class=c>--foreground</span></b>
Run removal in foreground (block until complete)
diff --git a/skills/worktrunk/reference/step.md b/skills/worktrunk/reference/step.md
index bb94f4d62..214db3b7f 100644
--- a/skills/worktrunk/reference/step.md
+++ b/skills/worktrunk/reference/step.md
@@ -761,7 +761,7 @@ Locked worktrees and the main worktree are always skipped. The current worktree
### Min-age guard
-Worktrees younger than `--min-age` (default: 1 hour) are skipped. This prevents removing a worktree just created from the default branch — it looks "merged" because its branch points at the same commit.
+Worktrees younger than `--min-age` (default: 1 day) are skipped. This prevents removing a worktree just created from the default branch — it looks "merged" because its branch points at the same commit.
```bash
$ wt step prune --min-age=0s # no age guard
@@ -796,7 +796,7 @@ Options:
--min-age <MIN_AGE>
Skip worktrees younger than this
- [default: 1h]
+ [default: 1d]
--foreground
Run removal in foreground (block until complete)
diff --git a/src/cli/step.rs b/src/cli/step.rs
index 99573b800..c971e68d7 100644
--- a/src/cli/step.rs
+++ b/src/cli/step.rs
@@ -553,7 +553,7 @@ Locked worktrees and the main worktree are always skipped. The current worktree
## Min-age guard
-Worktrees younger than `--min-age` (default: 1 hour) are skipped. This prevents removing a worktree just created from the default branch — it looks "merged" because its branch points at the same commit.
+Worktrees younger than `--min-age` (default: 1 day) are skipped. This prevents removing a worktree just created from the default branch — it looks "merged" because its branch points at the same commit.
```console
$ wt step prune --min-age=0s # no age guard
@@ -581,7 +581,7 @@ $ wt step prune
dry_run: bool,
/// Skip worktrees younger than this
- #[arg(long, default_value = "1h")]
+ #[arg(long, default_value = "1d")]
min_age: String,
/// Run removal in foreground (block until complete)
diff --git a/tests/integration_tests/step_prune.rs b/tests/integration_tests/step_prune.rs
index 77f955973..24a9aeefe 100644
--- a/tests/integration_tests/step_prune.rs
+++ b/tests/integration_tests/step_prune.rs
@@ -120,7 +120,7 @@ fn test_prune_min_age_skips_young(mut repo: TestRepo) {
// Create a worktree at same commit as main (would be pruned without age guard)
repo.add_worktree("young-branch");
- // Default min-age (1h) — worktree appears "young" due to test epoch
+ // Default min-age (1d) — worktree appears "young" due to test epoch
assert_cmd_snapshot!(make_snapshot_cmd(
&repo,
"step",
@@ -286,7 +286,7 @@ fn test_prune_orphan_branches(mut repo: TestRepo) {
// Create an unmerged branch (has a unique commit via worktree, then remove worktree)
repo.add_worktree_with_commit("unmerged-orphan", "u.txt", "data", "unique commit");
- // Far-future epoch: branches appear ~5 years old, passing the default 1h guard
+ // Far-future epoch: branches appear ~5 years old, passing the default 1d guard
let mut cmd = make_snapshot_cmd(&repo, "step", &["prune", "--yes"], None);
cmd.env("WORKTRUNK_TEST_EPOCH", "1893456000"); // 2030-01-01
cmd.env("RAYON_NUM_THREADS", "1"); // deterministic output order
@@ -298,7 +298,7 @@ fn test_prune_orphan_branches(mut repo: TestRepo) {
///
/// GIT_COMMITTER_DATE=2025-01-01T00:00:00Z makes the branch reflog timestamp
/// epoch 1735689600. Setting TEST_EPOCH to 30 minutes later (1735691400) means
-/// the branch appears 30 minutes old, which is younger than the default 1h.
+/// the branch appears 30 minutes old, which is younger than the default 1d.
#[rstest]
fn test_prune_orphan_branch_min_age(repo: TestRepo) {
repo.commit("initial");
@@ -306,7 +306,7 @@ fn test_prune_orphan_branch_min_age(repo: TestRepo) {
// Create a branch at HEAD (integrated) without a worktree
repo.create_branch("orphan-integrated");
- // Epoch 30 minutes after GIT_COMMITTER_DATE → branch appears 30min old, < 1h
+ // Epoch 30 minutes after GIT_COMMITTER_DATE → branch appears 30min old, < 1d
let mut cmd = make_snapshot_cmd(&repo, "step", &["prune", "--yes"], None);
cmd.env("WORKTRUNK_TEST_EPOCH", "1735691400"); // 2025-01-01T00:30:00Z
@@ -378,7 +378,7 @@ fn test_prune_stale_worktree(mut repo: TestRepo) {
/// Min-age check passes when worktrees are old enough.
///
/// Uses a far-future epoch (2030) so real worktrees (created Feb 2026) appear
-/// ~4 years old, passing the default 1h min-age. This exercises the age
+/// ~4 years old, passing the default 1d min-age. This exercises the age
/// fall-through path that `--min-age=0s` bypasses entirely.
#[rstest]
fn test_prune_min_age_passes(mut repo: TestRepo) {
@@ -505,7 +505,7 @@ fn test_prune_stale_plus_young(mut repo: TestRepo) {
// Orphan branch (no worktree) at HEAD: integrated but appears young
repo.create_branch("young-orphan");
- // Epoch 30 minutes after GIT_COMMITTER_DATE → orphan branch appears 30min old, < 1h
+ // Epoch 30 minutes after GIT_COMMITTER_DATE → orphan branch appears 30min old, < 1d
let mut cmd = make_snapshot_cmd(&repo, "step", &["prune", "--dry-run"], None);
cmd.env("WORKTRUNK_TEST_EPOCH", "1735691400");
assert_cmd_snapshot!(cmd);
@@ -524,7 +524,7 @@ fn test_prune_stale_plus_young_non_dry_run(mut repo: TestRepo) {
// Regular merged worktree: with default epoch it appears "young"
repo.add_worktree("young-branch");
- // Default min-age (1h) — young-branch is skipped, stale-branch is removed
+ // Default min-age (1d) — young-branch is skipped, stale-branch is removed
let mut cmd = make_snapshot_cmd(&repo, "step", &["prune", "--yes"], None);
cmd.env("RAYON_NUM_THREADS", "1"); // deterministic output order
assert_cmd_snapshot!(cmd);
diff --git a/tests/snapshots/integration__integration_tests__step_prune__prune_min_age_skips_young.snap b/tests/snapshots/integration__integration_tests__step_prune__prune_min_age_skips_young.snap
index 87e507dcb..8b5230df6 100644
--- a/tests/snapshots/integration__integration_tests__step_prune__prune_min_age_skips_young.snap
+++ b/tests/snapshots/integration__integration_tests__step_prune__prune_min_age_skips_young.snap
@@ -24,6 +24,7 @@ info:
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
NO_COLOR: ""
OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
@@ -38,9 +39,11 @@ info:
WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
WORKTRUNK_TEST_BASH_INSTALLED: "0"
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
WORKTRUNK_TEST_EPOCH: "1735776000"
WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
WORKTRUNK_TEST_NUSHELL_ENV: "0"
WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
@@ -54,4 +57,4 @@ exit_code: 0
----- stdout -----
----- stderr -----
-○ Skipped young-branch (younger than 1h)
+○ Skipped young-branch (younger than 1d)
diff --git a/tests/snapshots/integration__integration_tests__step_prune__prune_orphan_branch_min_age.snap b/tests/snapshots/integration__integration_tests__step_prune__prune_orphan_branch_min_age.snap
index dfcce41ff..21e9aeb83 100644
--- a/tests/snapshots/integration__integration_tests__step_prune__prune_orphan_branch_min_age.snap
+++ b/tests/snapshots/integration__integration_tests__step_prune__prune_orphan_branch_min_age.snap
@@ -24,6 +24,7 @@ info:
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
NO_COLOR: ""
OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
@@ -38,9 +39,11 @@ info:
WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
WORKTRUNK_TEST_BASH_INSTALLED: "0"
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
WORKTRUNK_TEST_EPOCH: "1735691400"
WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
WORKTRUNK_TEST_NUSHELL_ENV: "0"
WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
@@ -54,4 +57,4 @@ exit_code: 0
----- stdout -----
----- stderr -----
-○ Skipped orphan-integrated (younger than 1h)
+○ Skipped orphan-integrated (younger than 1d)
diff --git a/tests/snapshots/integration__integration_tests__step_prune__prune_stale_plus_young.snap b/tests/snapshots/integration__integration_tests__step_prune__prune_stale_plus_young.snap
index b89849b48..7d3c0797c 100644
--- a/tests/snapshots/integration__integration_tests__step_prune__prune_stale_plus_young.snap
+++ b/tests/snapshots/integration__integration_tests__step_prune__prune_stale_plus_young.snap
@@ -24,6 +24,7 @@ info:
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
NO_COLOR: ""
OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
@@ -38,9 +39,11 @@ info:
WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
WORKTRUNK_TEST_BASH_INSTALLED: "0"
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
WORKTRUNK_TEST_EPOCH: "1735691400"
WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
WORKTRUNK_TEST_NUSHELL_ENV: "0"
WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
@@ -55,5 +58,5 @@ exit_code: 0
----- stderr -----
○ stale-branch (stale) — same commit as main
-○ Skipped young-branch, young-orphan (younger than 1h)
+○ Skipped young-branch, young-orphan (younger than 1d)
↳ 1 branch would be removed (dry run)
diff --git a/tests/snapshots/integration__integration_tests__step_prune__prune_stale_plus_young_non_dry_run.snap b/tests/snapshots/integration__integration_tests__step_prune__prune_stale_plus_young_non_dry_run.snap
index f095321bd..57cbc26c0 100644
--- a/tests/snapshots/integration__integration_tests__step_prune__prune_stale_plus_young_non_dry_run.snap
+++ b/tests/snapshots/integration__integration_tests__step_prune__prune_stale_plus_young_non_dry_run.snap
@@ -24,6 +24,7 @@ info:
HOME: "[TEST_HOME]"
LANG: C
LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
NO_COLOR: ""
OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
@@ -39,9 +40,11 @@ info:
WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
WORKTRUNK_TEST_BASH_INSTALLED: "0"
WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
WORKTRUNK_TEST_EPOCH: "1735776000"
WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
WORKTRUNK_TEST_NUSHELL_ENV: "0"
WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
@@ -56,5 +59,5 @@ exit_code: 0
----- stderr -----
✓ Pruned stale worktree & removed branch stale-branch (same commit as main, _)
-○ Skipped young-branch (younger than 1h)
+○ Skipped young-branch (younger than 1d)
✓ Pruned 1 branch