Stop wiring the version.gradle.kts Edit-block hook#700
Merged
Conversation
The `Edit|Write|MultiEdit -> protect-version-file.sh` PreToolUse hook blocked agents from editing `version.gradle.kts`, forcing all version changes through the `bump-version` skill. It was friction without protection: it blocked the Edit tool but left a Bash `sed` write open, so it never actually prevented editing — it just diverted agents onto a path that then needed a permission prompt, defeating the autonomy the skill exists to provide. The protections that matter are outcome-based and stay in place: the `Bash` gate (`publish-version-gate.sh`) still blocks a build/publish unless the branch is bumped above base, and CI's `checkVersionIncrement` still rejects an already-published version. Because `migrate` clobber-copies this template into every consumer's `.claude/settings.json`, dropping the entry here removes the block from all consumers on their next `./config/pull`. The companion change deletes `protect-version-file.sh` from the shared `agents` repo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
version.gradle.kts Edit-block hook
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the config repository’s Claude settings template to stop invoking the version-file protection hook on edit/write operations, relying instead on the existing publish/version gates to enforce correct versioning outcomes across consumer repositories.
Changes:
- Removed the
PreToolUsehook that ranprotect-version-file.shforEdit|Write|MultiEditin.claude/settings.json. - Kept the existing Bash pre-PR/publish gates and the PostToolUse sanitization/copyright hooks unchanged.
Comments suppressed due to low confidence (1)
.claude/settings.json:70
- The PR description calls
protect-version-file.sh“now-unreferenced”, but this repo still wires it via.codex/hooks.json(PreToolUseapply_patch|Edit|Write). After the companionagentschange deletes the script, Codex hook execution will reference a missing file (at least causing stderr / hook failure) even though.claude/settings.jsonno longer does. Consider removing the protect-version hook from.codex/hooks.jsonas part of this rollout (or explicitly scoping the PR description/rollout to Claude-only settings).
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
armiol
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the
Edit|Write|MultiEdit → protect-version-file.shPreToolUseentry from the.claude/settings.jsontemplate. Becausemigrateclobber-copies this template into every consumer's.claude/settings.jsonon each./config/pull, dropping the entry here removes the block from all consumers on their next pull — no per-repo edits needed.The
Bashpublish gate (pre-pr-gate.sh,publish-version-gate.sh), thePostToolUsehooks (sanitize-source-code.sh,update-copyright.sh), and theSessionStartinit-submoduleshook are all left intact.Why
The hook blocked agents from editing
version.gradle.kts, forcing all version changes through thebump-versionskill. It was friction without protection: it blocked theEdittool but left a Bashsedwrite open, so it never actually prevented editing — it just diverted agents onto a path that then needed a permission prompt, defeating the autonomy the skill exists to provide.The protections that matter are outcome-based and stay in place:
publish-version-gate.shstill blocks a build/publish unless the branch is bumped above base.checkVersionIncrementstill rejects an already-published version.Companion change
The shared
agentsrepo deletes the now-unreferenced script: SpineEventEngine/agents#21.Rollout
Merge this PR first: it removes the wiring everywhere on the next
./config/pull, and the script lingering unused in.agents/sharedis harmless. Then merge theagentsPR (deletes the script). Merging in the other order leaves a brief window where a consumer's settings reference a deleted script — a non-blocking stderr note on edits, not a real break.