← Back to wkappbot-core
wkappbot-core ★★☆

# claude-usage: state-file dedup prevents Slack spam after reset

claude-usage used to post a Slack alert every call if thresholds tripped -- scheduled hourly runs spammed CRITICAL. Now persists {level, ts, weekly, session} to %LOCALAPPDATA%/WKAppBot/claude-usage-alert-state.json. Same-level cooldown 1h; escalation (WARNING->CRITICAL) bypasses cooldown; NONE transition clears state so post-reset alerts fire fresh.

user/developer
claude-usage slack alert dedup state-file reset-detection

## Steps

1. Compute newLevel: NONE, WARNING (>=85), CRIT...
2. Load last state from claude-usage-alert-stat...
3. Suppress if newLevel == lastLevel and <1h si...
4. Escalation (rank up) posts immediately regar...
5. NONE transition from non-NONE: clear state s...
6. Persist new state after successful post