kmcp-dev-git-index-repair
Installation
SKILL.md
Git worktree index and commit repair
Repository: kairos-mcp. Skill index: .agents/skills/README.md.
Hook authority: .husky/pre-commit (always re-read before automating).
When to use
error: invalid object …error: Error building trees- Failure after a long
pre-commit(for examplenpm run lint) git write-treefails while staging looks plausible
Root cause
The index references a blob OID not present in this repo’s object database. Worktrees share one .git/objects store with the main repo; corruption or GC there affects every worktree.
Common phantom-entry sources: