refactor: replace external hook scripts with native 'rtk hook claude' command#785
Draft
romansl wants to merge 4 commits intortk-ai:developfrom
Draft
refactor: replace external hook scripts with native 'rtk hook claude' command#785romansl wants to merge 4 commits intortk-ai:developfrom
romansl wants to merge 4 commits intortk-ai:developfrom
Conversation
… command
BREAKING CHANGE: External hook scripts (hooks/rtk-rewrite.{sh,py}) are no
longer installed or used. Existing hook files can be safely deleted.
- Add native 'rtk hook claude' command that reads/writes JSON directly
- Remove hooks/rtk-rewrite.sh embedded script (no longer needed)
- Update init.rs: install hook via 'rtk hook claude' instead of script files
- Update hook_check.rs: native hook is always available (no file checks)
- Remove dead code: prepare_hook_paths(), ensure_hook_installed()
- Add cross-platform support (works identically on Windows, macOS, Linux)
Benefits:
- No external dependencies (Python, bash, jq)
- Faster: no fork/exec subprocess overhead
- Simpler installation: just 'rtk init -g', no script files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove external hook script checks (.sh/.py) from show_claude_config - Remove integrity checks for deprecated hook scripts - Check native hook via settings.json with "rtk hook claude" command - Update hook_check test to reflect native hook behavior (always Ok) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove functions and tests that were checking for legacy .sh/.py hook files, which are no longer used after switching to native 'rtk hook claude' command. - Remove hook_installed_path() (checked for .sh/.py files) - Remove parse_hook_version() (parsed version from hook scripts) - Remove CURRENT_HOOK_VERSION constant - Remove 6 tests for parse_hook_version() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Python hooks were only in local development branch, not in upstream. Remove .py extension logic, keep only .sh for legacy cleanup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
📊 Automated PR Analysis
SummaryReplaces the external bash hook script (hooks/rtk-rewrite.sh) with a native 'rtk hook claude' command built into the Rust binary. This eliminates dependencies on bash and jq, removes file-based hook installation/version checking, and simplifies the setup to just 'rtk init -g' across all platforms. Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
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.
BREAKING CHANGE: External hook scripts (hooks/rtk-rewrite.sh) are no longer installed or used. Existing hook files can be safely deleted.
Benefits:
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com