feat: add Gradle test filter support#263
Open
yonatankarp wants to merge 1 commit intortk-ai:masterfrom
Open
Conversation
Add a new `rtk gradle` command that filters Gradle test output for token-optimized consumption by LLMs. The filter strips task progress lines (> Task :compileJava UP-TO-DATE), boilerplate advice sections (* Try: / * Get more help), and retains only failures, test summaries, and build status — achieving ~70% token reduction on test output. The command auto-detects `./gradlew` wrapper when present and falls back to `gradle`. Unfiltered tasks (build, assemble, etc.) pass through directly. Hook support rewrites both `gradle` and `./gradlew` invocations to `rtk gradle` in Claude Code sessions. This is the first PR for JVM ecosystem support, split for review size. Follow-up PRs will add filters for additional Gradle tasks (build, lint) and Maven support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 gradle testcommand that filters Gradle test output, stripping task progress lines and boilerplate advice while preserving failures, test summaries, and build status (~70% token reduction)./gradlewwrapper when present, falls back togradlebinarygradleand./gradlewinvocations tortk gradlein Claude Code sessionsFuture work
This is the first PR for JVM ecosystem support, split to keep review size manageable. Follow-up PRs will cover filters for additional Gradle tasks (build errors, lint) and support for other JVM build tools.
Test plan
gradle,./gradlew, and submodule variants (:app:test)rtk gradle test -hcargo fmt --all --check && cargo clippy --all-targets && cargo testall green🤖 Generated with Claude Code