mirror of
https://github.com/rtk-ai/rtk.git
synced 2026-09-19 07:33:17 +08:00
9620f66cd6
## Changes **New default mode (hook + RTK.md):** - Embed hook script in binary (include_str!) - Write hook + chmod +x with guards (rtk/jq check before set -e) - Write slim RTK.md (10 lines: meta commands only) - Add @RTK.md reference to CLAUDE.md - Print settings.json instructions (no auto-patch) **Migration:** - Auto-detect old <!-- rtk-instructions --> block - Remove 137-line block, preserve user content - Replace with @RTK.md reference **New CLI flags:** - `--claude-md`: Legacy mode (full injection) - `--hook-only`: Hook only, no RTK.md - Default (no flags): Hook + RTK.md (recommended) **Enhanced --show:** - Detect hook executable status (Unix) - Detect hook guards (rtk/jq) - Detect @RTK.md vs old block - Show slim vs legacy mode **Files added:** - hooks/rtk-rewrite.sh (embedded, with guards) - hooks/rtk-awareness.md (slim RTK.md content) **Token savings:** ~2000 tokens → ~10 tokens in context (99.5% reduction) Hook rewrites commands transparently (0 tokens overhead) **Tests:** 9 new tests, all passing (236 total) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
30 lines
964 B
Markdown
30 lines
964 B
Markdown
# RTK - Rust Token Killer
|
|
|
|
**Usage**: Token-optimized CLI proxy (60-90% savings on dev operations)
|
|
|
|
## Meta Commands (always use rtk directly)
|
|
|
|
```bash
|
|
rtk gain # Show token savings analytics
|
|
rtk gain --history # Show command usage history with savings
|
|
rtk discover # Analyze Claude Code history for missed opportunities
|
|
rtk proxy <cmd> # Execute raw command without filtering (for debugging)
|
|
```
|
|
|
|
## Installation Verification
|
|
|
|
```bash
|
|
rtk --version # Should show: rtk X.Y.Z
|
|
rtk gain # Should work (not "command not found")
|
|
which rtk # Verify correct binary
|
|
```
|
|
|
|
⚠️ **Name collision**: If `rtk gain` fails, you may have reachingforthejack/rtk (Rust Type Kit) installed instead.
|
|
|
|
## Hook-Based Usage
|
|
|
|
All other commands are automatically rewritten by the Claude Code hook.
|
|
Example: `git status` → `rtk git status` (transparent, 0 tokens overhead)
|
|
|
|
Refer to CLAUDE.md for full command reference.
|