feat(hooks): Add PostToolUse hooks for intelligent logging prompts#4
Merged
albertnahas merged 1 commit intoalbertnahas:mainfrom Jan 9, 2026
Merged
Conversation
Add new hooks that provide contextual aissist command suggestions: - prompt-hints.sh: Enhanced UserPromptSubmit hook with datetime + keyword detection. Suggests /aissist:recall, /aissist:chat, /aissist:todo, or /aissist:report based on user prompt content. - post-edit.sh: PostToolUse hook for Edit/Write tools. Reminds to log work after file modifications. - post-bash.sh: PostToolUse hook for Bash tool. Detects git commits, test runs, builds, and deployments to suggest logging. Improvements based on code review: - Added jq dependency checks with graceful fallbacks - Used here-strings (<<<) instead of echo for safer variable handling - Added word boundaries (\b) to regex patterns to reduce false positives - Used grep -i for case-insensitive matching instead of tr - Added .tool_input.target fallback for different tool implementations Updated settings.json with PostToolUse matchers for Edit|Write and Bash. Updated README with comprehensive hooks documentation. The add-datetime.sh is kept for backward compatibility but prompt-hints.sh is now the default UserPromptSubmit handler. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
albertnahas
approved these changes
Jan 9, 2026
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
Add new hooks that provide contextual aissist command suggestions at the right moments:
UserPromptSubmithook with datetime + keyword detectionPostToolUsehook for Edit/Write tools - reminds to log after file modificationsPostToolUsehook for Bash - detects git commits, test runs, builds, and deploymentsFeatures
Keyword Detection (prompt-hints.sh)
/aissist:recall/aissist:chat/aissist:todo/aissist:reportPost-Tool Reminders
File modified: auth.ts - consider /aissist:log if this completes a taskGit commit detected - use /aissist:log to record this workTests completed - consider /aissist:log if this concludes a taskCode Quality Improvements
Based on Gemini code review:
jqdependency checks with graceful fallbacks<<<) instead ofechofor safer variable handling\b) to regex patterns to reduce false positivesgrep -ifor case-insensitive matching instead oftrBackward Compatibility
add-datetime.shkept for users who may reference it directlyprompt-hints.shis now the defaultUserPromptSubmithandler (includes datetime)Test Plan
jqfallback works whenjqis not installed🤖 Generated with Claude Code