(Had an agent checkout why my repos were so large and draft a request)
Automatically garbage-collect Copilot checkpoint refs when sessions are archived
Description
Copilot worktree sessions create large numbers of refs under refs/copilot/checkpoints/* and refs/copilot-preserved/*. These refs remain after sessions/worktrees are archived, preventing Git garbage collection and consuming significant disk space.
Please automatically clean up a session’s internal Git refs when that session is archived.
Expected behavior
-
Preserve refs for active sessions and worktrees.
-
On archive, retain only the minimum snapshot needed to restore the session, or remove all internal refs if restoration does not require them.
-
Remove obsolete refs/copilot/checkpoints/<session-id>/* and related preserved refs.
-
Prune stale worktree metadata.
-
Run deferred Git maintenance (reflog expire and git gc) when safe.
-
Never delete user branches, remote refs, commits reachable from active sessions, or uncommitted work.
-
Provide a “Clean up archived session data” action for existing orphaned checkpoints.
Motivation
In my repositories, archived Copilot sessions left tens of thousands of checkpoint refs. They retained approximately 1.3 GB in one Android repository and 742 MB in an iOS repository even after local branches were deleted. Manual ref deletion and Git garbage collection were required to reclaim the space.
| Field |
Value |
| App version |
1.1.6 |
| OS |
macOS 26.5.2 |
| Theme |
Notionish |
| Path |
/chat |
| Tenure |
Week 6 |
(Had an agent checkout why my repos were so large and draft a request)
Automatically garbage-collect Copilot checkpoint refs when sessions are archived
Description
Copilot worktree sessions create large numbers of refs under
refs/copilot/checkpoints/*andrefs/copilot-preserved/*. These refs remain after sessions/worktrees are archived, preventing Git garbage collection and consuming significant disk space.Please automatically clean up a session’s internal Git refs when that session is archived.
Expected behavior
Preserve refs for active sessions and worktrees.
On archive, retain only the minimum snapshot needed to restore the session, or remove all internal refs if restoration does not require them.
Remove obsolete
refs/copilot/checkpoints/<session-id>/*and related preserved refs.Prune stale worktree metadata.
Run deferred Git maintenance (
reflog expireandgit gc) when safe.Never delete user branches, remote refs, commits reachable from active sessions, or uncommitted work.
Provide a “Clean up archived session data” action for existing orphaned checkpoints.
Motivation
In my repositories, archived Copilot sessions left tens of thousands of checkpoint refs. They retained approximately 1.3 GB in one Android repository and 742 MB in an iOS repository even after local branches were deleted. Manual ref deletion and Git garbage collection were required to reclaim the space.