Repository navigation
Conversation
…d reason templates/hooks/post-tool.sh no longer runs npx prettier. It resolves the edited file's repo root and only runs node_modules/.bin/prettier when that binary exists; otherwise it logs SKIP_FORMAT (no local prettier) instead of downloading an unpinned package from the registry. Entire-Checkpoint: 6a2a1a847502
Entire-Checkpoint: 9eddacd91b1c
12 tasks
…s-post-tool-hook-downloads-and-runs-the-la
This was referenced Oct 1, 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.
Closes #1264.
What changed
templates/hooks/post-tool.shno longer runsnpx prettier. For a.ts/.tsx/.js/.jsx/.jsonedit, it resolves the edited file's repo root (git -C "$(dirname "$FILE_PATH")" rev-parse --show-toplevel). It runs$ROOT/node_modules/.bin/prettieronly when that file is executable; otherwise it logsSKIP_FORMAT (no local prettier): <file>..claude/hooks/post-tool.shwas regenerated withnpm run sync:hooks.__tests__/post-tool-format.integration.test.tsruns the real hook against temp git repos withnpm_config_cachepointed at an empty dir:node_modules/.bin/prettier: the stub runs, including for a nested file.AC
grep -nE '\b(npx|bunx|pnpm dlx|yarn dlx|uvx)\b' templates/hooks/post-tool.shmatches 0 lines.hook-sync.test.tspasses;.claude/hooks/post-tool.shis byte-identical to the template.Mutation-verified: AC-2 — restored
npx prettier --writeas the formatter in templates/hooks/post-tool.sh; tests/post-tool-format.integration.test.ts > post-tool.sh auto-format (#1264) > skips formatting and logs the reason when no local prettier exists failed; restored.Both cases failed under the mutant: the no-prettier case because npm's cache was no longer empty, and the stub case because the stub never ran.
Verification
npx vitest run __tests__/post-tool-format.integration.test.ts src/lib/relay/__tests__/hook-sync.test.ts: 5/5 pass.init.codex.integration,hook-sync,pre-tool-hook.integration,relay-hook-env,integration/relay-hook.integration. 452/452 pass.sequant runexec phase hit the 30-minute no-progress watchdog while running it, so QA never ran. CI runs it.Known trade-offs
node_modulesrather than at the repo root, is now skipped.npxused to find those from the hook's cwd.hooks/post-tool.shstill hasnpx prettier. fix(plugin): ship a slim ./plugin folder — the repo-root plugin pulls ~700 MB of dev dependencies into every install and fails directory review limits #1265 regenerates the plugin's hooks fromtemplates/hooks/.🤖 Generated with Claude Code