chore(claude): pick up the newer global hook changes - #350
Merged
Conversation
#347 landed the same hook merge this branch carried (compound-bash-allow.py, redirect-inline-eval.py, compound-bash.json, the README line, and the plain worktree-remove rule), and did the hook better: "}" handled explicitly ahead of _KW_BARE_RE with the reasoning about why "\b" cannot fire after a non-word character, _REDIR_TAIL_RE reused instead of a second near-identical regex, and the config lookup order documented in the docstring. Those are dropped here in favour of main. What is left is the part #347 did not cover: settings.template.json collapse the four "git rebase --abort/--continue/--quit/--skip" rules into "git rebase *"; add "git tag" reads, the "git -C" worktree-remove forms to match the plain one #347 added, and docs.rs, which pairs with the cargo block and rust-analyzer plugin the template already ships. bash-composition.md document the stdin-eval denial that redirect-inline-eval.py now enforces. The global CLAUDE.md predates that hook change and does not mention it, so the vendored rule otherwise ships a hook its own docs contradict. Skipped as personal: docs.polkadot.com, paritytech.github.io, effortLevel. Verified: deploy renders valid JSON with every new rule expanded and no leftover placeholders. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
m2ux
force-pushed
the
chore/vendored-claude-baseline-followup
branch
from
July 29, 2026 14:20
1e7a5df to
ad7b9a1
Compare
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.
Follow-up to #344. The global Claude config moved again while that PR was open —
compound-bash-allow.py,redirect-inline-eval.py, a newcompound-bash.json, and several more settings rules. #344 merged before these landed, so they are here.The interesting part:
compound-bash-allow.pyis a merge, not a copyThe global copy is on a line of development that never received cd7bf3b, the commit that rewrote keyword handling in this tree. It has since gained subshell and brace-group unwrapping. So each side had something the other lacked:
[[as a safe binaryforheadersdone < input,break 2( … )unwrapping{ …; }Copying "latest global" over this file would have regressed the first three rows. What landed instead:
strip_group_wrapper(),_iter_unquoted(),_TRAILING_REDIR, the group branch inis_segment_allowed(), andgroup-unwrappedin the single-command normalization list.shlex.split→shlex.quoteround-trip before rule matching; that requoting can quote a glob (*.txt) that a rule needs to match against.{as a prefix keyword,}as a bare one that may carry redirections ({ …; } > log).Other changes
scripts/claude/hooks/redirect-inline-eval.py— straight forward port. Now also denies an interpreter reading its program from stdin:python3 - <<'EOF', barepython3 <<'EOF',cat x.py | node,deno run -. Inline eval by another spelling.scripts/claude/hooks/compound-bash.json— new file; the loader already looked for it. Vendors the generic read-only additions (strings,diff,cmp,od,comm,join,sha256sum,md5sum). Added to the README layout.examples/cursor-workspace/.claude/settings.template.json— collapse the fourgit rebase --abort/--continue/--quit/--skiprules intogit rebase *; addgit tagreads, worktree-remove under the projects root (plain andgit -Cforms), anddocs.rs, which pairs with the cargo block and rust-analyzer plugin the template already ships.Skipped as personal:
docs.polkadot.com,paritytech.github.io,effortLevel.examples/cursor-workspace/.claude/rules/bash-composition.md— document the stdin-eval denial. The global CLAUDE.md predates that hook change and does not mention it, so the vendored rule would otherwise ship a hook whose behaviour its own docs contradict.Verification
compound-bash-allow.pycases — keyword machinery preserved (forheaders incl. the arithmetic form,while,done <,break 2,[[), group unwrapping working (subshell fallback, subshell with trailing redirection, brace groups plain and redirected), deny paths still rejecting (rm -rf /under a keyword, inside a subshell, andchmodin a group body), andcompound-bash.jsonextras taking effect.redirect-inline-eval.pycases — all four stdin spellings denied plus-c;--version/-vprobes, file arguments,deno run <file>, and already-sbx-prefixed commands all passing through.--dry-runskips the settings render, so it does not exercise the template. Renders valid JSON, no leftover placeholders, all hooks including the newcompound-bash.jsoninstalled.Re-ran against current
mainafter rebasing off the merged #344.Follow-up (not in this PR)
The global
compound-bash-allow.pyis missing cd7bf3b and this merge. Worth syncing that direction too, or the same divergence recurs on the next pass.🤖 Generated with Claude Code