# Compact npm output


# 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:

| Command | Raw tokens | Compacted | Saved |
| --- | --- | --- | --- |
| npm install | 95 | 35 | 63 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](/docs/reference/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](/docs/reference/built-in-filters) for the full set.

## Write your own for another command

The same approach works for any noisy command. The [.bsh language](/docs/concepts/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](/docs/getting-started/set-up-an-agent).
