# Transcript — Git hygiene for agentic software development

Text alternative for the planned explainer; narration timing awaits the recorded take.

## Finished tasks can slow down the next one

As agentic software development becomes more common, it puts new pressure on familiar tools like Git. Agents leave branches, checkouts and intermediate history behind. Without regular retirement, that state can consume disk and make cleanup compete with the next task for machine time.

## Cleanup itself can become the bottleneck

In one reported Assay incident, five cleanup sweeps each consumed CPU for eight to twelve minutes. They ran at once against about six hundred and fifty-seven worktrees. Repeated history reads and overlapping sweeps delayed new work. Those timings describe that incident.

## A merge finishes the change, not its cleanup

Here is how finished work stays around. An agent fixes a CSV export with commits C, D and E. A review worktree, another checkout sharing the history, points to E. Squashing puts the accepted change into S on main. The task branch and review checkout still retain the original commits.

## Deleting the branch removes one holder

Now remove the finished task branch. Its name disappears. The review checkout still points to E, so Git must keep the history it needs. Deleting a branch name does not mean deleting the commits behind it.

## Removing the checkout can leave recovery records

After the review evidence is saved and the session has ended, the checkout may be retired. But a reflog, Git’s local record of earlier positions, can keep those commits recoverable. That recovery window is useful when cleanup was a mistake.

## Storage stays occupied until retention ends

Removing both visible holders does not immediately free the stored history. When no other retention source needs it, and normal expiry permits it, garbage collection can reclaim unneeded commits and file contents. Main’s accepted change stays.

## Retire finished work and maintain its shared store

Retire finished branches and checkouts once their work and evidence are safe. Then maintain the shared Git store, with one owner for the job. Packing organizes storage, but tools that repeatedly read the same history also need their own fixes.

## Assay makes ownership and retirement explicit

Assay’s desk tools allocate tasks, prepare worktrees and report cleanup candidates with reasons for keeping them. They put ownership and retirement into the workflow. Check your installed version: merged fixes and work under review are not automatically available there.

## Measure what completed work costs your next task

Time repository setup and cleanup, and count branches, worktrees and stored objects. Follow one merged task to find what still retains it. Assign an owner and retirement condition, then inspect the cleanup plan. Measure again to see whether old work is still delaying new tasks.

Source for the reported cleanup incident: [Assay issue #1037](https://github.com/medici-finance/assay/issues/1037). The CSV-export walkthrough is illustrative.
