Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ SHARED utils.rs Helpers N/A ✓
tee.rs Full output recovery N/A ✓
```

**Total: 57 modules** (38 command modules + 19 infrastructure modules)
**Total: 58 modules** (39 command modules + 19 infrastructure modules)

### Module Count Breakdown

Expand Down Expand Up @@ -1488,4 +1488,4 @@ When implementing a new command, consider:

**Last Updated**: 2026-02-22
**Architecture Version**: 2.2
**rtk Version**: 0.27.1
**rtk Version**: 0.27.2
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This is a fork with critical fixes for git argument parsing and modern JavaScrip

**Verify correct installation:**
```bash
rtk --version # Should show "rtk 0.27.1" (or newer)
rtk --version # Should show "rtk 0.27.2" (or newer)
rtk gain # Should show token savings stats (NOT "command not found")
```

Expand Down
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

---

rtk filters and compresses command outputs before they reach your LLM context. Single Rust binary, zero dependencies, <10ms overhead.
rtk filters and compresses command outputs before they reach your LLM context. Works with any AI coding agent — just prefix commands with `rtk`. Single binary, zero dependencies, <10ms overhead.

## Token Savings (30-min Claude Code Session)
## Token Savings (30-min Coding Session)

| Operation | Frequency | Standard | rtk | Savings |
|-----------|-----------|----------|-----|---------|
Expand Down Expand Up @@ -90,31 +90,36 @@ Download from [releases](https://github.com/rtk-ai/rtk/releases):
### Verify Installation

```bash
rtk --version # Should show "rtk 0.27.1"
rtk --version # Should show "rtk 0.27.2"
rtk gain # Should show token savings stats
```

> **Name collision warning**: Another project named "rtk" (Rust Type Kit) exists on crates.io. If `rtk gain` fails, you have the wrong package. Use `cargo install --git` above instead.

## Quick Start

**Use directly with any agent:**
```bash
# 1. Install hook for Claude Code (recommended)
rtk init --global
# Follow instructions to register in ~/.claude/settings.json
rtk git status # Compact status
rtk cargo test # Failures only (-90%)
rtk grep "pattern" . # Grouped results
```

# 2. Restart Claude Code, then test
git status # Automatically rewritten to rtk git status
**Or auto-rewrite with Claude Code:**
```bash
rtk init --global # Install hook
# Restart Claude Code — commands rewrite automatically
git status # → rtk git status (transparent)
```

The hook transparently rewrites commands (e.g., `git status` -> `rtk git status`) before execution. Claude never sees the rewrite, it just gets compressed output.
RTK is a standalone binary. The Claude Code hook auto-rewrites commands, but any agent works by prefixing `rtk`.

## How It Works

```
Without rtk: With rtk:

Claude --git status--> shell --> git Claude --git status--> RTK --> git
Agent --git status--> shell --> git Agent --git status--> RTK --> git
^ | ^ | |
| ~2,000 tokens (raw) | | ~200 tokens | filter |
+-----------------------------------+ +------- (filtered) ---+----------+
Expand Down Expand Up @@ -221,11 +226,18 @@ rtk gain --graph # ASCII graph (last 30 days)
rtk gain --history # Recent command history
rtk gain --daily # Day-by-day breakdown
rtk gain --all --format json # JSON export for dashboards
```

rtk discover # Find missed savings opportunities
_Claude Code only_ (reads `~/.claude/projects/` session files):
```bash
rtk discover # Find missed savings opportunities in session history
rtk discover --all --since 7 # All projects, last 7 days
rtk learn # Learn CLI corrections from error history
rtk cc-economics # Token cost analysis by Claude Code session
```

> **Coming soon**: `rtk discover` for Aider, Cline, Goose, and shell history (any agent). Follow [#273](https://github.com/rtk-ai/rtk/issues/273).

## Global Flags

```bash
Expand Down Expand Up @@ -262,9 +274,11 @@ test utils::test_format ... ok test_overflow: panic at utils.rs:18
...
```

## Auto-Rewrite Hook
## Auto-Rewrite Hook (Claude Code)

RTK works with any agent by prefixing commands with `rtk`. The hook below is specific to Claude Code — it makes the rewrite automatic.

The most effective way to use rtk. The hook transparently intercepts Bash commands and rewrites them to rtk equivalents before execution.
The most effective way to use rtk with Claude Code. The hook transparently intercepts Bash commands and rewrites them to rtk equivalents before execution.

**Result**: 100% rtk adoption across all conversations and subagents, zero token overhead.

Expand Down
33 changes: 25 additions & 8 deletions README_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

---

rtk filtra y comprime las salidas de comandos antes de que lleguen al contexto de tu LLM. Binario Rust unico, cero dependencias, <10ms de overhead.
rtk filtra y comprime las salidas de comandos antes de que lleguen al contexto de tu LLM. Compatible con cualquier agente de codigo IA — solo prefija los comandos con `rtk`. Binario unico, cero dependencias, <10ms de overhead.

## Ahorro de tokens (sesion de 30 min en Claude Code)
## Ahorro de tokens (sesion de desarrollo de 30 min)

| Operacion | Frecuencia | Estandar | rtk | Ahorro |
|-----------|------------|----------|-----|--------|
Expand Down Expand Up @@ -75,20 +75,28 @@ rtk gain # Debe mostrar estadisticas de ahorro

## Inicio rapido

**Uso directo con cualquier agente:**
```bash
# 1. Instalar hook para Claude Code (recomendado)
rtk init --global
rtk git status # Estado compacto
rtk cargo test # Solo fallos (-90%)
rtk grep "pattern" . # Resultados agrupados
```

# 2. Reiniciar Claude Code, luego probar
git status # Automaticamente reescrito a rtk git status
**O reescritura automatica con Claude Code:**
```bash
rtk init --global # Instalar hook
# Reiniciar Claude Code — los comandos se reescriben automaticamente
git status # → rtk git status (transparente)
```

RTK es un binario autonomo. El hook de Claude Code reescribe los comandos automaticamente, pero cualquier agente funciona prefijando `rtk`.

## Como funciona

```
Sin rtk: Con rtk:

Claude --git status--> shell --> git Claude --git status--> RTK --> git
Agent --git status--> shell --> git Agent --git status--> RTK --> git
^ | ^ | |
| ~2,000 tokens (crudo) | | ~200 tokens | filtro |
+-----------------------------------+ +------- (filtrado) ---+----------+
Expand Down Expand Up @@ -139,9 +147,18 @@ rtk ruff check # Lint Python (-80%)
```bash
rtk gain # Estadisticas de ahorro
rtk gain --graph # Grafico ASCII (30 dias)
rtk discover # Descubrir ahorros perdidos
```

_Solo Claude Code_ (lee archivos de sesion de `~/.claude/projects/`):
```bash
rtk discover # Oportunidades perdidas en el historial de sesiones
rtk discover --all --since 7 # Todos los proyectos, ultimos 7 dias
rtk learn # Correcciones CLI aprendidas del historial de errores
rtk cc-economics # Analisis de costes de tokens por sesion Claude Code
```

> **Proximamente**: `rtk discover` para Aider, Cline, Goose e historial shell (cualquier agente). Seguir [#273](https://github.com/rtk-ai/rtk/issues/273).

## Documentacion

- **[TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md)** - Resolver problemas comunes
Expand Down
34 changes: 24 additions & 10 deletions README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

---

rtk filtre et compresse les sorties de commandes avant qu'elles n'atteignent le contexte de votre LLM. Binaire Rust unique, zero dependance, <10ms d'overhead.
rtk filtre et compresse les sorties de commandes avant qu'elles n'atteignent le contexte de votre LLM. Compatible avec tous les agents de code IA — il suffit de prefixer les commandes avec `rtk`. Binaire unique, zero dependance, <10ms d'overhead.

## Economies de tokens (session Claude Code de 30 min)
## Economies de tokens (session de developpement de 30 min)

| Operation | Frequence | Standard | rtk | Economies |
|-----------|-----------|----------|-----|-----------|
Expand Down Expand Up @@ -82,23 +82,28 @@ rtk gain # Doit afficher les statistiques d'economies

## Demarrage rapide

**Utilisation directe avec n'importe quel agent :**
```bash
# 1. Installer le hook pour Claude Code (recommande)
rtk init --global
# Suivre les instructions pour enregistrer dans ~/.claude/settings.json
rtk git status # Statut compact
rtk cargo test # Echecs uniquement (-90%)
rtk grep "pattern" . # Resultats groupes
```

# 2. Redemarrer Claude Code, puis tester
git status # Automatiquement reecrit en rtk git status
**Ou reecriture automatique avec Claude Code :**
```bash
rtk init --global # Installer le hook
# Redemarrer Claude Code — les commandes sont reecrites automatiquement
git status # → rtk git status (transparent)
```

Le hook reecrit de maniere transparente les commandes (ex: `git status` -> `rtk git status`) avant execution.
RTK est un binaire autonome. Le hook Claude Code reecrit les commandes automatiquement, mais n'importe quel agent fonctionne en prefixant `rtk`.

## Comment ca marche

```
Sans rtk : Avec rtk :

Claude --git status--> shell --> git Claude --git status--> RTK --> git
Agent --git status--> shell --> git Agent --git status--> RTK --> git
^ | ^ | |
| ~2 000 tokens (brut) | | ~200 tokens | filtre |
+-----------------------------------+ +------- (filtre) -----+----------+
Expand Down Expand Up @@ -162,9 +167,18 @@ rtk kubectl pods # Pods compacts
```bash
rtk gain # Statistiques d'economies
rtk gain --graph # Graphique ASCII (30 jours)
rtk discover # Trouver les economies manquees
```

_Claude Code uniquement_ (lit les fichiers de session `~/.claude/projects/`) :
```bash
rtk discover # Opportunites d'economies manquees dans l'historique
rtk discover --all --since 7 # Tous les projets, 7 derniers jours
rtk learn # Corrections CLI depuis l'historique d'erreurs
rtk cc-economics # Analyse des couts tokens par session Claude Code
```

> **Bientot** : `rtk discover` pour Aider, Cline, Goose et l'historique shell (tous agents). Suivre [#273](https://github.com/rtk-ai/rtk/issues/273).

## Configuration

```toml
Expand Down
33 changes: 25 additions & 8 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

---

rtk はコマンド出力を LLM コンテキストに届く前にフィルタリング・圧縮します。単一の Rust バイナリ、依存関係ゼロ、オーバーヘッド 10ms 未満。
rtk はコマンド出力を LLM コンテキストに届く前にフィルタリング・圧縮します。すべての AI コーディングエージェントに対応し、コマンドの前に `rtk` を付けるだけで使えます。単一バイナリ、依存関係ゼロ、オーバーヘッド 10ms 未満。

## トークン節約(30分の Claude Code セッション
## トークン節約(30分のコーディングセッション

| 操作 | 頻度 | 標準 | rtk | 節約 |
|------|------|------|-----|------|
Expand Down Expand Up @@ -75,20 +75,28 @@ rtk gain # トークン節約統計が表示されるはず

## クイックスタート

**任意のエージェントで直接使用:**
```bash
# 1. Claude Code 用フックをインストール(推奨)
rtk init --global
rtk git status # コンパクトなステータス
rtk cargo test # 失敗のみ (-90%)
rtk grep "pattern" . # グループ化された結果
```

# 2. Claude Code を再起動してテスト
git status # 自動的に rtk git status に書き換え
**または Claude Code で自動書き換え:**
```bash
rtk init --global # フックをインストール
# Claude Code を再起動 — コマンドが自動的に書き換えられます
git status # → rtk git status(透過的)
```

RTK はスタンドアロンバイナリです。Claude Code フックはコマンドを自動書き換えしますが、`rtk` をプレフィックスとして付けることで任意のエージェントで動作します。

## 仕組み

```
rtk なし: rtk あり:

Claude --git status--> shell --> git Claude --git status--> RTK --> git
Agent --git status--> shell --> git Agent --git status--> RTK --> git
^ | ^ | |
| ~2,000 tokens(生出力) | | ~200 tokens | フィルタ |
+-----------------------------------+ +------- (圧縮済)----+----------+
Expand Down Expand Up @@ -139,9 +147,18 @@ rtk ruff check # Python リント(-80%)
```bash
rtk gain # 節約統計
rtk gain --graph # ASCII グラフ(30日間)
rtk discover # 見逃した節約機会を発見
```

_Claude Code 専用_(`~/.claude/projects/` セッションファイルを読み取ります):
```bash
rtk discover # セッション履歴から見逃した節約機会を発見
rtk discover --all --since 7 # 全プロジェクト、過去7日間
rtk learn # エラー履歴から CLI 修正を学習
rtk cc-economics # Claude Code セッション別トークンコスト分析
```

> **近日公開**:Aider、Cline、Goose、シェル履歴(全エージェント対応)で `rtk discover` をサポート予定。[#273](https://github.com/rtk-ai/rtk/issues/273) をフォロー。

## ドキュメント

- **[TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md)** - よくある問題の解決
Expand Down
33 changes: 25 additions & 8 deletions README_ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

---

rtk는 명령 출력이 LLM 컨텍스트에 도달하기 전에 필터링하고 압축합니다. 단일 Rust 바이너리, 의존성 없음, 10ms 미만의 오버헤드.
rtk는 명령 출력이 LLM 컨텍스트에 도달하기 전에 필터링하고 압축합니다. 모든 AI 코딩 에이전트와 호환되며, 명령 앞에 `rtk`를 붙이기만 하면 됩니다. 단일 바이너리, 의존성 없음, 10ms 미만의 오버헤드.

## 토큰 절약 (30분 Claude Code 세션)
## 토큰 절약 (30분 코딩 세션)

| 작업 | 빈도 | 표준 | rtk | 절약 |
|------|------|------|-----|------|
Expand Down Expand Up @@ -75,20 +75,28 @@ rtk gain # 토큰 절약 통계 표시되어야 함

## 빠른 시작

**모든 에이전트에서 직접 사용:**
```bash
# 1. Claude Code용 hook 설치 (권장)
rtk init --global
rtk git status # 컴팩트 상태
rtk cargo test # 실패만 표시 (-90%)
rtk grep "pattern" . # 그룹화된 결과
```

# 2. Claude Code 재시작 후 테스트
git status # 자동으로 rtk git status로 재작성
**또는 Claude Code로 자동 재작성:**
```bash
rtk init --global # hook 설치
# Claude Code 재시작 — 명령이 자동으로 재작성됩니다
git status # → rtk git status (투명)
```

RTK는 독립 실행형 바이너리입니다. Claude Code hook이 명령을 자동으로 재작성하지만, `rtk`를 접두사로 붙이면 어떤 에이전트에서도 작동합니다.

## 작동 원리

```
rtk 없이: rtk 사용:

Claude --git status--> shell --> git Claude --git status--> RTK --> git
Agent --git status--> shell --> git Agent --git status--> RTK --> git
^ | ^ | |
| ~2,000 tokens (원본) | | ~200 tokens | 필터 |
+-----------------------------------+ +------- (필터링) -----+----------+
Expand Down Expand Up @@ -139,9 +147,18 @@ rtk ruff check # Python 린트 (-80%)
```bash
rtk gain # 절약 통계
rtk gain --graph # ASCII 그래프 (30일)
rtk discover # 놓친 절약 기회 발견
```

_Claude Code 전용_ (`~/.claude/projects/` 세션 파일 읽기):
```bash
rtk discover # 세션 기록에서 놓친 절약 기회 발견
rtk discover --all --since 7 # 모든 프로젝트, 최근 7일
rtk learn # 오류 기록에서 CLI 수정 학습
rtk cc-economics # Claude Code 세션별 토큰 비용 분석
```

> **출시 예정**: Aider, Cline, Goose 및 셸 히스토리(모든 에이전트)에서 `rtk discover` 지원. [#273](https://github.com/rtk-ai/rtk/issues/273) 팔로우.

## 문서

- **[TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md)** - 일반적인 문제 해결
Expand Down
Loading
Loading