You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rtk gain reports a missing hook on only one of its five views — never on the empty report, where it matters most #4035
rtk gain reports a missing or outdated hook on only one of its five invocations: the default view, and only when there is tracking data. --daily, --weekly, --monthly, --all and the empty report all stay silent.
The empty report is the worst case. With no hook installed nothing is tracked, so "no data" is usually caused by the missing hook — and that is exactly the run where the user is told nothing:
$ rtk gain
No tracking data yet.
Run some rtk commands to start tracking savings.
The advice never appears, because rtk gain is also exempt from the daily [rtk] /!\ No hook installed reminder — it is exempt on the grounds that it prints its own.
Cause
In src/analytics/gain.rs, the hook_check::status() block sits inside the default-view branch (if !daily && !weekly && !monthly && !all), which is itself after the summary.total_commands == 0 early return. Two gates, so four of five views and the empty report never reach it.
Reproduction
Measured with an isolated HOME holding a .claude directory and no hook registered, counting [warn] No hook installed lines:
invocation
warnings
rtk gain (with data)
1
rtk gain --daily
0
rtk gain --weekly
0
rtk gain --all
0
rtk gain (empty database)
0
Expected
Every text view reports it, including the empty one. The JSON and CSV exports return before this point and should stay free of it.
rtk gain only checks/reports the missing-hook status in the default view with data, silently skipping --daily/--weekly/--monthly/--all and the empty-report case where the warning matters most; fix by moving the hook_check::status() call outside the two gating conditions in src/analytics/gain.rs.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
src/analytics/gain.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
Activity
rtk-wshm-sync-bot commentedon Sep 13, 2026
🔍 Automated Triage
bugmediumSummary
rtk gain only checks/reports the missing-hook status in the default view with data, silently skipping --daily/--weekly/--monthly/--all and the empty-report case where the warning matters most; fix by moving the hook_check::status() call outside the two gating conditions in src/analytics/gain.rs.
📁 Relevant files
src/analytics/gain.rsTriaged automatically by wshm · This is an automated analysis, not a human review.