Skip to content

Commit 54209d4

Browse files
committed
release 1.6.10
1 parent 7cd7c85 commit 54209d4

7 files changed

Lines changed: 129 additions & 19 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ Desktop notifications for AI coding tools - get alerts when tasks complete or in
1313
<img src="assets/multi-tools-support-02.png" width="48%" alt="All tools enabled"/>
1414
</p>
1515

16-
[![Version](https://img.shields.io/badge/version-1.6.9-blue.svg)](https://github.com/mylee04/code-notify/releases)
16+
[![Version](https://img.shields.io/badge/version-1.6.10-blue.svg)](https://github.com/mylee04/code-notify/releases)
1717
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
1818
[![macOS](https://img.shields.io/badge/macOS-supported-green.svg)](https://www.apple.com/macos)
1919
[![Linux](https://img.shields.io/badge/Linux-supported-green.svg)](https://www.linux.org/)
2020
[![Windows](https://img.shields.io/badge/Windows-supported-green.svg)](https://www.microsoft.com/windows)
2121

2222
---
2323

24-
## What's New in v1.6.9
24+
## What's New in v1.6.10
2525

26-
- **Legacy Claude hooks are repaired during supported upgrades**: stale `claude-notify`-style Claude configs are migrated to the current `code-notify` hook format when users update through the supported install paths
27-
- **Claude idle dedupe now survives upgrades from older installs**: users who were still on the old blank-matcher Claude hooks no longer bypass the repeated `idle_prompt` suppression after updating
28-
- **Codex notify integration now reads Codex payload JSON directly**: completion notifications use Codex's `notify` payload format, and the docs/status output now clearly call out Codex's current completion-focused behavior
26+
- **Windows stale Claude hooks are detected more reliably**: old `notify.ps1 notification` / `notify.ps1 stop` hook commands are now treated as legacy and repaired during supported upgrades
27+
- **Claude hook repair now follows alternate Windows settings paths**: if Claude stores settings under `~/.config/.claude/settings.json`, code-notify now repairs that file too instead of only checking `~/.claude/settings.json`
28+
- **Repeated generic notifications after Windows upgrades are less likely to survive**: older blank-matcher Claude hook layouts now get migrated to the current `idle_prompt`-based code-notify hook format more consistently
2929

3030
---
3131

@@ -60,7 +60,7 @@ cn update
6060
code-notify version
6161
```
6262

63-
If you were using the older `claude-notify` hook layout, supported upgrades now repair those Claude hooks automatically.
63+
If you were using the older `claude-notify` hook layout, supported upgrades now repair those Claude hooks automatically. On Windows, that repair also covers older `notify.ps1` hook layouts and alternate Claude settings locations such as `%USERPROFILE%\.config\.claude\settings.json`.
6464

6565
**Linux / WSL**
6666

bin/code-notify

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
set -e
77

88
# Version
9-
VERSION="1.6.9"
9+
VERSION="1.6.10"
1010

1111
# Determine the directory where the script is located (resolve symlinks)
1212
SCRIPT_PATH="${BASH_SOURCE[0]}"

docs/installation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ cn status
9494
After installation, these files are created:
9595

9696
- `~/.code-notify/` - Main installation directory
97-
- `~/.claude/settings.json` - Hook configuration (when enabled)
97+
- `~/.claude/settings.json` - Hook configuration on the default Claude Code path
98+
- `~/.config/.claude/settings.json` - Hook configuration on some Windows Claude Code setups
9899
- `~/.claude/notifications/voice-enabled` - Voice setting (if enabled)
99100

100101
### Uninstallation

lib/code-notify/core/config.sh

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,25 @@
33
# Configuration management for Code-Notify
44

55
# Default paths - Claude Code
6-
CLAUDE_HOME="${CLAUDE_HOME:-$HOME/.claude}"
7-
GLOBAL_SETTINGS_FILE="$CLAUDE_HOME/settings.json"
8-
GLOBAL_HOOKS_FILE="$CLAUDE_HOME/hooks.json" # Legacy support
9-
GLOBAL_HOOKS_DISABLED="$CLAUDE_HOME/hooks.json.disabled"
6+
DEFAULT_CLAUDE_HOME="$HOME/.claude"
7+
ALT_CLAUDE_SETTINGS_HOME="$HOME/.config/.claude"
8+
CLAUDE_HOME="${CLAUDE_HOME:-$DEFAULT_CLAUDE_HOME}"
9+
10+
if [[ -n "${CLAUDE_SETTINGS_HOME:-}" ]]; then
11+
RESOLVED_CLAUDE_SETTINGS_HOME="$CLAUDE_SETTINGS_HOME"
12+
elif [[ "$CLAUDE_HOME" != "$DEFAULT_CLAUDE_HOME" ]]; then
13+
RESOLVED_CLAUDE_SETTINGS_HOME="$CLAUDE_HOME"
14+
elif [[ -f "$DEFAULT_CLAUDE_HOME/settings.json" || -f "$DEFAULT_CLAUDE_HOME/hooks.json" ]]; then
15+
RESOLVED_CLAUDE_SETTINGS_HOME="$DEFAULT_CLAUDE_HOME"
16+
elif [[ -f "$ALT_CLAUDE_SETTINGS_HOME/settings.json" || -f "$ALT_CLAUDE_SETTINGS_HOME/hooks.json" ]]; then
17+
RESOLVED_CLAUDE_SETTINGS_HOME="$ALT_CLAUDE_SETTINGS_HOME"
18+
else
19+
RESOLVED_CLAUDE_SETTINGS_HOME="$DEFAULT_CLAUDE_HOME"
20+
fi
21+
22+
GLOBAL_SETTINGS_FILE="$RESOLVED_CLAUDE_SETTINGS_HOME/settings.json"
23+
GLOBAL_HOOKS_FILE="$RESOLVED_CLAUDE_SETTINGS_HOME/hooks.json" # Legacy support
24+
GLOBAL_HOOKS_DISABLED="$RESOLVED_CLAUDE_SETTINGS_HOME/hooks.json.disabled"
1025
CONFIG_DIR="$HOME/.config/code-notify"
1126
CONFIG_FILE="$CONFIG_DIR/config.json"
1227
BACKUP_DIR="$CONFIG_DIR/backups"
@@ -316,7 +331,9 @@ has_legacy_global_claude_hooks() {
316331

317332
grep -q 'claude-notify' "$file" ||
318333
grep -qE 'notifier\.sh (notification|stop)"' "$file" ||
319-
grep -q 'notifier.sh PreToolUse' "$file"
334+
grep -q 'notifier.sh PreToolUse' "$file" ||
335+
grep -qE 'notify\.ps1.* (notification|stop)"' "$file" ||
336+
grep -qE 'notify\.ps1.* PreToolUse' "$file"
320337
}
321338

322339
claude_global_hooks_need_repair() {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "code-notify",
3-
"version": "1.6.9",
3+
"version": "1.6.10",
44
"description": "Desktop notifications for Claude Code, OpenAI Codex, and Gemini CLI",
55
"license": "MIT",
66
"homepage": "https://github.com/mylee04/code-notify#readme",

scripts/install-windows.ps1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ param(
2020
$ErrorActionPreference = "Stop"
2121

2222
# Version
23-
$VERSION = "1.6.9"
23+
$VERSION = "1.6.10"
2424

2525
# Colors and formatting
2626
function Write-Success { param([string]$Message) Write-Host "[OK] $Message" -ForegroundColor Green }
@@ -106,9 +106,15 @@ function Install-ClaudeNotify {
106106
# Code-Notify PowerShell Module
107107
# https://github.com/mylee04/code-notify
108108
109-
$script:VERSION = "1.6.9"
110-
$script:ClaudeHome = "$env:USERPROFILE\.claude"
111-
$script:SettingsFile = "$script:ClaudeHome\settings.json"
109+
$script:VERSION = "1.6.10"
110+
$script:ClaudeHome = if ($env:CLAUDE_HOME) { $env:CLAUDE_HOME } else { "$env:USERPROFILE\.claude" }
111+
$script:DefaultSettingsFile = "$script:ClaudeHome\settings.json"
112+
$script:AlternateSettingsFile = "$env:USERPROFILE\.config\.claude\settings.json"
113+
$script:SettingsFile = if (-not $env:CLAUDE_HOME -and -not (Test-Path $script:DefaultSettingsFile) -and (Test-Path $script:AlternateSettingsFile)) {
114+
$script:AlternateSettingsFile
115+
} else {
116+
$script:DefaultSettingsFile
117+
}
112118
$script:NotificationsDir = "$script:ClaudeHome\notifications"
113119
$script:VoiceFile = "$script:NotificationsDir\voice-enabled"
114120
$script:SoundEnabledFile = "$script:NotificationsDir\sound-enabled"
@@ -577,7 +583,7 @@ function Test-LegacyClaudeHooks {
577583
return $false
578584
}
579585
580-
return ($raw -match 'claude-notify' -or $raw -match 'notify\.ps1 notification"' -or $raw -match 'notify\.ps1 stop"' -or $raw -match 'notify\.ps1 PreToolUse')
586+
return ($raw -match 'claude-notify' -or $raw -match 'notify\.ps1.* notification"' -or $raw -match 'notify\.ps1.* stop"' -or $raw -match 'notify\.ps1.* PreToolUse')
581587
}
582588
583589
function Repair-LegacyClaudeHooks {

tests/test-config-preservation.sh

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,92 @@ EOF
691691
echo "✅ Legacy Claude hooks are repaired to the current code-notify config"
692692
)
693693

694+
(
695+
unset CLAUDE_HOME
696+
mkdir -p "$HOME/.config/.claude" "$HOME/.claude/notifications"
697+
rm -f "$HOME/.claude/settings.json" "$HOME/.claude/hooks.json"
698+
printf '{}\n' > "$HOME/.config/.claude/settings.json"
699+
700+
source "$SCRIPT_DIR/../lib/code-notify/utils/colors.sh"
701+
source "$SCRIPT_DIR/../lib/code-notify/utils/detect.sh"
702+
source "$SCRIPT_DIR/../lib/code-notify/core/config.sh"
703+
source "$SCRIPT_DIR/../lib/code-notify/commands/global.sh"
704+
705+
is_tool_installed() { return 0; }
706+
707+
if [[ "$GLOBAL_SETTINGS_FILE" != "$HOME/.config/.claude/settings.json" ]]; then
708+
echo "❌ Alternate Claude settings path was not detected"
709+
echo "Resolved settings path: $GLOBAL_SETTINGS_FILE"
710+
exit 1
711+
fi
712+
713+
cat > "$GLOBAL_SETTINGS_FILE" << EOF
714+
{
715+
"hooks": {
716+
"Notification": [
717+
{
718+
"matcher": "",
719+
"hooks": [
720+
{
721+
"type": "command",
722+
"command": "powershell -ExecutionPolicy Bypass -File \"$HOME/.claude/notifications/notify.ps1\" notification"
723+
}
724+
]
725+
}
726+
],
727+
"Stop": [
728+
{
729+
"matcher": "",
730+
"hooks": [
731+
{
732+
"type": "command",
733+
"command": "powershell -ExecutionPolicy Bypass -File \"$HOME/.claude/notifications/notify.ps1\" stop"
734+
}
735+
]
736+
}
737+
]
738+
}
739+
}
740+
EOF
741+
742+
echo ""
743+
echo "=== Testing alternate Claude settings path repair ==="
744+
745+
if ! claude_global_hooks_need_repair; then
746+
echo "❌ Alternate-path Claude hooks were not flagged for repair"
747+
cat "$GLOBAL_SETTINGS_FILE"
748+
exit 1
749+
fi
750+
echo "✅ Alternate-path Claude hooks are detected as stale"
751+
752+
local output
753+
output=$("$SCRIPT_DIR/../bin/code-notify" repair-hooks 2>&1) || {
754+
echo "❌ code-notify repair-hooks failed for alternate Claude settings path"
755+
echo "$output"
756+
exit 1
757+
}
758+
759+
grep -qF "\"matcher\": \"idle_prompt\"" "$GLOBAL_SETTINGS_FILE" || {
760+
echo "❌ Alternate-path Claude config did not restore idle_prompt matcher"
761+
cat "$GLOBAL_SETTINGS_FILE"
762+
exit 1
763+
}
764+
765+
if ! grep -qF "notification claude" "$GLOBAL_SETTINGS_FILE"; then
766+
echo "❌ Alternate-path Claude config did not add the claude notification argument"
767+
cat "$GLOBAL_SETTINGS_FILE"
768+
exit 1
769+
fi
770+
771+
if ! grep -qF "stop claude" "$GLOBAL_SETTINGS_FILE"; then
772+
echo "❌ Alternate-path Claude config did not add the claude stop argument"
773+
cat "$GLOBAL_SETTINGS_FILE"
774+
exit 1
775+
fi
776+
777+
echo "✅ Alternate Claude settings path is repaired to the current code-notify config"
778+
)
779+
694780
return $?
695781
}
696782

0 commit comments

Comments
 (0)