Skip to content

Remove empty per-ticket directories created in .autopr folder #12

@Neokil

Description

@Neokil

Problem

AutoPR creates a directory under .autopr/ for each ticket as part of its run setup, but these directories are left empty after the run. They serve no apparent purpose and accumulate over time, polluting the repository's working directory with noise that confuses developers inspecting .autopr/.

Solution

  1. Trace the code path that creates per-ticket directories (likely in the worktree or state initialization logic).
  2. If the directory is not needed: remove the creation call entirely.
  3. If it is needed temporarily during a run: defer creation until first use and add cleanup logic (analogous to how worktrees are cleaned up) to remove it once the run completes or fails.
  4. Add a test or assertion that no empty directories remain after a completed run.

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