Repository navigation
feat(scan): offer a worktree still on main after one idle day - #92
Merged
Merged
Conversation
A checkout still on a default-branch commit, with no pull request for its branch, holds nothing the default branch lacks. It now waits one idle day instead of the full --stale-days window, so worktrees agents cut and never used stop piling up for a week. Any pull request, open or closed, keeps the full window, and a lower --stale-days still wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXatHLEwwQDashiEwr9ASp
Review found two holes in keying the shorter window on an empty PR list: the per-repo lookup returns every PR in the repository, so a busy repo never had an empty list, and a missing or logged-out gh also reads as an empty list, so a branch with an open PR could look unused. A clean checkout whose HEAD is on the default branch holds nothing to lose whatever its PRs say, so containment alone decides it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXatHLEwwQDashiEwr9ASp
Deploying keeper with
|
| Latest commit: |
1a5ad82
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ba96014f.keeper-9oy.pages.dev |
| Branch Preview URL: | https://cb-unused-branch-window.keeper-9oy.pages.dev |
Contributor
|
Merged as 81cad47. |
This was referenced Nov 19, 2026
merge-loop Bot
pushed a commit
that referenced
this pull request
Nov 19, 2026
Releases the two worktree changes on main: #92 (a worktree still on main is offered after 1 idle day) and #93 (a clean worktree whose commits are all on a remote is low risk). Also corrects the #92 changelog line, which said an open PR still blocks; #93 changed that. Verification: `bun run gate` passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KXatHLEwwQDashiEwr9ASp --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
flowchart LR W[clean worktree] --> M{merged PR proof?} M -- yes --> O[offered now] M -- no --> C{HEAD on the default branch?} C -- yes --> D1[wait 1 idle day] C -- no --> D7[wait --stale-days, 7 by default]Why
Agents cut many
cb/worktrees from main that they never commit to. These hold nothing main lacks, but each one waited the full 7-day window. On the machine this came from, 47 of 72 nebula worktrees were waiting on it, 30 of them branches still on a main commit.What changed
inspectWorktree: a checkout whose HEAD is contained in the default branch waitsmin(--stale-days, 1)idle days instead of--stale-days. Merged-PR proof still outruns the window.ghalso reads as an empty list. Containment alone is the safety property: a clean checkout on a default-branch commit has no work of its own to lose.Verification
bun run gate: 138 pass, 0 fail.Risk
A worktree cut from main, left clean and untouched for a full day with no hold, becomes low risk and the hourly run removes it. An agent returning to one should
keeper holdit, as the skill already says.🤖 Generated with Claude Code
https://claude.ai/code/session_01KXatHLEwwQDashiEwr9ASp