Install LogStrip CLI
In 30 seconds. LogStrip is a command-line tool that cuts a noisy log down to the lines an AI agent needs. It runs offline, needs no model, and gives the same output for the same input.
npx -y logstrip raw.log --statsWhat you get:
- A shorter log. Routine
INFOandDEBUGlines, passing tests, progress output and repeats are removed. Errors, the first occurrence of each event, context and your stack frames stay. - A count, not a guess. Repeats fold into
[x2] line, and--statsprints the tokens saved. - Safer to paste. Tokens, passwords, keys and connection strings are masked.
- Nothing to set up. No model and no account. Compression needs no network.
Before and after:
[INFO] boot ok[ERROR] request 123e4567-e89b-12d3-a456-426614174000 failed[ERROR] request 987e6543-e21b-42d3-b456-526614174111 failed at lib (/repo/node_modules/pkg/index.js:1:1)
# logstrip raw.log[x2] [ERROR] request [ID] failed[... hidden internal library frames ...]How much you save depends on how noisy the log is. See Benchmarks for measured results, and Why LogStrip for what is kept and what is dropped.
1. Install the CLI
Section titled “1. Install the CLI”LogStrip requires Node.js 22+.
npm install --global logstripThe package registers the logstrip binary.
Don’t want a global install? Use npx:
npx -y logstrip raw.log -o clean.log2. Trim your first log
Section titled “2. Trim your first log”Three equally valid ways to feed the parser:
# File in, file outlogstrip raw.log -o clean.log
# Unix pipecat raw.log | logstrip > clean.log
# File in, compressed log to stdout, stats to stderrlogstrip raw.log --stats > clean.logPowerShell:
Get-Content raw.log | logstrip > clean.loglogstrip raw.log --stats > clean.logThe default aggressiveness is auto, which starts at high and adapts to the
log while running every detection booster automatically. Override with
-a low|medium|high|aggressive for a fixed level.
3. Wire it into a script
Section titled “3. Wire it into a script”#!/usr/bin/env bashset -euo pipefail
npm test > raw.log 2>&1 || true # keep the log even on failurelogstrip raw.log -o clean.log --statsyour-ai-agent analyze --file clean.log4. Read the stats
Section titled “4. Read the stats”When --stats is set the CLI prints a compact report to stderr:
LogStrip compression report input lines : 4128 output lines : 312 dropped lines : 3640 duplicate lines : 87 hidden internal : 89 input tokens : 21450 output tokens : 4138 saved tokens : 17312 savings : 80.71% output path : clean.logNeed the same report machine-readable? Use --json (requires --output):
logstrip raw.log -o clean.log --json5. (Optional) Use it in GitHub Actions
Section titled “5. (Optional) Use it in GitHub Actions”If you do not want a run: step calling the CLI, the same engine is exposed
as a thin GitHub Action wrapper. See GitHub Action for
the full contract.
- name: Run tests and keep raw logs run: npm test > raw_logs.txt 2>&1 || true
- name: Compress logs with LogStrip uses: mrwogu/logstrip@v2 id: logstrip with: log-path: raw_logs.txt aggressiveness: auto
- name: Analyze compact logs run: your-ai-agent analyze --file "${{ steps.logstrip.outputs.output-path }}"Next steps
Section titled “Next steps”- Why LogStrip - what it keeps, what it drops, when not to use it.
- Benchmarks - measured savings for every test fixture.
- CLI Reference - every flag, exit code, JSON schema.
- Configuration - custom sources and patterns via
.logstrip.yml. - Agent Plugins - drop-in instructions for Claude Code, Copilot, Cursor, Codex, Droid, and OpenCode.
- Examples - real-world CI recipes.
Want to hack on LogStrip itself? See CONTRIBUTING.md.