banish.shdocs
HomeGitHub
Guides / Compact npm output
View as Markdown

Compact npm output

When an agent runs npm install or npm run build, it gets back screens of deprecation warnings, funding notices, and progress - when all it needed was the added-packages line or the one error. banish compacts that output before it reaches Claude Code, Cursor, or any MCP agent.

The problem - npm output is noisy

npm has been verbose for years, and the noise is worse when a model is reading it: webpack configs, browserslist warnings, audit summaries, and compilation progress all count against the context window, and a long build log gets re-billed as input tokens on every following turn. The part the agent needs is usually two lines.

Before and after with banish

banish runs the real command and pipes the output through the node filter:

CommandRaw tokensCompactedSaved
npm install953563 percent

The filter drops the deprecation, funding, and audit notices and keeps the final summary - the added, removed, and changed counts. See the full spread across commands on the benchmarks page, reproducible with banish bench.

How the node filter works

The node filter ships with banish and compacts npm, yarn, and pnpm install and run output, plus npm test. Install output is reduced to its final summary lines; npm test keeps the failures and the expected-versus-received detail. If a filter fails, banish returns the raw output rather than swallowing it. See built-in filters for the full set.

Write your own for another command

The same approach works for any noisy command. The .bsh language lets you define a filter in about ten lines - no recompile. To start compacting npm output in your own agent, set up an agent.

Compact npm install output for LLM coding agents - fewer tokens - banish