Skip to content

fix(#1264): the plugin's post-tool hook runs only the local prettier, never npx - #1274

Closed
admarble wants to merge 2 commits into
mainfrom
fix/1264-plugin-post-tool-prettier
Closed

admarble wants to merge 2 commits into
mainfrom
fix/1264-plugin-post-tool-prettier

Conversation

@admarble

@admarble admarble commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1264

What

#1267 fixed templates/hooks/post-tool.sh and .claude/hooks/post-tool.sh, but the plugin ships its own copy, hooks/post-tool.sh, wired in by hooks/hooks.json → ${CLAUDE_PLUGIN_ROOT}/hooks/post-tool.sh. That copy still ran npx prettier --write, so plugin installs (the main install path) didn't get the fix that 2.19.0's CHANGELOG describes.

The rest of hooks/post-tool.sh stays diverged from the template (it has no relay check and no coverage analysis). That's out of scope here. #1265 (slim ./plugin folder) changes how the plugin is packaged and is the natural place to settle a single source for the hook copies.

Verification

  • Test first: with the test extended and the hook unchanged (24a00cf), exactly the two hooks/post-tool.sh cases failed and the other four passed.
  • After the fix: 6/6 passed. Every test file naming post-tool passes (6 files, 458 tests). bash -n hooks/post-tool.sh is clean.

Mutation-verified: AC-1 — restored the pre-fix npx block in hooks/post-tool.sh; __tests__/post-tool-format.integration.test.ts > hooks/post-tool.sh auto-format (#1264) > skips formatting and logs the reason when no local prettier exists failed; restored.

🤖 Generated with Claude Code

@admarble

admarble commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing as redundant. #1265 (PR #1275) moved the plugin to plugin/ (marketplace source: ./plugin), and plugin/hooks/ is generated from templates/hooks/ by scripts/sync-hooks.sh. src/lib/relay/__tests__/hook-sync.test.ts fails on any drift. v2.19.0's plugin/hooks/post-tool.sh already runs only the local prettier. The root hooks/post-tool.sh this PR patched is no longer shipped and is due to be retired in the follow-up #1275 mentions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(hooks): post-tool hook downloads and runs the latest prettier via npx in every project that doesn't have it

1 participant