Skip to content

learn: zero-session message blames the time window whatever the scope #4314

Open

Description

@KuSh

rtk learn scopes to the current project by default, exactly like rtk discover (src/learn/mod.rs, "same logic as discover"). When that scope matches no transcript directory it prints:

No Claude Code sessions found in the last 30 days.

for all three scopes (default cwd, -p <filter>, --all). The message names the one cause that is usually not the cause: from a directory Claude Code has never run in, the fix is --all or -p, and nothing in the output says so. After #3374, discover explains its scope in the same situation:

No sessions found for the current project (`-home-user-proj`) in the last 30 days. Try `rtk discover --all` to scan every project.

so the two commands now give different explanations for the same empty result on the same machine.

Expected: learn carries the scope like discover does (ScanScope in src/discover/report.rs after #3374) and prints the matching line: the filter or encoded directory name and the window, plus the --all hint for the two narrowed scopes.

Found while reviewing #3374; related to #2177 (matcher) and #3315 (discover's message).

Activity

  1. added
    bug
    on Sep 27, 2026
  2. rtk-wshm-sync-bot commented on Sep 27, 2026

    @rtk-wshm-sync-bot

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟢 Priority low
    🎯 Confidence 90%

    Summary

    rtk learn prints a generic time-window message on zero sessions instead of discover's scope-aware message with an --all hint

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • src/learn/mod.rs
    • src/discover/report.rs

    Suggested Actions

    1. Reuse ScanScope from src/discover/report.rs in src/learn/mod.rs to build the same message
    2. Mirror the wording introduced in fix(discover): distinguish zero-session scans #3374/discover: prints "RTK usage looks good!" after scanning 0 sessions; node and powershell uncovered #3315 for the default/-p/--all scopes
    3. Add a regression test covering all three scopes' zero-session messages

    Triaged automatically by wshm · This is an automated analysis, not a human review.

  3. added 3 commits that reference this issue on Oct 23, 2026
    490b8e0
    2dcf44a
    afa650f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibuggood first issuepriority:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions