# Mix Compression

Reduce mix output noise (5-15% token savings) by installing rtk filters that compress...

- Repository: https://github.com/oliver-kriska/claude-elixir-phoenix (572 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add oliver-kriska/claude-elixir-phoenix --skill mix-compression -g -a claude-code -y`
Codex: `npx skills add oliver-kriska/claude-elixir-phoenix --skill mix-compression -g -a codex -y`
Cursor: `npx skills add oliver-kriska/claude-elixir-phoenix --skill mix-compression -g -a cursor -y`
Gemini CLI: `npx skills add oliver-kriska/claude-elixir-phoenix --skill mix-compression -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add oliver-kriska/claude-elixir-phoenix`

## Description

Reduce mix output noise (5-15% token savings) by installing rtk filters that compress mix test/credo/dialyzer/compile output before it reaches Claude. Use when long mix output floods context.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Mix Output Compression

Mix commands (`mix test`, `mix credo`, `mix dialyzer`, `mix compile`) emit
verbose, repetitive output that consumes context fast. This skill installs
[rtk](https://github.com/rtk-ai/rtk), a CLI proxy that filters tool output
**before it lands in the transcript**.

The filters short-circuit happy paths to a single line (`mix test: all pass`)
while preserving full failure blocks, compile errors, and stack traces. Net win:
5-15% per-session token reduction on mix-heavy workflows.

## When to use

- **Long sessions**, `/phx:work` or `/phx:full` hitting context limits from mix output
- **Debugging loops**, `/phx:investigate` retrying `mix compile`/`mix test` repeatedly
- **Dialyzer-heavy projects**, `mix dialyzer` output dominates the transcript

## Iron Laws

1. **NEVER strip critical signals**, compile errors (`** (CompileError)`,
   `== Compilation error in`), test failures (`FAILURES`, `0 failures`, preserved
   even on short-circuit), dialyzer warnings, and stack traces with `file:line` MUST
   pass through unchanged
2. **Verify after install**, run `rtk verify` (or `rtk verify --filter mix-test`) to
   confirm the bundled test fixtures pass before declaring success
3. **Never overwrite existing `.rtk/filters.toml`**, diff and merge instead

## Workflow

### Step 1: Detect rtk

```bash
which rtk && rtk --version
```

Read `${CLAUDE_SKILL_DIR}/references/install.md` if rtk is missing, covers
homebrew install + shell hook setup.

### Step 2: Seed `.rtk/filters.toml`

Reference filters live at `${CLAUDE_SKILL_DIR}/references/rtk-filters.toml`. Six
production-tested filters covering:

The rest: https://github.com/oliver-kriska/claude-elixir-phoenix/blob/HEAD/plugins/elixir-phoenix/skills/mix-compression/SKILL.md
