Skip to content

Bug: agit cleanup does not prune stale worktrees detected by agit status #3

Description

@Fato07

Description

agit status correctly detects stale worktrees (where the directory has been removed) and displays:

NOTICE: 2 worktree(s) marked stale (directory removed)

However, running agit cleanup immediately after reports "Nothing to clean up" — it does not remove the stale DB entries.

Steps to Reproduce

  1. agit spawn myrepo --agent test --branch feat/test
  2. rm -rf /path/to/repo/.worktrees/agit-<id>
  3. agit status → shows "N worktree(s) marked stale (directory removed)" ✅
  4. agit cleanup → "Nothing to clean up" ❌

Expected Behavior

agit cleanup should prune stale worktree entries from the database when their directories no longer exist on disk.

Environment

  • agit version: 0.1.1
  • OS: Linux (Ubuntu 22.04)
  • Arch: amd64

Activity

  1. Fato07 commented on Feb 20, 2026

    @Fato07
    OwnerAuthor

    @claude wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions