Skip to content

feat(rewrite): #2721 prepend rtk for TOML filters invoked via binary paths.#2722

Open
denis-peshkov wants to merge 1 commit into
rtk-ai:developfrom
denis-peshkov:feat/toml-path-rewrite-fallback
Open

feat(rewrite): #2721 prepend rtk for TOML filters invoked via binary paths.#2722
denis-peshkov wants to merge 1 commit into
rtk-ai:developfrom
denis-peshkov:feat/toml-path-rewrite-fallback

Conversation

@denis-peshkov

@denis-peshkov denis-peshkov commented Jun 29, 2026

Copy link
Copy Markdown

Add TOML-aware rewrite fallback so hooks prepend rtk for commands like node_modules/.bin/make that match built-in TOML filters but have no rules.rs prefix entry.

After #2719

Closes #2721

Why

run_fallback already resolves basename for TOML lookup; rtk rewrite did not. Path invocations were never rewritten → no token savings in Cursor/Claude agents.

Changes

  • lookup_command_for_filter() in toml_filter.rs
  • TOML-match fallback in registry.rs::rewrite_segment_inner()
  • Tests using the existing make built-in filter

…ike `node_modules/.bin/make` that match built-in TOML filters but have no `rules.rs` prefix entry.

Closes rtk-ai#2721

## Why
`run_fallback` already resolves basename for TOML lookup; `rtk rewrite` did not. Path invocations were never rewritten → no token savings in Cursor/Claude agents.

## Changes
- `lookup_command_for_filter()` in `toml_filter.rs`
- TOML-match fallback in `registry.rs::rewrite_segment_inner()`
- Tests using existing `make` built-in filter
@denis-peshkov denis-peshkov changed the title Add TOML-aware rewrite fallback so hooks prepend rtk for commands like node_modules/.bin/make that match built-in TOML filters but have no rules.rs prefix entry. feat(rewrite): #2721 prepend rtk for TOML filters invoked via binary paths. Jun 29, 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.

feat(rewrite): auto-rewrite TOML-only commands invoked via binary paths (.bin/, absolute paths)

1 participant