Skip to content

LogStrip โ€“ Log Compression CLI for AI Agents

cli compression for agentic pipelines

smaller logs. cleaner agents.

A zero-dependency CLI that turns chaotic server logs, build pipelines, vulnerability scanners, and container workloads into compact, high-signal context that AI agents can actually reason about.

install the cli agent plugins

raw.log โ†’ logstrip.log
[INFO] boot ok
[ERROR] request 123e4567-e89b-12d3-a456-426614174000 failed
[ERROR] request 987e6543-e21b-42d3-b456-526614174111 failed
[x2] [ERROR] request [ID] failed

705+ detected ecosystems

your stack, covered

Trivy Snyk Semgrep nginx PostgreSQL Redis AWS Lambda Datadog Sentry Docker Kubernetes Terraform Kafka Elasticsearch OpenTelemetry Prometheus Grafana GitHub Actions GitLab CI Cloudflare Spring Boot Django Express Next.js Jenkins Helm MongoDB Vitest Jest Pytest Playwright npm Cargo Gradle Webpack Fastify NestJS React Native Flutter Vercel Argo Go test pnpm Cypress Bun Maven Electron Bazel Tekton yarn

view all 705+ sources โ†’ ยท add your own

npm i -g logstrip

one install away

Installs one CLI with two aliases: logstrip (short) and logstrip (explicit). Same behavior, same binary, zero runtime dependencies on the hot path.

stream

gigabyte-safe

Built on Node streams and readline, so multi-gigabyte logs never have to fit in memory.

100/100

coverage gate

Statement, branch, function, and line coverage are pinned to 100% across the parser, CLI, and Action.

unix

pipe-native

cat raw.log | logstrip > clean.log. Stats on stderr, JSON on stdout (with --output), exit codes 0/1/2.

hybrid context engine

advanced detection, not regex-only filtering

LogStrip scores each sanitized line, keeps nearby context, dampens repeated spam, folds near-identical diagnostics with volatile values, and hides internal framework frames: compact incident narrative, not a noisy transcript.

01Score signals from log level, JSON severity, container failures, scanner findings, package managers, diagnostic keywords, and stack frames.

02Promote context with a before/after window so setup lines near the failure survive even when they are not errors themselves.

03Dampen repeats with TF-IDF-style frequency tracking, then fold adjacent diagnostic variants into [xN] summaries.

04Summarize deltas by listing only differing key=value values when repeated events share the same shape.

05Collapse internals by replacing low-value framework/runtime stack frames with one marker while preserving app frames.

06Detect sources across 700+ ecosystems so JSON reports can tell agents what kind of log they are reading.

why LogStrip exists

DevOps, SysOps, and GitOps teams often paste entire raw logs into AI agents during incident response. LLMs are bad at high-noise dumps. LogStrip eases that pain and reduces token costs.

problem

too much noise

Raw logs mix signal with thousands of low-value lines and repeated frames.

impact

weaker ai answers

Large noisy prompts dilute root-cause context and inflate LLM spend.

outcome

compact signal

LogStrip produces deterministic, AI-ready logs that are cheaper to analyze.

validation that catches regressions

snapshotsGolden outputs lock down exact compression behavior, including sanitization, duplicate-shaped grouping, context windows, and hidden internal frames.

smoke corpusFixtures cover noisy server logs, CI failures, scanner findings, container crashes, Spring Boot stacks, nginx upstream failures, and Node runtime crashes.

100%TypeScript units and smoke tests run under a strict 100/100/100/100 coverage gate before release.

why teams keep it in every pipeline

ops-firstBuilt for incident workflows where raw logs hit AI assistants under pressure.

700+Automatic source awareness across CI, runtimes, scanners, infra, and cloud logs.

deterministicSnapshot-tested output and a strict 100/100/100/100 quality gate.

cheaper promptsLower token usage per incident while keeping root-cause context intact.

plugins for every listed agent
install for your agent

cli in one line

logstrip and logstrip are two command names for the same CLI executable.

logstrip raw.log -o clean.log --stats

The CLI writes the compressed log to clean.log and a short stats block to stderr. Stdin and stdout are supported too:

cat raw.log | logstrip > clean.log

You can also run it instantly without installation via npx:

npx -y logstrip raw.log -o clean.log --stats

Run logstrip --help for every flag, or read the CLI reference.

optional: github action

When you would rather not call the CLI from a run: step, the same parser is exposed as a thin GitHub Action wrapper:

- name: Compress logs with LogStrip
  uses: mrwogu/logstrip@v1
  id: logstrip
  with:
    log-path: raw_logs.txt
    aggressiveness: high

The action writes steps.logstrip.outputs.output-path and a GitHub Step Summary with estimated input tokens, output tokens, and savings.

next steps