diff --git a/README.md b/README.md index 605893a..2863293 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@ Desktop notifications for AI coding tools - get alerts when tasks complete or input is needed. -## Latest: T3 Code Thread Titles +## Latest: Advance Usage Reset Reminders -On macOS, Code-Notify now shows the matching T3 Code thread title in Codex completion notifications instead of a generic workspace name. +On macOS/Linux (including WSL), Code-Notify can now remind you before Codex or Claude usage resets, using the existing usage watcher and notification channels. -- **Automatic matching**: Uses the Codex `thread-id` to find the corresponding T3 Code thread -- **Safe fallback**: Uses the workspace name when T3 Code is unavailable or no matching thread exists -- **No extra setup**: Existing `cn on codex` configurations pick up the feature after updating -- **macOS scoped**: Linux, WSL, and native Windows notification behavior is unchanged +- **Default schedule**: Weekly reminders at 48h, 24h, 12h, 6h, 2h, and 30m; 5h windows use 2h and 30m +- **Once per reset cycle**: Full-quota observations do not erase previously sent reminders +- **Quiet catch-up**: Missed stages collapse into the most urgent reminder for each window +- **Configurable**: Choose your own schedule with `cn usage reset-reminders set 24,6,1`, or disable it with `cn usage reset-reminders off` Update and verify the installed version: @@ -24,7 +24,7 @@ cn update code-notify version ``` -Usage reset alerts and advance reminders are available for Codex and Claude: `cn usage setup --watch`. +Usage alerts remain opt-in: start with `cn usage setup --watch`. Existing enabled usage configs without a `reset_reminders` setting use the default reminder schedule. After updating, restart any running watcher with `cn usage watch restart` (include your provider and interval options if customized). Voice samples: [Daily reset](https://cdn.jsdelivr.net/gh/mylee04/code-notify@main/assets/audio/codex-token-daily-limit-reset.m4a) ยท [Weekly reset](https://cdn.jsdelivr.net/gh/mylee04/code-notify@main/assets/audio/codex-token-weekly-limit-reset.m4a) @@ -35,7 +35,7 @@ Voice samples: [Daily reset](https://cdn.jsdelivr.net/gh/mylee04/code-notify@mai All tools enabled

-[![Version](https://img.shields.io/badge/version-1.12.0-blue.svg)](https://github.com/mylee04/code-notify/releases) +[![Version](https://img.shields.io/badge/version-1.13.0-blue.svg)](https://github.com/mylee04/code-notify/releases) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![macOS](https://img.shields.io/badge/macOS-supported-green.svg)](https://www.apple.com/macos) [![Linux](https://img.shields.io/badge/Linux-supported-green.svg)](https://www.linux.org/) @@ -43,12 +43,12 @@ Voice samples: [Daily reset](https://cdn.jsdelivr.net/gh/mylee04/code-notify@mai --- -## What's New in v1.12.0 +## What's New in v1.13.0 -- **T3 Code context on macOS**: Codex completion notifications use the matching T3 Code thread title -- **Resilient local lookup**: Missing, malformed, or non-object T3 state entries are ignored without interrupting notifications -- **Safe notification text**: Quoted thread titles are passed to AppleScript without breaking delivery -- **Workspace fallback**: Existing Codex notification context remains available when no T3 Code title can be resolved +- **Advance reset reminders**: Configurable schedules based on provider-reported reset times +- **Per-cycle dedupe**: Prevent repeat reminders after a temporary return to 100% quota, while re-arming for the next reset cycle +- **Flexible timestamps**: Accept Unix seconds, milliseconds, and ISO-8601 reset times +- **Existing delivery paths**: Reuse desktop, voice, sound, Slack, and Discord without a new service or dependency --- @@ -62,7 +62,7 @@ Voice samples: [Daily reset](https://cdn.jsdelivr.net/gh/mylee04/code-notify@mai - **Sound notifications** - Play custom sounds on task completion - **Voice announcements** - Hear when tasks complete (macOS, Windows) - **Slack/Discord delivery** - Mirror notifications to incoming webhooks -- **Usage alerts** - Opt-in Codex/Claude 20%, 10%, and reset notifications +- **Usage alerts** - Opt-in Codex/Claude 20%, 10%, advance reset reminders, and reset notifications (macOS/Linux) - **Tool-specific messages** - "Claude completed the task", "Codex completed the task", "omp completed the task" - **Project-specific settings** - Different configs per project - **Quick aliases** - `cn` and `cnp` for fast access @@ -263,7 +263,7 @@ Webhook URLs are stored locally in `~/.config/code-notify/channels.json` and are ### Usage Alerts -Usage alerts are opt-in for Codex and Claude. Fast setup: +Usage alerts and advance reminders are opt-in for Codex and Claude on macOS/Linux, including WSL. Native Windows usage polling and advance reminders are not implemented yet. Fast setup: ```bash cn usage setup --watch @@ -284,9 +284,9 @@ cn usage check # Run one check now cn usage watch start --interval 300 # Keep watching in the background ``` -Code-Notify checks the daily (5h) and weekly (7d) usage windows. It sends a warning when remaining usage crosses 20% or 10%, advance reminders while unused quota is approaching its reset, and a reset notification when a window returns to 100%. Weekly windows use all default reminder stages; 5h windows use the 2h and 30m stages. +Code-Notify checks the daily (5h) and weekly (7d) usage windows. It sends a warning when remaining usage crosses 20% or 10%, advance reminders when a provider-reported reset approaches, and a reset notification when a window returns to 100%. Weekly windows use all default reminder stages; 5h windows use the 2h and 30m stages. -Each reminder is sent once per reset cycle. If the watcher was stopped while several stages passed, Code-Notify sends only the most urgent catch-up reminder instead of a burst. Customize or disable the schedule with: +Each reminder stage is sent once per reset cycle. Reminders are suppressed while quota is full, without forgetting stages already sent in that cycle. If the watcher was stopped while several stages passed, Code-Notify sends only the most urgent catch-up reminder per window instead of a burst. Existing enabled usage configs without a `reset_reminders` setting use the default schedule after upgrading. Customize or disable it with: ```bash cn usage reset-reminders set 24,6,1 @@ -296,6 +296,8 @@ cn usage reset-reminders reset `cn usage check` runs once and exits. `cn usage watch start` keeps watching in the background on macOS/Linux. Use `cn usage watch stop` to stop it. +After updating Code-Notify, restart any running watcher with `cn usage watch restart` so it loads the new runtime. Include the same provider and `--interval` options if you previously customized them. + Terminal demo: ```bash diff --git a/bin/code-notify b/bin/code-notify index 8ff84e7..032b770 100755 --- a/bin/code-notify +++ b/bin/code-notify @@ -6,7 +6,7 @@ set -e # Version -VERSION="1.12.0" +VERSION="1.13.0" # Determine the directory where the script is located (resolve symlinks) SCRIPT_PATH="${BASH_SOURCE[0]}" diff --git a/docs/installation.md b/docs/installation.md index 12109f8..e705fd8 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -10,7 +10,7 @@ Code-Notify adds desktop notifications to Claude Code, Codex, and Gemini CLI. Yo - Claude or Gemini needs your input - Voice announcements (macOS) - Slack or Discord webhook messages when channels are configured -- Codex or Claude usage crosses configured thresholds or resets +- Codex or Claude usage crosses configured thresholds, approaches a reset, or resets (macOS/Linux) Codex currently exposes completion notifications through its `notify` hook. Approval and `request_permissions` prompts do not currently trigger Code-Notify through Codex. @@ -66,14 +66,26 @@ Webhook URLs are stored locally and are redacted in status output. ### Optional Usage Alerts +Usage polling and advance reset reminders support macOS/Linux, including WSL. They are not implemented in the native Windows runtime yet. + ```bash cn usage setup --watch cn usage status ``` -Usage alerts currently support Codex and Claude daily (5h) and weekly (7d) windows. Low-usage warnings use normal Code-Notify delivery. Token reset alerts are separate and can use their own voice/sound controls with `cn usage reset-alerts ...`. Reset voice messages identify the window, such as `Codex token daily limit reset` or `Codex token weekly limit reset`. +Usage alerts support Codex and Claude daily (5h) and weekly (7d) windows. Low-usage warnings and advance reset reminders use normal Code-Notify delivery, including configured Slack/Discord channels. Token reset alerts are separate and can use their own voice/sound controls with `cn usage reset-alerts ...`. Reset voice messages identify the window, such as `Codex token daily limit reset` or `Codex token weekly limit reset`. + +`cn usage setup --watch` enables usage alerts, sets the default 20% and 10% warning thresholds, configures advance reminders at 48h, 24h, 12h, 6h, 2h, and 30m, enables distinct reset voice/sound, and starts a background watcher. Weekly windows use every default reminder stage; 5h windows use only 2h and 30m. `cn usage check` runs once and exits. Use `cn usage watch stop` to stop the watcher. + +Reminder stages are deduplicated per reset cycle, including when quota temporarily returns to 100%. Full quota suppresses advance reminders, and missed stages collapse into the most urgent catch-up reminder per window. Customize or disable the schedule with: + +```bash +cn usage reset-reminders set 24,6,1 +cn usage reset-reminders off +cn usage reset-reminders reset +``` -`cn usage setup --watch` enables usage alerts, sets the default 20% and 10% warning thresholds, enables distinct reset voice/sound, and starts a background watcher on macOS/Linux. `cn usage check` runs once and exits. Use `cn usage watch stop` to stop the watcher. +Existing enabled usage configs without a `reset_reminders` setting use the default reminder schedule after upgrading. Restart any running watcher with `cn usage watch restart` after updating so it loads the new runtime; include the same provider and `--interval` options if you previously customized them. They use existing local login state from `~/.codex/auth.json` and `~/.claude/.credentials.json`. Code-Notify does not start provider login flows. Background watching starts only when you run `cn usage setup --watch` or `cn usage watch start`. diff --git a/package.json b/package.json index cc78dc1..3f34b5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "code-notify", - "version": "1.12.0", + "version": "1.13.0", "description": "Desktop notifications and usage reset alerts for Claude Code, Codex CLI, Gemini CLI, Oh My Pi, and AI coding agents", "license": "MIT", "homepage": "https://github.com/mylee04/code-notify#readme", diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index 0dd3ab8..e9b4488 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -20,7 +20,7 @@ param( $ErrorActionPreference = "Stop" # Version -$VERSION = "1.12.0" +$VERSION = "1.13.0" # Colors and formatting function Write-Success { param([string]$Message) Write-Host "[OK] $Message" -ForegroundColor Green } @@ -107,7 +107,7 @@ function Install-ClaudeNotify { # Code-Notify PowerShell Module # https://github.com/mylee04/code-notify -$script:VERSION = "1.12.0" +$script:VERSION = "1.13.0" $script:ClaudeHome = if ($env:CLAUDE_HOME) { $env:CLAUDE_HOME } else { "$env:USERPROFILE\.claude" } $script:DefaultSettingsFile = "$script:ClaudeHome\settings.json" $script:AlternateSettingsFile = "$env:USERPROFILE\.config\.claude\settings.json"