ansi-strip-logger
Installation
SKILL.md
ANSI Escape Sequence Stripping & Output Normalization
Overview
When CLI tools and test runners (Jest, Pytest, Webpack, Docker, Cargo) execute in a terminal, they emit rich ANSI Escape Sequences (e.g. \x1b[32m, \x1b[0m, \033[2K) to render colors, bold text, spinners, and cursor movements.
LLM byte-pair tokenizers cannot parse escape codes semantically; instead, they fragment each escape string into 4 to 8 individual tokens (\, x1b, [, 32, m). A simple 50-line test run can bloat from 500 clean tokens to over 2,500 noisy tokens, degrading model reasoning and wasting context budget.
The ANSI Stripping Protocol intercepts and sanitizes stdout/stderr streams before they are injected into agent context windows.