rtk-ai/rtk

dotnet test/format/restore not matched by rtk rewrite (discover rules missing)

Open

#1207 opened on Apr 11, 2026

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Rust (48,085 stars) (2,914 forks)batch import
bugeffort-smallgood first issue

Description

Description

rtk dotnet test, rtk dotnet format, and rtk dotnet restore all work correctly and produce excellent filtered output. However, rtk rewrite does not match these commands, so the PreToolUse hook never rewrites them — they pass through unfiltered.

dotnet build is correctly matched by the rewrite registry, but the other three subcommands are not.

Reproduction

$ rtk rewrite "dotnet build"
rtk dotnet build          # exit 3 ✓

$ rtk rewrite "dotnet test"
                          # exit 1 — no match

$ rtk rewrite "dotnet format"
                          # exit 1 — no match

$ rtk rewrite "dotnet restore"
                          # exit 1 — no match

Meanwhile, the proxied commands work perfectly:

$ rtk dotnet test Project.Tests.csproj --no-build --filter "Category!=Integration" --verbosity minimal
ok dotnet test: 20 tests passed, 0 warnings in 1 projects (936 ms)

Impact

In a large .NET monorepo, dotnet test without --no-build produces 101 lines / 20 KB of output (restore, build warnings, project compilation lines). The actual test result is 3 lines. rtk dotnet test compresses this to 1 line / ~70 bytes — a 97% reduction.

From rtk discover in our environment:

  • dotnet test: 309 missed commands → estimated ~1.5M tokens saveable
  • dotnet format: 40 missed commands
  • dotnet restore: not tracked separately but included in dotnet test runs without --no-build

Environment

  • rtk 0.35.0 (Homebrew, macOS arm64)
  • Claude Code with PreToolUse hook (rtk-hook-version: 3)
  • .NET 10.0

Note

PR #1111 by @Dmitrii-Sokolov appears to address this. This issue is filed for tracking/discoverability.

Contributor guide