Mix Compression logo

Mix Compression

Community
oliver-kriska
mix-compression

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.

Overview

Publisheroliver-kriska
Repositoryclaude-elixir-phoenix
Skill namemix-compression
Stars
555
Forks
40
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by oliver-kriska on GitHub. Read the source before you install it.

Installation

Install the Mix Compression AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/oliver-kriska/claude-elixir-phoenix.git /tmp/claude-elixir-phoenix
mkdir -p .claude/skills
cp -r /tmp/claude-elixir-phoenix/plugins/elixir-phoenix/skills/mix-compression .claude/skills/mix-compression
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Mix Compression in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Mix Compression on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Mix Compression is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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 — 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 projectsmix 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:

  • mix-test — short-circuits all-pass, preserves failure blocks + compile errors
  • mix-credo — collapses clean runs, preserves violation blocks
  • mix-dialyzer — drops PLT progress, keeps warnings + summary
  • mix-deps-get — collapses unchanged package lists
  • mix-ecto-migrate — strips compile prefix, short-circuits "already up"
  • mix-compile — handles parallel worker prefixes (N>) and MIX_ENV

Run this if the project has no .rtk/filters.toml yet:

bash
mkdir -p .rtk
cp "${CLAUDE_SKILL_DIR}/references/rtk-filters.toml" .rtk/filters.toml

Read both files if one already exists. Present a diff to the user. Merge only the filters they don't already have.

Step 3: Verify filters work

bash
rtk verify                       # runs all embedded [[tests.*]] fixtures
rtk verify --filter mix-test     # one filter only

Check that all report "passed". Flag and stop if any fail — usually means the user has a custom rtk version with regex differences.

Step 4: Confirm shell hook

Run rtk init zsh (or rtk init bash) to install the transparent rewrite hook that turns mix X into rtk mix X. Re-running is safe (idempotent). Skip this step and mix calls run unfiltered.

Customization

Add custom regex patterns to strip_lines_matching for project-specific noise sources (e.g., third-party hex deps spamming stack traces). See the inline example in ${CLAUDE_SKILL_DIR}/references/rtk-filters.toml lines 57-59.

What this is NOT

  • Not a hook — Claude Code's PostToolUse hooks fire after the tool result is in the transcript and cannot shrink it. rtk works at the subprocess layer (the only layer where transcript-shortening is possible).
  • Not project-analysis — the bundled filter set is universal across Phoenix projects. No mix.exs inspection needed.
  • Not telemetry — rtk has telemetry off by default (enabled = false in config.toml). Filters run locally, no data leaves the machine.

References

  • ${CLAUDE_SKILL_DIR}/references/rtk-filters.toml — bundled filter set
  • ${CLAUDE_SKILL_DIR}/references/install.md — rtk install + shell hook setup
  • rtk on GitHub

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Mix Compression AI skill do?

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.

Why use Mix Compression on TypingMind?

Because you install it once and use it with any model. Mix Compression is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Mix Compression in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/oliver-kriska/claude-elixir-phoenix/tree/main/plugins/elixir-phoenix/skills/mix-compression. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Mix Compression?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Mix Compression?

As many as you like. As long as a model supports skills, you can use Mix Compression with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Mix Compression AI skill free?

Yes. It is published on GitHub by oliver-kriska under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇