/git-workflows:troubleshoot-precommitfrom git-workflows
Troubleshoot pre-commit hook failures and auto-fixes
Ships in git-workflows. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Diagnose and fix pre-commit hook issues that occur when committing code.
This error looks like:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
markdownlint-cli2........................................................Failed
- hook id: markdownlint-cli2
- files were modified by this hook
What happened: Pre-commit hooks auto-corrected formatting issues. The fixes weren't committed automatically.
Pre-commit hooks run BEFORE your commit. If they auto-fix files, your staged changes no longer match your working directory. Git stops to let you review the changes.
Stage the auto-fixed files and amend the commit:
git add -A
git commit --amend --no-edit
git push origin <branch>
If this happens during a rebase operation:
# In the worktree where the rebase is running:
git add -A # stage the hook changes
git commit --amend --no-edit # update the current commit in the rebase
git rebase --continue # continue the rebase
# After the rebase finishes:
git push origin <branch> # push the rebased branch
If hooks keep modifying files in a loop:
git diff # See what changed
git diff HEAD~1 # See what the hook is trying to fix
| Hook | Fixes |
|---|---|
trim-trailing-whitespace | Removes spaces at end of lines |
end-of-file-fixer | Ensures files end with newline |
markdownlint-cli2 | Fixes markdown formatting |
prettier | Reformats code/JSON/YAML |
eslint with --fix | Fixes JavaScript/TypeScript issues |
git commit --no-verify to skip hooksWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jacobpevans-ai/claude-code-plugins --plugin git-workflows5 skills in this plugin
/git-workflow-standardsUse for branch hygiene, merge conflict resolution, and worktree cleanup./pre-commit-architectureUse when adding/editing .pre-commit-config.yaml, wiring pre-commit hooks into a repo, or scaffolding a new repo's lint/hook setup. Covers the canonical nix-devenv/dryvist-.github architecture, profiles, and consumer patterns./troubleshoot-rebaseDiagnose and recover from git rebase failures