Repository navigation
Conversation
When binary resolution through PATH fails, RTK falls back to a direct exec and prints a note to stderr. In a terminal that is a useful signal. Inside an agent it is the opposite: the command still ran, and on Windows the agent merges stderr into its context, so the note costs more tokens than the command saved. RTK's whole purpose is not spending those tokens. Add `RTK_QUIET=1` and a `hooks.quiet` config key that suppress informational stderr while leaving real errors untouched. Default is false, so nothing changes for existing users. The config lookup is cached in a `OnceLock`. `Config::load()` re-reads and re-parses the file on every call and this sits on the command-resolution path, which would put file I/O on the critical path the project explicitly keeps clear. Co-Authored-By: Claude Opus 5 <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.
Problem
When binary resolution through
PATHfails, RTK falls back to a direct exec and prints a note to stderr:In a terminal that is a useful signal. Inside an agent it is the opposite:
Not spending those tokens is the entire point of the project.
Fix
Two opt-ins, both default off:
Informational stderr is suppressed; real errors are untouched. Existing users see no change.
Performance note
The config lookup is cached in a
OnceLock.Config::load()re-reads and re-parses the file on every call, and this sits on the command-resolution path — reading it uncached would put file I/O on the critical path the project explicitly keeps clear ("no config file I/O on the critical path"). With the cache, the cost is one read per process, only when a PATH lookup actually falls back.Testing
test_hooks_quiet_defaults_off_and_deserializespins all three cases: default off,quiet = trueparses, and a config predating the field still parses. The suppression itself is a single!quiet &&guard on an existing branch, gated on env/config that a unit test cannot mutate without racing other tests.Docs added to
docs/guide/getting-started/configuration.md.Full suite on
x86_64-pc-windows-gnu: 2615 passed.cargo fmt --checkandcargo clippy --all-targetsclean. The single unrelated failure on this toolchain is fixed in #3615.🤖 Generated with Claude Code