[codex] Add executable agent hook augmentation#47
Draft
sameer2191 wants to merge 2 commits into
Draft
Conversation
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
Adds real executable RepoLens agent hook support for hook-capable coding agents:
agent-hook/hook-augmentCLI entrypoint that reads hook payload JSON from stdinhookSpecificOutput.additionalContextrendering--with-querygraph metadata augmentation, with the default path avoiding local graph DB reads/writes.claude/settings.local.jsonPreToolUse hook install/update/uninstall underinstall-agents --with-hooks --agents claude, preserving unrelated Claude hooks/settingsWhy
The reference repo exposes executable pre-tool hook behavior, while RepoLens previously generated reminder files only. This closes that practical integration gap and makes
install-agents --with-hooksuseful for real agent workflows without making hooks blocking or surprising by default.Security and behavior notes
--with-query.$(), backtick, semicolon, newline, and DB-path metacharacter expansion.commandplusargs, avoiding shell tokenization in installed hook settings.Validation
npm run buildnode --test --experimental-sqlite dist/tests/agent-hooks.test.js dist/tests/agent-setup.test.js-> 16 focused tests passingnpm run verify-> 73 tests, 72 passing, 1 documented dashboard socket skipnpm run test:skip-gatenpm run package:check-> 92 files inspectednpm pack --dry-run --json-> 200,896 bytes packed, 1,029,092 bytes unpacked, 92 entriesnpm run audit:prod-> 0 vulnerabilitiesgit diff --checkhook-augment --claude, opt-in--with-query, and skipped Read payload