[Bug] Race condition with git index.lock during lint-staged pre-commit failures
Resolved 💬 2 comments Opened Feb 26, 2026 by therockstorm Closed Feb 26, 2026
Bug Description
Summary of the problem: When lint-staged fails during a pre-commit hook, it takes a moment to clean up its index.lock. Claude Code sees the failure, immediately retries (sometimes bypassing hooks), and hits the lock file in that brief cleanup window. By the time it tries to rm the lock, it's already gone.
Environment Info
- Platform: darwin
- Terminal: zed (happened in VS Code's integrated terminal too)
- Version: 2.1.58
- Feedback ID: 2cfba95b-ba0c-4fbe-9238-f46175171407
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗