Description
Currently ccnotify sends notifications for every bash command execution, causing significant notification fatigue. The current logic at notify.py:768 states "Notify for all Bash commands" which defeats the purpose of an intelligent notification system.
Context
- Project area: Core notification filtering logic in
src/ccnotify/notify.py:756-884
- Complexity assessment: 5/10 (moderate logic changes, path analysis needed)
- Current behavior: All bash commands trigger notifications
- Problem: Notification fatigue from routine operations like
ls, cat, pwd, echo, etc.
Technical Details
Affected files:
src/ccnotify/notify.py:756-884 - Main PreToolUse filtering logic that needs modification
- Potentially config system for customizable command whitelist
Current filtering logic:
# Lines 762-863: Currently notifies for ALL bash commands
if tool_name == "Bash":
# Notify for all Bash commands <- THIS IS THE PROBLEM
Requirements
Core Approach: Minimal Whitelist + Path-Based Filtering
-
Minimal whitelist approach - Only truly dangerous commands should trigger notifications:
rm, sudo, chmod, chown, mv (file operations with potential for damage)
- Exclude routine commands:
ls, cat, pwd, echo, grep, find, git status, etc.
- Exclude even moderately risky but common commands:
cp, curl, wget, docker
-
Path-based filtering - Commands targeting files outside the current project directory should trigger notifications regardless of command type
-
Simplicity - Keep the logic straightforward and predictable
Implementation Steps
Acceptance Criteria
Testing Requirements
MUST complete local testing before any GitHub push:
- Test with typical Claude Code development sessions
- Verify dangerous commands still trigger notifications
- Verify routine commands are filtered out
- Test path-based filtering with commands targeting system files
- Measure notification volume reduction
Description
Currently ccnotify sends notifications for every bash command execution, causing significant notification fatigue. The current logic at
notify.py:768states "Notify for all Bash commands" which defeats the purpose of an intelligent notification system.Context
src/ccnotify/notify.py:756-884ls,cat,pwd,echo, etc.Technical Details
Affected files:
src/ccnotify/notify.py:756-884- Main PreToolUse filtering logic that needs modificationCurrent filtering logic:
Requirements
Core Approach: Minimal Whitelist + Path-Based Filtering
Minimal whitelist approach - Only truly dangerous commands should trigger notifications:
rm,sudo,chmod,chown,mv(file operations with potential for damage)ls,cat,pwd,echo,grep,find,git status, etc.cp,curl,wget,dockerPath-based filtering - Commands targeting files outside the current project directory should trigger notifications regardless of command type
Simplicity - Keep the logic straightforward and predictable
Implementation Steps
notify.py:762-863)Acceptance Criteria
rm,sudo,chmod,chown,mv) trigger notifications by defaultTesting Requirements
MUST complete local testing before any GitHub push: