Skip to content

fix(discover,learn): encode Windows drive colon in project path slug - #2368

Closed
ALCHEMISTK wants to merge 1 commit into
rtk-ai:developfrom
ALCHEMISTK:fix/discover-windows-drive-colon
Closed

ALCHEMISTK wants to merge 1 commit into
rtk-ai:developfrom
ALCHEMISTK:fix/discover-windows-drive-colon

Conversation

@ALCHEMISTK

Copy link
Copy Markdown

Summary

Fixes #2367 — on native Windows, rtk discover and rtk learn always scanned 0 sessions without --all/--project, because encode_project_path() kept the drive colon (C:\Users\foo → C:-Users-foo) while Claude Code's project slug encodes it to a dash (C--Users-foo). The cwd-derived default filter could therefore never substring-match the real ~/.claude/projects/ directory name.

Changes

Both discover and learn build their default filter from this function, hence the dual scope.

Verification

  • cargo test: 2149 passed, 8 ignored (full suite, Windows 11)
  • Real-world before/after on Windows 11 + Claude Code, rtk 0.42.3 base:
    • before: rtk discover → Scanned: 0 sessions (last 30 days), 0 Bash commands
    • after (encoder parity, validated via the equivalent --project substring): Scanned: 504 sessions (last 30 days), 3382 Bash commands

Notes

🤖 Generated with Claude Code

Claude Code encodes 'C:\Users\foo' as projects/C--Users-foo, but
encode_project_path() kept the drive colon ('C:-Users-foo'), so the
default cwd-derived project filter could never substring-match the
real directory name. Result: 'rtk discover' and 'rtk learn' scanned
0 sessions on every native-Windows machine unless --all/--project
was passed.

Add ':' to SANITIZED_CHARS, correct the doc-comment example, fix the
test that pinned the wrong expectation, and add a drive-colon
regression test.

Fixes rtk-ai#2367
@CLAassistant

CLAassistant commented Jun 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ALCHEMISTK

Copy link
Copy Markdown
Author

done

@KuSh

KuSh commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks for tracking this down. The drive-letter colon is now sanitized on develop: #2952 (merged 2026-08-13) added ':' to SANITIZED_CHARS in encode_project_path, fixed the doc-comment example to C--Users-foo-bar, and updated test_encode_project_path_windows to the same expectation, so the cwd-derived project filter matches Claude Code's real folder name on Windows. The only piece here that is not on develop is a second assertion of the same code path with a different drive letter. Closing as already fixed, but please comment or reopen if something in your setup is still not covered.

@KuSh KuSh closed this Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

discover/learn: Windows drive colon breaks the default project filter (always scans 0 sessions)

3 participants