Repository navigation
fix(discover,learn): default to scanning all projects instead of encoding CWD - #2228
Closed
mikeangstadt wants to merge 5 commits into
Closed
mikeangstadt wants to merge 5 commits into
mikeangstadt wants to merge 5 commits into
Conversation
When ripgrep is not on $PATH, rtk grep falls back to system grep but was passing ripgrep-specific flags like -g/--glob, --hidden, --pcre2, --json, etc. that grep does not understand, causing silent failures or wrong results. Adds a stateful filter that removes rg-only flags (and their value arguments) from the extra_args before passing them to grep. Closes rtk-ai#2167
rtk proxy does not invoke a shell — it spawns the command directly via exec. When users pass compound shell syntax (&&, ||, |, ;, $(), etc.), those tokens end up as literal arguments to the spawned process, causing confusion or incorrect behavior (e.g. bogus files/dirs from shell tokens). Adds detect_shell_snippet() that validates the command name and all args for shell control operators and command substitution syntax, returning a clear error with a suggestion to use `sh -c` or `bash -c` instead. Closes rtk-ai#2163
Custom TOML filters (from .rtk/filters.toml or ~/.config/rtk/filters.toml) were parsed and passed rtk verify, but were never consulted by the hook rewrite path. The rewrite engine (discover/registry.rs) only checked the hardcoded RULES array, returning empty for any unrecognized command. Now, when classify_command returns Unsupported, we check the TomlFilterRegistry for a matching custom filter. If found, the command is rewritten to run through "rtk <original>" so that fallback execution applies the filter pipeline. Closes rtk-ai#2179
…ssing ccusage version drift can change or remove field names in the JSON output. When month/date/week fields are missing, rtk cc-economics hard-failed with serde parse errors instead of adapting. Changes period entry key fields (date, week, month) to Option<String> and uses filter_map to skip entries without a valid key instead of crashing the whole command. This allows the command to succeed with whatever data is available. Also updates parse_json to use filter_map instead of unwrap/map, providing graceful degradation for all three granularities (daily, weekly, monthly). Closes rtk-ai#2178
…ding CWD discover/learn used encode_project_path() to filter sessions by the current working directory. This encoding can fail on path patterns with symlinks, case differences (macOS), or encoding mismatches with Claude Code's actual directory naming, causing 0 sessions to be returned. Changed the default (when neither --all nor --project is given) to pass None as the project filter, matching rtk session behavior. The --project flag remains for explicit project filtering. Closes rtk-ai#2177
This was referenced Jun 10, 2026
Contributor
|
This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet. |
Contributor
|
Closing this pull request after a prolonged period of inactivity. If this is still relevant, please ask for it to be reopened. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rtk discoverandrtk learnreported 0 sessions when run without--all, even when the project had thousands of Claude Code sessions.rtk session(same underlying data) worked fine without--all.Root Cause
Both commands used
encode_project_path()to filter sessions by the current working directory's Claude Code slug. This encoding can fail on path patterns with symlinks, case differences (macOS is case-insensitive butcontains()is case-sensitive), or encoding mismatches with Claude Code's actual directory naming. When the filter doesn't match,discover_sessions()returns 0 results.Change
Changed the default (when neither
--allnor--projectis given) to passNoneas the project filter, matchingrtk sessionbehavior. The--projectflag remains for explicit project filtering.Closes #2177
Collaborated & orchestrated by ClosedLoop.AI | GitHub