Skip to content

oliver-kriska/claude-elixir-phoenix / targets/codex/skills/phx-mix-compression

phx-mix-compression

Verified

Reduce mix output noise (5-15% token savings) by installing rtk; Use when long mix output floods context.

FileKindSize
SKILL.mdskill md3.9 KB
references/install.mdmarkdown3.3 KB
references/rtk-filters.tomlconfig15.6 KB

references/install.md

View on GitHub
# Installing rtk

[rtk (Rust Token Killer)](https://github.com/rtk-ai/rtk) is a CLI proxy that
intercepts terminal commands, runs them, and filters output through TOML rules
before returning to the caller. For Claude Code, this means mix output gets
compressed *before* it reaches the transcript — the only architectural layer
where token savings are possible.

## Install

### macOS (homebrew)

```bash
brew install rtk-ai/tap/rtk
rtk --version    # verify (expect 0.39.0+)
```

### Other platforms

See the [rtk README](https://github.com/rtk-ai/rtk#install) for Linux and
manual install options.

## Shell hook (required)

rtk only intercepts commands when its shell hook is installed. The hook
rewrites `mix X` to `rtk mix X` transparently — no manual prefixing.

```bash
rtk init zsh  # or `rtk init bash`
```

This adds a hook to `~/.zshrc` (or `~/.bashrc`). Reload your shell:

```bash
exec $SHELL -l
```

Verify the hook works:

```bash
mix --help    # should run normally — rtk passes through commands without filters
```

If you see `rtk: command not found` or `mix` runs raw without filtering, the
hook didn't install. Check `~/.zshrc` for an `rtk init` block.

## Verify filters

After dropping filters into `.rtk/filters.toml`:

```bash
rtk verify                              # run all embedded [[tests.*]] fixtures
rtk verify --filter mix-test            # run fixtures for one filter only
rtk verify --filter mix-ash-codegen
```

Each filter should report all fixtures as passed. If any fail, the regex
patterns may not match your rtk version's regex engine — file an issue on
the rtk repo.

## Measure the win

```bash
rtk gain                  # token savings summary
rtk gain --history        # per-command breakdown
rtk cc-economics          # spending vs savings analysis
```

Run after a week of normal usage to see actual reduction. Expected ranges
for Phoenix projects:

| Command | Typical compression | Big win cases |
|---------|-------------------:|---------------|
| `mix test` (passing) | 90%+ | All-green runs collapse to one line |
| `mix credo` (clean) | 95%+ | Clean runs collapse to one line |
| `mix dialyzer` (clean) | 95%+ | PLT progress disappears |
| `mix compile` (no warnings) | 70-90% | Worker-prefix noise stripped |
| `mix test` (failures) | 10-30% | Failure blocks preserved verbatim |

## Telemetry

rtk has telemetry **disabled by default**. Verify in
`~/Library/Application Support/rtk/config.toml`:

```toml
[telemetry]
enabled = false
consent_given = false
```

Filters run locally. No command output, file paths, or filter content leaves
your machine.

## Disable / uninstall

To disable temporarily without uninstalling:

```bash
# Remove the rtk init line from ~/.zshrc, then:
exec $SHELL -l
```

To uninstall:

```bash
brew uninstall rtk
rm -rf ~/Library/Application\ Support/rtk
rm -rf .rtk    # in any project that has one
```

## Troubleshooting

**Filter not applying**: rtk only filters when the command matches a filter's
`match_command` regex. Check `rtk config show-filters` to list registered
filters in the current directory.

**Test fixtures fail after copying**: rtk uses Rust's regex crate which does
NOT support backreferences (`\1`, `\2`). If you wrote your own patterns, avoid
them.

**Want raw output for one command**: prefix with `command`:

```bash
command mix test    # bypasses rtk
```
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall