-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Description
Problem
The entire hooks claude-code stop hook takes ~63 seconds in a repo with git LFS files. The time is almost entirely CPU-bound (56s user time), spent hashing/staging files for the shadow branch commit.
Environment
- Entire CLI 0.4.5 (a92c0d0)
- macOS, Apple Silicon (darwin/arm64)
- Git repo with 874 files, 509 of which are LFS-tracked (
.dwg,.pdf,.tif,.kmz,.zip,.bin,.gpkg, etc.) .git/lfsdirectory is ~11GB- Strategy:
manual-commit
Reproduction
# Normal git operations are fast (33ms) because they use LFS pointer files
time git status # 0.033s
# But the stop hook takes over a minute
echo '{"transcript_path":"/tmp/transcript.json"}' | time entire hooks claude-code stop
# 56.30s user 3.32s system 94% cpu 1:02.90 totalRoot Cause
The shadow branch commit stages and hashes the entire working tree — all 874 files including all LFS-tracked binaries. The git object hashing of large binary files (satellite imagery PNGs up to 15MB, DWG files, shapefiles, etc.) accounts for nearly all of the 56 seconds of CPU time.
Normal git operations stay fast because they work with tiny LFS pointer files, but the shadow branch commit appears to process actual file contents.
Suggested Fixes
- Skip LFS-tracked files in shadow branch commits (or only commit pointer files)
- Support
.entireignoreto let users exclude large binary directories - Incremental staging — only
git addfiles that actually changed during the session, rather than re-staging everything
.gitattributes
*.dwg filter=lfs diff=lfs merge=lfs -text
*.kmz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.tif filter=lfs diff=lfs merge=lfs -text
*.mms filter=lfs diff=lfs merge=lfs -text
*.dxf filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.gpkg filter=lfs diff=lfs merge=lfs -text
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels