rtk-windows — High-performance CLI proxy for Windows (60-90% LLM token reduction)
Install • Install • Troubleshooting • Architecture
English • Francais • 中文 • 日本語 • 한국어 • Espanol
rtk-windows is a dedicated Windows fork that filters and compresses command outputs before they reach your LLM context. Single Rust binary, 100+ supported commands, <10ms overhead.
Windows-only: This project exclusively supports Windows 10/11 with PowerShell Core or Command Prompt.
Independent fork: This is a standalone Windows-focused implementation. It is not affiliated with any upstream projects or maintainers.
| Operation | Frequency | Standard | rtk-windows | Savings |
|---|---|---|---|---|
ls / tree |
10x | 2,000 | 400 | -80% |
cat / read |
20x | 40,000 | 12,000 | -70% |
grep / rg |
8x | 16,000 | 3,200 | -80% |
git status |
10x | 3,000 | 600 | -80% |
git diff |
5x | 10,000 | 2,500 | -75% |
git log |
5x | 2,500 | 500 | -80% |
git add/commit/push |
8x | 1,600 | 120 | -92% |
cargo test / npm test |
5x | 25,000 | 2,500 | -90% |
ruff check |
3x | 3,000 | 600 | -80% |
pytest |
4x | 8,000 | 800 | -90% |
go test |
3x | 6,000 | 600 | -90% |
docker ps |
3x | 900 | 180 | -80% |
| Total | ~118,000 | ~23,900 | -80% |
Estimates based on medium-sized TypeScript/Rust projects. Actual savings vary by project size.
Windows only (PowerShell Core or Command Prompt)
Download rtk-windows-x86_64-pc-windows-msvc.zip from releases, extract rtk-windows.exe, and place it in your PATH.
# Example user-scoped install directory
New-Item -ItemType Directory -Force "$env:USERPROFILE\bin" | Out-Null
Copy-Item .\rtk-windows.exe "$env:USERPROFILE\bin\rtk-windows.exe" -ForceAdd to PATH if needed:
[Environment]::SetEnvironmentVariable(
"Path",
$env:Path + ";$env:USERPROFILE\bin",
"User"
)cargo install --git https://github.com/luysantanadev/rtk-windows.gitrtk-windows --version # Should show "rtk-windows 0.28.x"
rtk-windows gain # Should show token savings statsName collision warning: Another project named "rtk" (Rust Type Kit) exists on crates.io. If installation fails, use
cargo install --gitabove instead.
# 1. Install for your AI tool (Windows agents)
rtk-windows init # VS Code Copilot Chat (default)
rtk-windows init --agent cursor # Cursor
rtk-windows init --agent cline # Cline / Roo Code
rtk-windows init --agent opencode # OpenCode
rtk-windows init --agent hermes # Hermes
# 2. Restart your AI tool, then test
git status # Automatically rewritten to rtk-windows git statusHook-based agents (Copilot, Cursor, Cline) rewrite PowerShell/cmd terminal commands (e.g., git status -> rtk-windows git status) before execution. Plugin-based agents (OpenCode, Hermes) use their plugin API to rewrite commands before execution.
Note: The hook only runs on terminal commands. Claude Code built-in tools like Read, Grep, and Glob do not pass through the hook, so they are not auto-rewritten. Call rtk-windows read, rtk-windows grep, or rtk-windows find directly for those workflows.
Without rtk: With rtk:
Claude --git status--> shell --> git Claude --git status--> rtk-windows --> git
^ | ^ | |
| ~2,000 tokens (raw) | | ~200 tokens | filter |
+-----------------------------------+ +------- (filtered) ---+----------+
Four strategies applied per command type:
- Smart Filtering - Removes noise (comments, whitespace, boilerplate)
- Grouping - Aggregates similar items (files by directory, errors by type)
- Truncation - Keeps relevant context, cuts redundancy
- Deduplication - Collapses repeated log lines with counts
rtk-windows ls . # Token-optimized directory tree
rtk-windows read file.rs # Smart file reading
rtk-windows read file.rs -l aggressive # Signatures only (strips bodies)
rtk-windows smart file.rs # 2-line heuristic code summary
rtk-windows find "*.rs" . # Compact find results
rtk-windows grep "pattern" . # Grouped search results
rtk-windows diff file1 file2 # Condensed diffrtk-windows git status # Compact status
rtk-windows git log -n 10 # One-line commits
rtk-windows git diff # Condensed diff
rtk-windows git add # -> "ok"
rtk-windows git commit -m "msg" # -> "ok abc1234"
rtk-windows git push # -> "ok main"
rtk-windows git pull # -> "ok 3 files +10 -2"rtk-windows gh pr list # Compact PR listing
rtk-windows gh pr view 42 # PR details + checks
rtk-windows gh issue list # Compact issue listing
rtk-windows gh run list # Workflow run statusrtk-windows jest # Jest compact (failures only)
rtk-windows vitest # Vitest compact (failures only)
rtk-windows playwright test # E2E results (failures only)
rtk-windows pytest # Python tests (-90%)
rtk-windows go test # Go tests (NDJSON, -90%)
rtk-windows cargo test # Cargo tests (-90%)
rtk-windows rake test # Ruby minitest (-90%)
rtk-windows rspec # RSpec tests (JSON, -60%+)
rtk-windows err <cmd> # Filter errors only from any command
rtk-windows test <cmd> # Generic test wrapper - failures only (-90%)rtk-windows lint # ESLint grouped by rule/file
rtk-windows lint biome # Supports other linters
rtk-windows tsc # TypeScript errors grouped by file
rtk-windows next build # Next.js build compact
rtk-windows prettier --check . # Files needing formatting
rtk-windows cargo build # Cargo build (-80%)
rtk-windows cargo clippy # Cargo clippy (-80%)
rtk-windows ruff check # Python linting (JSON, -80%)
rtk-windows golangci-lint run # Go linting (JSON, -85%)
rtk-windows rubocop # Ruby linting (JSON, -60%+)rtk-windows pnpm list # Compact dependency tree
rtk-windows pip list # Python packages (auto-detect uv)
rtk-windows pip outdated # Outdated packages
rtk-windows bundle install # Ruby gems (strip Using lines)
rtk-windows prisma generate # Schema generation (no ASCII art)rtk-windows aws sts get-caller-identity # One-line identity
rtk-windows aws ec2 describe-instances # Compact instance list
rtk-windows aws lambda list-functions # Name/runtime/memory (strips secrets)
rtk-windows aws logs get-log-events # Timestamped messages only
rtk-windows aws cloudformation describe-stack-events # Failures first
rtk-windows aws dynamodb scan # Unwraps type annotations
rtk-windows aws iam list-roles # Strips policy documents
rtk-windows aws s3 ls # Truncated with tee recoveryrtk-windows docker ps # Compact container list
rtk-windows docker images # Compact image list
rtk-windows docker logs <container> # Deduplicated logs
rtk-windows docker compose ps # Compose services
rtk-windows kubectl pods # Compact pod list
rtk-windows kubectl logs <pod> # Deduplicated logs
rtk-windows kubectl services # Compact service listrtk-windows json config.json # Structure without values
rtk-windows deps # Dependencies summary
rtk-windows env -f AWS # Filtered env vars
rtk-windows log app.log # Deduplicated logs
rtk-windows curl <url> # Truncate + save full output
rtk-windows wget <url> # Download, strip progress bars
rtk-windows summary <long command> # Heuristic summary
rtk-windows proxy <command> # Raw passthrough + trackingrtk-windows gain # Summary stats
rtk-windows gain --graph # ASCII graph (last 30 days)
rtk-windows gain --history # Recent command history
rtk-windows gain --daily # Day-by-day breakdown
rtk-windows gain --all --format json # JSON export for dashboards
rtk-windows discover # Find missed savings opportunities
rtk-windows discover --all --since 7 # All projects, last 7 days
rtk-windows session # Show rtk-windows adoption across recent sessions-u, --ultra-compact # ASCII icons, inline format (extra token savings)
-v, --verbose # Increase verbosity (-v, -vv, -vvv)Directory listing:
# ls -la (45 lines, ~800 tokens) # rtk-windows ls (12 lines, ~150 tokens)
drwxr-xr-x 15 user staff 480 ... my-project/
-rw-r--r-- 1 user staff 1234 ... +-- src/ (8 files)
... | +-- main.rs
+-- Cargo.toml
Git operations:
# git push (15 lines, ~200 tokens) # rtk-windows git push (1 line, ~10 tokens)
Enumerating objects: 5, done. ok main
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
...
Test output:
# cargo test (200+ lines on failure) # rtk-windows test cargo test (~20 lines)
running 15 tests FAILED: 2/15 tests
test utils::test_parse ... ok test_edge_case: assertion failed
test utils::test_format ... ok test_overflow: panic at utils.rs:18
...
The most effective way to use rtk. The hook transparently intercepts terminal commands and rewrites them to rtk-windows equivalents before execution.
Result: 100% rtk-windows adoption across all conversations and subagents, zero token overhead.
Scope note: this applies to terminal tool calls. Claude Code built-in tools such as Read, Grep, and Glob bypass the hook, so use explicit rtk-windows commands when you want rtk-windows filtering there.
rtk-windows init -g # Install hook + RTK.md (recommended)
rtk-windows init -g --opencode # OpenCode plugin (instead of Claude Code)
rtk-windows init -g --auto-patch # Non-interactive (CI/CD)
rtk-windows init -g --hook-only # Hook only, no RTK.md
rtk-windows init --show # Verify installationAfter install, restart Claude Code.
rtk-windows in this fork is Windows-native. Use PowerShell/cmd with native hook commands:
# 1. Download and extract rtk-windows-x86_64-pc-windows-msvc.zip from releases
# 2. Add rtk-windows.exe to your PATH
# 3. Initialize
rtk-windows init -g
# 4. Use commands (hook can auto-rewrite in supported agents)
rtk-windows cargo test
rtk-windows git statusImportant: Do not double-click rtk-windows.exe — it is a CLI tool that prints usage and exits immediately. Always run it from a terminal (Command Prompt, PowerShell, or Windows Terminal).
| Feature | Native Windows |
|---|---|
| Filters (cargo, git, etc.) | Full |
| Auto-rewrite hook | Full (agent-dependent) |
rtk-windows init -g |
Hook mode |
rtk-windows gain / analytics |
Full |
rtk-windows supports 13 AI coding tools. Each integration rewrites shell commands to rtk-windows equivalents for 60-90% token savings where the agent supports command interception.
| Tool | Install | Method |
|---|---|---|
| Claude Code | rtk-windows init -g |
PreToolUse hook |
| GitHub Copilot (VS Code) | rtk-windows init -g --copilot |
PreToolUse hook — transparent rewrite |
| GitHub Copilot CLI | rtk-windows init -g --copilot |
PreToolUse deny-with-suggestion (CLI limitation) |
| Cursor | rtk-windows init -g --agent cursor |
preToolUse hook (hooks.json) |
| Gemini CLI | rtk-windows init -g --gemini |
BeforeTool hook |
| Codex | rtk-windows init -g --codex |
AGENTS.md + RTK.md instructions |
| Windsurf | rtk-windows init --agent windsurf |
.windsurfrules (project-scoped) |
| Cline / Roo Code | rtk-windows init --agent cline |
.clinerules (project-scoped) |
| OpenCode | rtk-windows init -g --opencode |
Plugin TS (tool.execute.before) |
| OpenClaw | openclaw plugins install ./openclaw |
Plugin TS (before_tool_call) |
| Hermes | rtk-windows init --agent hermes |
Python plugin adapter (terminal command mutation via rtk-windows rewrite) |
| Mistral Vibe | Planned (#800) | Blocked on upstream |
| Kilo Code | rtk-windows init --agent kilocode |
.kilocode/rules/rtk-rules.md (project-scoped) |
| Google Antigravity | rtk-windows init --agent antigravity |
.agents/rules/antigravity-rtk-rules.md (project-scoped) |
The Hermes plugin source and tests live in hooks/hermes/; installed Hermes runtime files live under ~/.hermes/plugins/rtk-rewrite/. For agent-specific setup, see docs/guide/getting-started/.
%USERPROFILE%/.config/rtk/config.toml:
[hooks]
exclude_commands = ["curl", "playwright"] # skip rewrite for these
[tee]
enabled = true # save raw output on failure (default: true)
mode = "failures" # "failures", "always", or "never"When a command fails, rtk-windows saves the full unfiltered output so the LLM can read it without re-executing:
FAILED: 2/15 tests
[full output: ~/.local/share/rtk/tee/1707753600_cargo_test.log]
For the full config reference (all sections, env vars, per-project filters), see docs/guide/getting-started/.
rtk-windows init -g --uninstall # Remove hook, RTK.md, settings.json entry
cargo uninstall rtk-windows # Remove binary- docs/guide/ — full user guide (installation, agents, token optimization, analytics, configuration, troubleshooting)
- INSTALL.md — detailed installation reference
- ARCHITECTURE.md — system design and technical decisions
- CONTRIBUTING.md — contribution guide
- SECURITY.md — security policy
rtk-windows does not collect or transmit user usage data to remote services.
This is an independent Windows-focused fork. For enterprise or custom deployments, see CONTRIBUTING.md.
- Patrick Szymkowiak — Founder GitHub · LinkedIn
- Florian Bruniaux — Core contributor GitHub · LinkedIn
- Adrien Eppling — Core contributor GitHub · LinkedIn
Contributions welcome! Please open an issue or PR on GitHub.
Join the community on Discord.
Apache License 2.0 - see LICENSE for details.
Before publishing releases, complete the legal compliance checklist in docs/usage/APACHE_FORK_COMPLIANCE.md.
See DISCLAIMER.md.