Skip to content

[Bug]: Large unstaged files cause excessive disk usage #1845

Description

@nikolaloncar

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Start the app
  2. Open a git project folder
  3. Add a large unstaged file to the project
  4. Start a thread which generates many steps / checkpoints

Expected behavior

Unsure what the expected behaviour should be here given the current approach.

Option1: Removing unstaged files from the checkpoints will make it less robust but should address the disk space usage.

Option 2: Adding the large unstaged files to .gitignore means they are not coming up in the suggestions when referencing them in the chat using @ and cause readability issues for the agent.

Actual behavior

Disk usage increases rapidly depending on the number and size of the unstaged files.

Running git count-objects -vH is likely to show that size-pack is reasonable, but size-garbage is very large and increases over time as the number of checkpoints grows.

That pattern usually means an interrupted or failed Git operation left temporary packfiles behind, typically from git fetch, git gc, git repack, or clone/fetch maintenance.

Impact

Minor bug or occasional failure

Version or commit

No response

Environment

MacOS 26.3.1

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

Either running git gc --prune=now or manually deleting .git/objects/pack/tmp_pack_* brings the disk usage down, but does not stop it from re-growing. The delete should happen when no other git process if writing pack files. Running git fsck afterwards will confirm if the deletion left the repo in a valid state.

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Apr 8, 2026
  2. sallaberry commented on May 18, 2026

    @sallaberry

    I think I’m hitting the same underlying bug as #1845, but with a different repro on Linux desktop.

    Environment:

    • Linux

    What I observed:

    • T3 Code was repeatedly spawning:
      • git --git-dir /home/michel/www/anon/.git fetch --quiet --no-tags origin
      • git index-pack --stdin --fix-thin --keep=fetch-pack ...
    • During those background fetches, new tmp_pack_* files appeared in:
      • .git/objects/pack/
    • The disk kept filling even while the machine was otherwise idle.

    Impact:

    • The repository’s .git directory grew to about 182 GiB.
    • git count-objects -vH reported about 180 GiB of size-garbage.
    • My root filesystem dropped to only a few GiB free.
      Recovery:
    • Closing T3 Code stopped new tmp_pack_* files from appearing.
    • Deleting the orphaned tmp_pack_* files recovered the space immediately.
    • After cleanup, .git went back down to about 318 MiB and git count-objects -vH showed garbage: 0.

    Important detail:

    • This does not seem to require actively using the app once the repo is open.
    • In my case it looked tied to automatic background Git fetches rather than only large unstaged files/checkpoints.

    Possible workaround:

    • In desktop settings, Source Control -> Automatic Git fetch interval -> set to 0 seconds.
  3. RodrigoTR04 commented on Jun 4, 2026

    @RodrigoTR04

    Same problem here, but with no specific scenario where it happens, just opening the program and having it open will start burning disk writes for no reason.

    Environment:

    • Arch Linux

    Installation done via AUR with Maria's package.

  4. juliusmarminge commented on Jul 20, 2026

    @juliusmarminge
    Member

    Closing as a duplicate of #3525, which has the newer reproduction for the same temporary Git pack growth. The active fix is PR #3537; please carry this issue's large-unstaged-file repository shape into that PR's validation.

  5. added
    duplicateThis issue or pull request already exists
    and removed
    needs-triageIssue needs maintainer review and initial categorization.
    on Jul 20, 2026
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 is broken or behaving incorrectly.duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions