Large File Committed Exceeds GitHub (2026)
The Error
remote: error: File data/training-set.csv is 142.50 MB; this exceeds GitHub's
file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage.
To github.com:user/repo.git
! [remote rejected] main -> main (pre-receive hook declined)
This appears when Claude Code commits a large file (over 100MB) and you push to GitHub, which rejects files exceeding its size limit.
The Fix
git filter-repo --path data/training-set.csv --invert-paths
- Install
git-filter-repoif needed:brew install git-filter-repo. - Remove the large file from the entire git history.
- Add the file to
.gitignoreto prevent re-committing. - Force push to update the remote:
git push --force-with-lease.
Why This Happens
Claude Code does not check file sizes before committing. When it processes data files, generates database dumps, or creates test fixtures, it may produce files well over 100MB. These get committed normally to the local repository, but GitHub’s pre-receive hook rejects the push. The file is now embedded in git history, so simply deleting it and committing again does not help — the blob remains in previous commits.
If That Doesn’t Work
If git-filter-repo is not available, use BFG Repo Cleaner:
brew install bfg
bfg --strip-blobs-bigger-than 100M
git reflog expire --expire=now --all
git gc --prune=now --aggressive
git push --force-with-lease
Set up Git LFS for legitimate large files:
git lfs install
git lfs track "*.csv" "*.sqlite" "*.bin"
git add .gitattributes
git commit -m "Track large files with LFS"
If the commit was recent, use interactive reset:
git reset HEAD~1
git add --all -- ':!data/training-set.csv'
git commit -m "Commit without large file"
Prevention
# CLAUDE.md rule
Never commit files larger than 50MB. Add *.csv, *.sqlite, *.bin, *.tar.gz to .gitignore. For legitimate large files, use Git LFS. Always check file size before staging.
See Also
- .env File Not Loaded by Claude Fix
- Large File Read Memory Spike Fix
- Declaration File .d.ts Missing Error — Fix (2026)
- Claude Code Concurrent Sessions 5/5 — Fix (2026)
- Claude Code Subagent Spawn Limit Reached — Fix (2026)
Frequently Asked Questions
Does this error affect all operating systems?
This error can occur on macOS, Linux, and Windows (WSL). The exact error message may differ slightly between platforms, but the root cause and fix are the same. macOS users may see additional Gatekeeper or notarization prompts. Linux users should check that the relevant system packages are installed. Windows users should ensure they are running inside WSL2, not native Windows.
Will this error come back after updating Claude Code?
Updates can occasionally reintroduce this error if the update changes default configurations or dependency requirements. After updating Claude Code, verify your project still builds and runs correctly. If the error returns, reapply the fix and check the changelog for breaking changes.
Can this error cause data loss?
No, this error occurs before or during an operation and does not corrupt existing files. Claude Code’s edit operations are atomic — they either complete fully or not at all. However, if the error occurs during a multi-step operation, you may have partial changes that need to be reviewed with git diff before continuing.
How do I report this error to Anthropic if the fix does not work?
Open an issue at github.com/anthropics/claude-code with: (1) the full error message including stack trace, (2) your Node.js version (node --version), (3) your Claude Code version (claude --version), (4) your operating system and version, and (5) the command or operation that triggered the error.
Related Error Messages
This fix also applies if you see variations of this error:
- Connection or process errors with similar root causes in the same subsystem
- Timeout variants where the operation starts but does not complete
- Permission variants where access is denied to the same resource
- Configuration variants where the same setting is missing or malformed
If your specific error message differs slightly from the one shown above, the fix is likely the same. The key indicator is the operation that failed (shown in the stack trace) rather than the exact wording of the message.
Related Guides
Try it: Paste your error into our Error Diagnostic for an instant fix.