Git Commit
Create well-organized git commits for all staged and unstaged changes. NEVER push.
Process
-
Run lint/format first using this priority:
a. Local CLAUDE.md - Check for
pre-commit-command:in repo's CLAUDE.mdpre-commit-command: make lintb. Task runners - Check for and use if available:
make lintormake format(check Makefile for targets)npm run lintornpm run format(check package.json scripts)yarn lint/pnpm lint
c. Pre-commit - If
.pre-commit-config.yamlexists:pre-commit run --all-filesd. Direct tools (fallback) - Run if config exists: | Config file | Command | |-------------|---------| |
pyproject.tomlwith ruff |ruff check --fix . && ruff format .| |.eslintrc*oreslint.config.*|npx eslint --fix .| |.prettierrc*orprettier.config.*|npx prettier --write .| |.djlintrcor pyproject with djlint |djlint --reformat .| |biome.json|npx biome check --apply .| -
Stage any auto-fixed files before proceeding
-
Understand all changes
- Run
git status(never use-uallflag) - Run
git diffto understand modifications
- Run
-
Group related changes into logical commits (by feature, fix, or concern)
-
For each group:
- Stage the relevant files with
git add <files> - Commit with conventional commit format:
type(scope?): description - Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
- Stage the relevant files with
-
Show summary of commits created
Rules
- Keep commits atomic - one logical change per commit
- Write clear, concise commit messages (imperative mood)
- Include scope when it adds clarity (e.g.,
feat(chat):,fix(docker):) - NEVER run
git push- only stage and commit locally - If unsure how to group changes, ask the user
- If lint/format fails after auto-fix, re-stage and retry
Known issues
macOS sandbox noise: You may see errors like zsh:1: operation not permitted: /tmp/claude-501/cwd-*. These are harmless - commands still execute correctly. This is a known Claude Code bug (see GitHub issues #22109, #21654). Ignore these warnings.
Example output
Created 3 commits:
a1b2c3d feat(auth): add login endpoint
d4e5f6g fix(api): handle null response
g7h8i9j docs: update README with setup instructions