Repository navigation
fix: stop hook errors in projects that do not have kenkeep installed - #153
Merged
Merged
Conversation
Codex now finds kenkeep-owned hook commands by path marker, the same as Claude and Cursor, so upgrades replace guarded and unguarded forms without duplicates. init warns when the root is the home directory, where .claude/settings.json is Claude Code's user-scope settings. Refs #152 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude, Codex and Cursor hook commands now run node only when the hook script exists, and exit 0 with no output otherwise, the same as Copilot. This removes the MODULE_NOT_FOUND trace in projects that have the registrations but not the scripts. Codex and Cursor wrap the guard in sh -c, because Codex runs hooks through $SHELL, which may not be POSIX, and Cursor does not document its shell. Fixes #152 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The init warning now names the required --harnesses option and does not claim Claude settings were written for other harnesses. The installation docs say that host configs committed by an older kenkeep still error until a maintainer runs init --upgrade. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🎉 This PR is included in version 1.20.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
What changed
Before this change, every Claude Code, Codex or Cursor event printed a "Cannot find module" stack trace in a project that has kenkeep's hook settings but not its hook scripts. That happens in three cases:
Now each hook first checks that its script exists. If the script is missing, the hook does nothing and prints nothing. If the script exists, the hook runs as before. Copilot hooks already worked this way.
Setup now prints a warning when you run it in your home directory, because settings there can apply to every project. Setup still finishes.
An upgrade replaces old kenkeep hook entries with the new form and keeps hooks you added yourself. The installation guide now says two things. Hooks stay quiet until a teammate runs setup. Hook settings that an older kenkeep committed still show the error until a maintainer runs the upgrade and commits the result.
Closes #152
How to test
kenkeep initfor Claude Code, Codex and Cursor. Start a session in one of them. Capture works as before, andkenkeep doctorpasses..ai/kenkeep/hooksfolder. Start a session again. No error appears.kenkeep doctorreports the missing scripts.kenkeep initagain.kenkeep doctorpasses again.kenkeep init --harnesses claudefrom it. A warning about the home directory appears, and setup finishes.