# Recover From Stale Git Locks

> Diagnose and recover from stale git lock files caused by crashed background processes

- Skill: `vamseeachanta/recover-from-stale-git-locks` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/recover-from-stale-git-locks`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/recover-from-stale-git-locks/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/recover-from-stale-git-locks

---


# Recover from Stale Git Locks

When git operations fail with `.git/index.lock` errors, the lock file may persist after a crash. Check if any git process is actually running with `ps aux | grep git`. If none exist, safely remove the stale lock file with `rm .git/index.lock`, then retry the operation. For submodules or nested repos, check and clean locks in each `.git` directory. Always verify the background process completed before proceeding.
