> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/rtk-ai/rtk/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands Overview

> Complete guide to RTK's token-optimized command categories

## What is RTK?

RTK (Rust Token Killer) is a high-performance CLI proxy that minimizes LLM token consumption by filtering and compressing command outputs. It achieves **60-90% token savings** on common development operations through:

* **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

## Command Categories

> **[File Operations](https://mintlify.com/rtk-ai/rtk/commands/file-operations.md)**
>
> Directory listing, file reading, search, and find operations

> **[Git](https://mintlify.com/rtk-ai/rtk/commands/git.md)**
>
> All git operations with ultra-compact output

> **[Testing](https://mintlify.com/rtk-ai/rtk/commands/testing.md)**
>
> Test runners showing failures only (90% savings)

> **[JavaScript/TypeScript](https://mintlify.com/rtk-ai/rtk/commands/javascript.md)**
>
> Modern JS stack: ESLint, TypeScript, Next.js, Vitest, Playwright

> **[Python](https://mintlify.com/rtk-ai/rtk/commands/python.md)**
>
> Ruff, pytest, pip, mypy with JSON/text parsers

> **[Go](https://mintlify.com/rtk-ai/rtk/commands/go.md)**
>
> Go test, build, vet, golangci-lint with NDJSON streaming

> **[Containers](https://mintlify.com/rtk-ai/rtk/commands/containers.md)**
>
> Docker and Kubernetes with compact container lists

> **[GitHub](https://mintlify.com/rtk-ai/rtk/commands/github.md)**
>
> GitHub CLI with compact PR/issue/run views

## Global Flags

All RTK commands support these global flags:

**-v, --verbose** `flag`

Increase verbosity level. Use multiple times for more detail:

* `-v`: Basic debug info
* `-vv`: Detailed execution traces
* `-vvv`: Maximum verbosity

**-u, --ultra-compact** `flag`

Enable ultra-compact mode:

* ASCII icons instead of Unicode emoji
* Inline format with minimal whitespace
* Extra token savings (10-15% on top of default)

## Common Patterns

### Exit Code Preservation

All RTK commands preserve the original command's exit code, making them safe for CI/CD:

```bash theme={null}
# CI pipeline example
rtk cargo test || exit 1
rtk go test ./... || exit 1
rtk pytest || exit 1
```

### Fallback to Raw Commands

If RTK's filter fails, it automatically falls back to raw command execution:

```bash theme={null}
# If filter crashes, you still get output
rtk git status  # Falls back to raw git status on error
```

### Tee Output Recovery

On command failure, RTK saves full unfiltered output to `~/.local/share/rtk/tee/` so LLMs can read details without re-running:

```bash theme={null}
rtk cargo test  # Fails
# Output: "✗ 2 tests failed"
# [full output: ~/.local/share/rtk/tee/1707753600_cargo_test.log]
```

LLMs can then read the tee file instead of re-executing the test suite.

### Proxy Mode

Bypass RTK filtering but still track usage metrics:

```bash theme={null}
rtk proxy git log --oneline -20  # Full output, tracked in metrics
rtk proxy curl https://api.example.com  # Works with any command
```

## Token Savings by Operation

Typical 30-minute Claude Code session:

| Operation | Frequency | Standard | RTK | Savings |
| - | - | - | - | - |
| `ls` / `tree` | 10× | 2,000 | 400 | **-80%** |
| `cat` / `read` | 20× | 40,000 | 12,000 | **-70%** |
| `grep` / `rg` | 8× | 16,000 | 3,200 | **-80%** |
| `git status` | 10× | 3,000 | 600 | **-80%** |
| `git diff` | 5× | 10,000 | 2,500 | **-75%** |
| `npm test` | 5× | 25,000 | 2,500 | **-90%** |
| `pytest` | 4× | 8,000 | 800 | **-90%** |
| `docker ps` | 3× | 900 | 180 | **-80%** |
| **Total** | | **\~118,000** | **\~23,900** | **-80%** |

## Performance Targets

RTK maintains strict performance constraints:

* **Startup time**: \<10ms (zero-overhead CLI experience)
* **Memory**: \<5MB resident
* **Binary size**: \<5MB stripped
* **Token savings**: 60-90% across all commands

## Next Steps

> **[File Operations](https://mintlify.com/rtk-ai/rtk/commands/file-operations.md)**
>
> Start with file operations (ls, read, grep, find)

> **[Git Commands](https://mintlify.com/rtk-ai/rtk/commands/git.md)**
>
> Explore git command optimizations


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.