shell-output-compaction
Installation
SKILL.md
Shell Output Compaction
Save tokens by shrinking command output before it reaches the model.
Core Principle
The cheapest output is the output you never ask the shell to print. Shape commands so they emit the smallest artifact that still answers the question.
Command Shaping Rules
- Ask what exact signal is needed before running a command: status, count, match, diff, failing test, or tail of logs.
- Prefer
rg, exact paths, exact symbols, and line-numbered slices over broad directory dumps. - Prefer match-only, filename-only, or count-style results over full content when triaging.
- Read files through targeted ranges or symbol searches before opening them fully.
- Prefer
git diff --stat, file-scoped diffs, or changed-hunk views before whole diffs. - Prefer error-only, warning-only, or final-summary build output before full logs.
- Prefer
head,tail, and bounded excerpts over raw multi-screen output. - When the same command is rerun, capture only the new failure, new diff, or new tail.