Simplify hook scripts: extract helpers, fix bugs, improve perf#38
Closed
aseembits93 wants to merge 1 commit intomainfrom
Closed
Simplify hook scripts: extract helpers, fix bugs, improve perf#38aseembits93 wants to merge 1 commit intomainfrom
aseembits93 wants to merge 1 commit intomainfrom
Conversation
- Extract emit_block() and append_auto_allow() helpers to eliminate 8+9 repeated code blocks in suggest-optimize.sh (-40 lines net) - Fix missing systemMessage field in Python API-key block output - Fix code_challenge_method=sha256 → S256 per RFC 7636 in oauth-login.sh - Merge two git log calls into one to avoid redundant DAG traversal - Consolidate two jq parses of hook input JSON into a single call - Defer settings.json auto-allow check past the HEAD gate so it's skipped on the most common exit path (no new commits) - Add fast node_modules/.bin/codeflash file check before slow npx fallback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
emit_block()andappend_auto_allow()helpers insuggest-optimize.shto replace 9 duplicated emit patterns and 8 duplicated auto-allow blocks (net -40 lines)systemMessagefield in the Python API-key-check block output (was inconsistent with all other outputs)code_challenge_method=sha256→S256inoauth-login.shper RFC 7636git logcalls into one — avoids redundant DAG traversal on every hook invocationjqparses of hook input JSON into a single callsettings.jsoncheck past the HEAD gate — skips unnecessary I/O on the most common exit path (no new commits)node_modules/.bin/codeflashfile check before falling back to slownpx codeflash --versionTest plan
S256parameter (if server was already acceptingsha256, confirm it also accepts the spec-correct value)🤖 Generated with Claude Code