Description
The match_command regex in src/filters/gradle.toml is structurally broken and never activates for bare gradle or gradlew invocations — only ./gradle and ./gradlew work.
Current regex
^(gradle|gradlew|\\./)gradlew?\\b
The alternation group (gradle|gradlew|\\./)captures the entire command name, then expects another gradlew? suffix immediately after. This creates impossible matches:
| Input |
Group captures |
Then needs |
Full match attempt |
Result |
gradle build |
gradle |
gradlew? |
gradlegradle or gradlegradlew |
NO MATCH |
gradlew build |
gradlew |
gradlew? |
gradlewgradle or gradlewgradlew |
NO MATCH |
./gradle build |
./ |
gradlew? |
./gradle |
MATCH |
./gradlew build |
./ |
gradlew? |
./gradlew |
MATCH |
Only the ./ prefix case works because it's the only branch where the suffix gradlew? makes sense.
Expected behavior
All four forms should match: gradle, gradlew, ./gradle, ./gradlew.
Impact
The gradle filter never activates for direct gradle or gradlew invocations, meaning users get unfiltered output with zero token savings for all Gradle commands unless they use the ./ prefix form.
Fix
Change the regex to make ./ optional and capture the command name in one group:
This correctly matches all four forms.
Description
The
match_commandregex insrc/filters/gradle.tomlis structurally broken and never activates for baregradleorgradlewinvocations — only./gradleand./gradlewwork.Current regex
The alternation group
(gradle|gradlew|\\./)captures the entire command name, then expects anothergradlew?suffix immediately after. This creates impossible matches:gradle buildgradlegradlew?gradlegradleorgradlegradlewgradlew buildgradlewgradlew?gradlewgradleorgradlewgradlew./gradle build./gradlew?./gradle./gradlew build./gradlew?./gradlewOnly the
./prefix case works because it's the only branch where the suffixgradlew?makes sense.Expected behavior
All four forms should match:
gradle,gradlew,./gradle,./gradlew.Impact
The gradle filter never activates for direct
gradleorgradlewinvocations, meaning users get unfiltered output with zero token savings for all Gradle commands unless they use the./prefix form.Fix
Change the regex to make
./optional and capture the command name in one group:This correctly matches all four forms.