Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e39ab46
feat: add hybrid command engine with safe execution
ahundt Feb 14, 2026
1e89219
fix: integrate hook script with hybrid engine and add env var toggles
ahundt Feb 14, 2026
a7ab1bd
fix(hook): use exit code 2 for blocked commands per Claude Code spec
ahundt Feb 14, 2026
0f26987
test(hook): add token waste context tests for pipes/redirects
ahundt Feb 14, 2026
4f71604
fix(test): serialize env var tests with mutex to prevent race conditions
ahundt Feb 14, 2026
0b69182
feat(safety): enable RTK_SAFE_COMMANDS by default
ahundt Feb 14, 2026
78a141d
perf(trash): minimize output for token efficiency
ahundt Feb 14, 2026
0234598
fix(safety): remove duplicate text in token waste block messages
ahundt Feb 14, 2026
4242c45
fix(trash): match rm error messages for consistency
ahundt Feb 14, 2026
308f9be
feat(safety): add git checkout and stash drop safety rules
ahundt Feb 14, 2026
0e11745
fix(cmd): fix safety false positives, Gemini protocol, and add Gemini…
ahundt Feb 14, 2026
5d28a4b
docs(gemini): add Gemini CLI setup docs, show_config() status, and ex…
ahundt Feb 14, 2026
0b57bae
fix(cmd): fix deadlock, rtk run -c flattening, sudo detection, and cl…
ahundt Feb 15, 2026
617230c
refactor(cmd): replace vague terminology, extract DRY patterns, tight…
ahundt Feb 15, 2026
883924b
feat(hook): consolidate Claude hook into Rust binary as `rtk hook cla…
ahundt Feb 15, 2026
4b6d25e
docs,scripts,init.rs: update all rtk-rewrite.sh references to rtk hoo…
ahundt Feb 15, 2026
42f6151
refactor(hooks): enforce I/O separation, consolidate guards, add Gemi…
ahundt Feb 15, 2026
cca575c
docs(hooks): document I/O policy scope, API spec compliance, add Gemi…
ahundt Feb 15, 2026
497d59e
feat(init): default to both Claude and Gemini, add platform selection…
ahundt Feb 15, 2026
6f25d80
docs(init): document multi-platform DRY architecture, simplify to --c…
ahundt Feb 15, 2026
f6773ef
fix(init): remove duplicate Gemini output messages
ahundt Feb 15, 2026
0105662
feat(init): make Gemini pathway match Claude (RTK.md + GEMINI.md + hook)
ahundt Feb 15, 2026
37c7c23
feat(init): make --claude and --gemini additive flags (simplified)
ahundt Feb 15, 2026
f27daec
feat(config): unified rule system with MD files, config CRUD, and dis…
ahundt Feb 15, 2026
610abf3
fix(warnings): resolve build warnings from branch changes
ahundt Feb 15, 2026
70668ab
docs(README), rules.rs: add Gemini CLI prominence, expand safety docs…
ahundt Feb 15, 2026
8d2674e
merge(master): integrate v0.16.0 with global option handling and lint…
ahundt Feb 15, 2026
3b442f5
merge(upstream): integrate v0.17.0 and v0.18.0 features
ahundt Feb 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 176 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ toml = "0.8"
chrono = "0.4"
thiserror = "1.0"
tempfile = "3"
trash = "5" # Built-in trash (cross-platform)
which = "7" # Find binaries in PATH (for exec module)
serde_yaml = "0.9" # YAML frontmatter in rule MD files

[dev-dependencies]

Expand Down
35 changes: 33 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ rtk gain # MUST show token savings, not "command not found"

```bash
rtk init -g
# → Installs hook to ~/.claude/hooks/rtk-rewrite.sh
# → Registers "rtk hook claude" in ~/.claude/settings.json
# → Creates ~/.claude/RTK.md (10 lines, meta commands only)
# → Adds @RTK.md reference to ~/.claude/CLAUDE.md
# → Prompts: "Patch settings.json? [y/N]"
Expand Down Expand Up @@ -111,6 +111,37 @@ rtk init # Creates ./CLAUDE.md with full RTK instructions (137 lines)

**Token savings**: Instructions loaded only for this project

### Gemini CLI Setup

**Best for: Gemini CLI users wanting the same token optimization**

```bash
rtk init --gemini
# → Registers "rtk hook gemini" in ~/.gemini/settings.json
# → Prompts: "Patch settings.json? [y/N]"
# → If yes: patches + creates backup (~/.gemini/settings.json.bak)

# Automated alternatives:
rtk init --gemini --auto-patch # Patch without prompting
rtk init --gemini --no-patch # Print manual instructions instead

# Verify installation
rtk init --show # Shows both Claude and Gemini hook status
```

**Manual setup** (if `rtk init --gemini` isn't available):
```json
// Add to ~/.gemini/settings.json
{
"hooks": {
"BeforeTool": [{
"matcher": "run_shell_command",
"hooks": [{ "type": "command", "command": "rtk hook gemini" }]
}]
}
}
```

### Upgrading from Previous Version

If you previously used `rtk init -g` with the old system (137-line injection):
Expand Down Expand Up @@ -195,7 +226,7 @@ rtk vitest run
rtk init -g --uninstall

# What gets removed:
# - Hook: ~/.claude/hooks/rtk-rewrite.sh
# - Hook: RTK entry from ~/.claude/settings.json
# - Context: ~/.claude/RTK.md
# - Reference: @RTK.md line from ~/.claude/CLAUDE.md
# - Registration: RTK hook entry from settings.json
Expand Down
Loading