#6303·git-lfs

Git LFS filter-process continuously fills .git/lfs/tmp with hundreds of gigabytes of temporary files

Author: xavdev1Created Jul 10, 2026Updated Aug 16, 2026
Labelsmcve-required

Describe the bug Git LFS continuously creates large temporary files inside .git/lfs/tmp without an intentional Git LFS download, fetch, checkout, add, commit, push, or pull operation.

The temporary directory initially grew to approximately 265 GB with around 850 files and completely filled my C: drive. After deleting the files and stopping git.exe and git-lfs.exe, the files began regenerating.

During a later inspection, the directory had regenerated 118 files totalling 53,428,017,152 bytes. New files appeared every few seconds.

A minimal standalone reproduction is not yet available, but the issue repeatedly occurs in the affected repository:

To Reproduce

  1. The repository contains large untracked .safetensors files under model/Qwen3-4B.
  2. A nested .gitattributes file assigns filter=lfs to *.safetensors.
  3. Leave the repository open in the development environment without intentionally running a Git LFS operation.
  4. Observe git-lfs.exe running and .git/lfs/tmp continuously growing.
  5. Stop Git LFS and delete the temporary files.
  6. Observe the files being recreated and the directory growing again.

Expected behavior Git LFS temporary files should be removed after an operation completes or is cancelled. The temporary directory should not continuously grow until the drive runs out of space.

If another application repeatedly invokes git-lfs filter-process, cancelled or incomplete operations should not leave hundreds of gigabytes of temporary files behind.

System environment Operating system: Windows 11 Home 25H2 Build: 26200.8655 Architecture: x64 Git: git version 2.51.0.windows.1 Git LFS: git-lfs/3.7.0 (GitHub; windows amd64; go 1.24.4; git 92dddf56) Local repository: C:\XavAi Environment: Local Windows workspace; no container, CI, or Cygwin WSL: Enabled with default version 2, but no Linux distributions are installed or running. The repository and Git LFS processes are running natively on Windows. Proxy/VPN: None in use. Antivirus/firewall: Windows default configuration with no known custom rules affecting Git LFS.

Output of git lfs env

bash
git-lfs/3.7.0 (GitHub; windows amd64; go 1.24.4; git 92dddf56)
git version 2.51.0.windows.1
Endpoint=https://github.com/<redacted>/<redacted>.git/info/lfs (auth=none)
LocalWorkingDir=C:\XavAi
LocalGitDir=C:\XavAi\.git
LocalGitStorageDir=C:\XavAi\.git
LocalMediaDir=C:\XavAi\.git\lfs\objects
LocalReferenceDirs=
TempDir=C:\XavAi\.git\lfs\tmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneVerifyUnreachableAlways=false
PruneRemoteName=origin
LfsStorageDir=C:\XavAi\.git\lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_CONFIG_COUNT=1
GIT_CONFIG_KEY_0=safe.directory
GIT_CONFIG_VALUE_0=C:\XavAi
GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-core
GIT_PAGER=more.com
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"

Additional context The .safetensors model files appear to be untracked, and a nested model/Qwen3-4B/.gitattributes file assigns them the LFS filter

At one point, 299 temporary files totaling 93,839,502,336 bytes were removed. The behavior subsequently returned.

A persistent git-lfs.exe process was observed while files were being generated. There was no server-side error and no intentional push or pull operation, so transfer trace output is not currently available.

It is currently unclear whether this is caused by Git LFS clean-up behaviour or an external application repeatedly invoking the LFS clean filter.

Image Image Image Image