/const-task-close:commit-before-editfrom const-task-close
Load this skill first, before the first edit of any change, such as a rename, a refactor or an edit of more than one file, and when a change is done — every time, whether or not the tree seems clean. Commit before you edit: commit a dirty tree before the first edit of any change, commit again after each coherent change, never end a turn with uncommitted work. Use when a turn is ending, when the turn-end hook reports a dirty tree, or when rolling back to an earlier state. Advisory: the hook only reports the tree.
Ships in const-task-close. 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.
Rollback points live in git, not in the chat's rewind. The rewind restores what the model wrote through its file tools and nothing else. An edit made through the shell, a script, a heredoc or a subagent stays. A rewind past it leaves a tree that matches no message. Work not committed did not happen: it can be lost by the next edit, the next session, or the next rewind. So git is the rollback layer, and a commit is the rollback point.
What is checked and what is not. This plugin's turn-end hook runs git status --porcelain in the
session's repository when a turn ends. It reports a dirty tree — any tracked change or untracked
file git does not ignore — once per turn. Under severity: block the model is asked to commit and
the turn continues once. Under warn the user is shown the notice. The second stop of a turn always
lets it end. While a subagent, a teammate or a workflow of the session still runs, the report
waits for the first turn end with none running. The hook cannot tell that agent's files from
yours, so commit your own work all the same. Whether a commit is coherent, and what its message says: yours.
git add -A && git commit -m '<what is here and why>'
git revert <commit> for a change that landed; git checkout <commit> -- <path> or
git stash for the working tree. Name the commit you are going back to; the chat's rewind is not a
rollback and is never relied on as one.
A scratch directory git ignores is invisible to the hook and is where trial files belong until the task closes. A tracked scratch file is a working file, deleted at close.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub evgenus/claude-constitution-layer-kit --plugin const-task-close2 skills in this plugin