From cartoon
Save input tokens by wrapping CLI commands in `cartoon`. Use whenever running test suites (pytest, jest, unittest), JSON-emitting CLIs (aws, gh, kubectl with --output json), or any command expected to produce long, noisy output. Also covers installing cartoon when it is not present.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cartoon:cartoonThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`cartoon` is a wrapper binary. Prefix it onto a command and the output is
cartoon is a wrapper binary. Prefix it onto a command and the output is
re-rendered as TOON, a compact
format built for LLM consumption: test passes collapse to counts, failures
keep full actionable detail (location, message, user-code traceback).
Typical test runs shrink ~70%+. Exit codes and behavior are unchanged.
command -v cartoon
If missing, install with the first toolchain available, then verify:
uv tool install cartoon # preferred when uv exists
pipx install cartoon # Python fallback
npm install -g cartoon-wrap # Node (installs the `cartoon` binary)
cargo install cartoon # Rust
cartoon adapters # verify: lists the test-runner adapters
If no toolchain is available or installs need permission you don't have, skip wrapping — never block the user's actual task on cartoon.
Prefix only — all flags and args of the wrapped command stay verbatim:
cartoon pytest # instead of: pytest
cartoon npx jest src/ # any supported runner
cartoon aws ec2 describe-instances --output json # any JSON CLI → TOON
cartoon make # any noisy command: safe compression is automatic
cartoon ingest build.log # a log that already exists on disk
some-cmd | cartoon - # or piped in
When a command is noisy (a test run, a build, a JSON CLI), do NOT pipe it to
head/tail/grep to shrink the output. That is lossy in the wrong way: it
keeps an arbitrary slice (often the wrong one — a build's real error sits
mid-log while tail shows only BUILD FAILED) and the hook will not wrap a
piped command at all, so you lose cartoon entirely.
xcodebuild build … | tail -15 # WRONG: dumb cut, and wrapping is skipped
cartoon xcodebuild build … # RIGHT: signal kept, ~70% fewer tokens
Wrap first; if you still need a slice of the raw log afterward, use
cartoon logs grep … --last. Anything with a dedicated adapter (pytest, jest,
vitest, swift test/build, xcodebuild test/build, ruff, eslint, tsc) should
be run bare so the auto-wrap hook catches it — never behind a pipe.
Commands without a dedicated adapter still compress: the safe tier (ANSI,
progress, duplicate, blank collapse) applies automatically, and
--compress=aggressive adds lossy rules (log-level filtering, diagnostic
tables, error windowing) when the user wants deeper cuts. A net-savings
guard means worst case is byte-identical output — wrapping is never worse.
Read the result like a test report: summary has the counts; if
failed > 0, the failures[...] rows and traces section contain
everything needed to fix the code without rerunning unwrapped.
This file covers only the stable contract. For the current full set of flags, subcommands (stats, logs, …), and adapters, trust the binary over this document:
cartoon --help
Every wrapped run stores its complete raw stdout/stderr on disk and prints the location as the last line of the report:
raw_log: ~/.local/state/cartoon/runs/20260611-051415-342d
If the TOON summary dropped something you need (full tracebacks, warnings, print output), do NOT cat the whole file — that spends the tokens cartoon just saved. Search it instead:
cartoon logs grep "ERROR" --last -C 2 # matching lines + context, capped
Only read <raw_log path>/stdout.log in full when a targeted grep can't
answer the question.
cartoon pytest && deploy behaves exactly
like pytest && deploy. Check exit codes as usual.git rebase -i).git status, ls) — no savings to be had.cartoon --raw <cmd> or drop the prefix.--fast change how tests execute — only use them
when the user explicitly asks for faster runs, and rerun without them
before debugging any failure.After a session with several wrapped runs, cartoon stats shows
cumulative tokens saved — worth surfacing when the user asks about
cost or token usage.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub abhijitbansal/cartoon --plugin cartoon