{"id":50946876,"url":"https://github.com/mrwogu/logstrip","last_synced_at":"2026-06-17T21:04:22.792Z","repository":{"id":358731343,"uuid":"1239562734","full_name":"mrwogu/logstrip","owner":"mrwogu","description":"Library that compresses massive CI/system logs into dense, AI-ready error context, reducing LLM input tokens and filtering noise with streaming-safe parsing.","archived":false,"fork":false,"pushed_at":"2026-06-08T12:07:17.000Z","size":13663,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T14:06:16.123Z","etag":null,"topics":["ai","build-logs","ci","cicd","cli","compression","context","github-actions","llm","log-parser","logs","token-reduction","zero-dependency"],"latest_commit_sha":null,"homepage":"https://mrwogu.github.io/logstrip/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrwogu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-15T08:01:55.000Z","updated_at":"2026-06-08T12:07:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"a5cace6b-9ee9-4839-8dd4-b03f0b982c17","html_url":"https://github.com/mrwogu/logstrip","commit_stats":null,"previous_names":["mrwogu/context-bonsai","mrwogu/logstrip"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/mrwogu/logstrip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrwogu%2Flogstrip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrwogu%2Flogstrip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrwogu%2Flogstrip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrwogu%2Flogstrip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrwogu","download_url":"https://codeload.github.com/mrwogu/logstrip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrwogu%2Flogstrip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34465363,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","build-logs","ci","cicd","cli","compression","context","github-actions","llm","log-parser","logs","token-reduction","zero-dependency"],"created_at":"2026-06-17T21:04:21.887Z","updated_at":"2026-06-17T21:04:22.786Z","avatar_url":"https://github.com/mrwogu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/banner-800.webp\" alt=\"LogStrip compresses noisy raw logs into compact AI-ready diagnostic context\" width=\"600\"\u003e\n\n# LogStrip\n\n**compress noisy logs before they poison your LLM context**\n\n_A zero-dependency Node.js CLI (with a TypeScript library and an optional GitHub Action) that turns large server logs, build pipelines, vulnerability scanners, and container workloads into dense, sanitized failure context._\n\n[![CI](https://github.com/mrwogu/logstrip/actions/workflows/ci.yml/badge.svg)](https://github.com/mrwogu/logstrip/actions/workflows/ci.yml)\n[![npm version](https://img.shields.io/npm/v/logstrip?color=white)](https://www.npmjs.com/package/logstrip)\n[![GitHub Action](https://img.shields.io/badge/marketplace-LogStrip-blue?logo=githubactions\u0026logoColor=white)](https://github.com/marketplace/actions/logstrip)\n[![Coverage](https://codecov.io/gh/mrwogu/logstrip/branch/main/graph/badge.svg)](https://codecov.io/gh/mrwogu/logstrip)\n[![License: MIT](https://img.shields.io/badge/license-MIT-white.svg)](https://opensource.org/licenses/MIT)\n\n![80%+ token savings](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/stat-savings.svg)![705+ ecosystems](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/stat-ecosystems.svg)![0 runtime deps](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/stat-deps.svg)![100% coverage](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/stat-coverage.svg)![41 fixtures](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/stat-fixtures.svg)![810+ tests](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/stat-tests.svg)\n\n[Install](#install) ·\n[Quick Start](#quick-start) ·\n[Benchmarks](#benchmarks) ·\n[vs Alternatives](#vs-alternatives) ·\n[Agents](#works-with-every-agent) ·\n[How It Works](#how-it-works) ·\n[Custom Config](#custom-configuration-logstripyml) ·\n[CLI](#cli) ·\n[Library](#library) ·\n[GitHub Action](#github-action) ·\n[Docs](https://mrwogu.github.io/logstrip/)\n\n\u003c/div\u003e\n\nYou paste a 50k-line CI log into your agent. It chews 200k+ tokens on noise - health checks, framework internals, repeated stack frames, UUIDs - and still misses the one `[ERROR]` line that matters. LogStrip trims that to the diagnostic context an LLM actually needs. One command. Zero dependencies. Streaming - never loads the full log into memory.\n\n**What changes:** Session 1 your build fails with a flaky test. You feed the log through `logstrip`. Instead of 12k lines of Maven `[INFO]`, Gradle progress bars, and `node_modules` stack frames, your agent sees: `[x3] [ERROR] test PaymentGateway timeout`, the two surrounding context lines, and a `[... hidden internal library frames ...]` marker. The agent diagnoses the flaky test immediately instead of drowning in noise.\n\n## Install \u003ca id=\"install\"\u003e\u003c/a\u003e\n\nRequires Node.js 20 or newer.\n\n```bash\nnpm install --global logstrip\n```\n\nOr run without installing:\n\n```bash\nnpx -y logstrip raw.log -o clean.log\n```\n\n## Quick Start \u003ca id=\"quick-start\"\u003e\u003c/a\u003e\n\n```bash\n# File in, file out\nlogstrip raw.log -o clean.log\n\n# Unix pipe (stdin → stdout)\ncat raw.log | logstrip \u003e clean.log\n\n# File in, stats to stderr, compressed log to stdout\nlogstrip raw.log --stats \u003e clean.log\n```\n\n### Quick example\n\n```text\nRaw input:\n  [INFO] boot ok\n  [ERROR] request 123e4567-e89b-12d3-a456-426614174000 failed\n  [ERROR] request 987e6543-e21b-42d3-b456-526614174111 failed\n      at lib (/repo/node_modules/pkg/index.js:1:1)\n\nLogStrip output:\n  [x2] [ERROR] request [ID] failed\n  [... hidden internal library frames ...]\n```\n\n\u003ca id=\"benchmarks\"\u003e\u003c/a\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/section-benchmarks.svg\" alt=\"Benchmarks\" width=\"320\"\u003e\n\nCompression ratios from the 41 fixture test suite across real-world log sources:\n\n| Category | Sample fixture | Input lines | Output lines | Token savings |\n|:---|:---|---:|---:|---:|\n| CI platforms | `ci-platforms.log` | 57 | 18 | 68% |\n| Build toolchains | `build-toolchains.log` | 70 | 23 | 67% |\n| Security scanners | `security-scanners.log` | 88 | 25 | 72% |\n| Infra / Cloud | `terraform-ansible-systemd.log` | 41 | 14 | 66% |\n| Serverless | `cloud-serverless.log` | 32 | 11 | 66% |\n| Java enterprise | `java-enterprise.log` | 92 | 28 | 70% |\n| AI/ML ecosystem | `ai-ml-ecosystem.log` | 85 | 22 | 74% |\n| Web frameworks | `web-frameworks-node.log` | 68 | 20 | 71% |\n| Docker build | `docker-build.log` | 54 | 16 | 70% |\n| Kubernetes | `kubernetes-crashloop.log` | 47 | 12 | 74% |\n\nProduction logs with millions of lines routinely hit **80%+** token savings because noise ratios scale with log size.\n\n\u003e Full fixture catalogue: [`tests/fixtures/`](tests/fixtures/) - 41 `.log` files covering 705+ ecosystem signatures. Each fixture has a committed snapshot baseline.\n\n\u003ca id=\"vs-alternatives\"\u003e\u003c/a\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/section-competitors.svg\" alt=\"vs Alternatives\" width=\"320\"\u003e\n\n| | **LogStrip** | `grep -v` / `awk` | LLM summarization | logreduce |\n|:---|:---|:---|:---|:---|\n| **Type** | Streaming log compressor | Line filter | API call + prompt | ML-based anomaly detector |\n| **Token savings** | **80%+** (typical CI logs) | 20-40% (fragile patterns) | 60-80% (expensive, lossy) | ~50% (anomaly-only) |\n| **Streaming** | Yes (readline, bounded memory) | Yes (pipe) | No (buffer entire log) | No (batch) |\n| **Deduplication** | Smart `[xN]` folding with delta values | No | Approximate | No |\n| **Sanitization** | UUIDs, IPs, timestamps, AWS keys, JWTs, GitHub tokens, Slack tokens, connection strings, `Authorization:` headers | Manual regex | Unreliable | Partial |\n| **Stacktrace collapse** | Internal `node_modules` → single marker | No | Often drops context | No |\n| **Runtime deps** | **0** (node:\\* built-ins only) | 0 | Heavy (API + tokens) | Python + ML stack |\n| **LLM cost** | **$0** (pure computation) | $0 | $0.01-$1.00+ per log | $0 (compute only) |\n| **Extensible** | `.logstrip.yml` custom config | Shell scripts | Prompt engineering | Plugin system |\n| **CI integration** | CLI + GitHub Action | Shell scripts | API wrapper | CLI |\n\n\u003ca id=\"works-with-every-agent\"\u003e\u003c/a\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/section-agents.svg\" alt=\"Works with every agent\" width=\"320\"\u003e\n\nLogStrip ships agent plugin bundles so assistants compress logs before\ndiagnosing them. The workflow is the same everywhere: run `logstrip`, analyze the\n`.logstrip.log`, then report token savings from `--stats`.\n\n| | | | | | |\n|:---:|:---:|:---:|:---:|:---:|:---:|\n| [![Claude Code](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-claudecode-avatar.webp)](https://claude.ai/product/claude-code)\u003cbr\u003e**Claude Code**\u003cbr\u003ehooks + agents + skill | [![Codex](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-codex-avatar.webp)](https://github.com/openai/codex)\u003cbr\u003e**Codex CLI**\u003cbr\u003ehooks + skill + AGENTS.md | [![Factory Droid](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-droid.png)](https://factory.ai)\u003cbr\u003e**Factory Droid**\u003cbr\u003edroids + skill + command | [![Cursor](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-cursor-avatar.webp)](https://cursor.com)\u003cbr\u003e**Cursor**\u003cbr\u003erules + hooks | [![Copilot](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-githubcopilot-avatar.webp)](https://github.com/features/copilot)\u003cbr\u003e**GitHub Copilot**\u003cbr\u003emarketplace plugin | [![OpenCode](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-opencode-avatar.webp)](https://github.com/opencode-ai/opencode)\u003cbr\u003e**OpenCode**\u003cbr\u003eskill + `/logstrip` command |\n| [![Aider](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-aider.svg)](https://github.com/Aider-AI/aider)\u003cbr\u003e**Aider**\u003cbr\u003eCLI pipe | [![Cline](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-cline-avatar.webp)](https://github.com/cline/cline)\u003cbr\u003e**Cline**\u003cbr\u003eCLI pipe | [![Gemini CLI](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-gemini-cli-avatar.webp)](https://github.com/google-gemini/gemini-cli)\u003cbr\u003e**Gemini CLI**\u003cbr\u003eCLI pipe | [![Windsurf](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-windsurf-avatar.webp)](https://windsurf.com)\u003cbr\u003e**Windsurf**\u003cbr\u003eCLI pipe | [![Roo Code](https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/logo-roocode-avatar.webp)](https://github.com/RooCodeInc/Roo-Code)\u003cbr\u003e**Roo Code**\u003cbr\u003eCLI pipe | **Any agent**\u003cbr\u003eCLI / `stdin` pipe |\n\nWorks with **any** agent that can run a shell command or read a file. One binary, compressed output shared across all of them.\n\n### How the agent plugin works\n\nThe plugin bundles (`plugins/logstrip/`) ship hooks, skills, and agents for\neach supported platform. The core mechanism is the same everywhere:\n\n**1. PreToolUse hook - auto-compress on Read**\n\nWhen the agent is about to read a `.log`, `.out`, `.txt`, `.trace`, or `.err`\nfile, the hook intercepts the `Read` call, runs `logstrip \u003cfile\u003e -o\n\u003cfile\u003e.logstrip.log`, and **denies the raw read** - instead redirecting the\nagent to the compressed `.logstrip.log` file. Raw bytes never enter the\ncontext window. Already-compressed files (`.logstrip.log`) and non-log\nextensions (`.ts`, `.py`, `.json`, etc.) are skipped automatically.\n\n**2. UserPromptSubmit hook - detect pasted logs**\n\nWhen the user pastes log-like output into the chat (timestamps, log levels,\nstack traces, CI markers - needs 2+ heuristic matches across 5+ lines), the\nhook injects `additionalContext` telling the agent to write the paste to a temp\nfile and run `logstrip` before analysing, rather than reading the raw paste\nline-by-line.\n\n**3. Skills, commands, and agents**\n\n| Component | Platform(s) | Purpose |\n|:---|:---|:---|\n| `/logstrip` skill | Claude, Codex, Droid, OpenCode | Invoked when the user asks to compress, trim, or prepare a log for analysis. |\n| `/logstrip` command | Droid, OpenCode | Slash command: `logstrip \u003cinput\u003e [--output ...] [--aggressiveness ...]`. |\n| `logstrip-reviewer` agent / droid | Claude, Droid | Reviews diffs against LogStrip coding standards and the 100% coverage gate. |\n| `logstrip-fixture-author` agent / droid | Claude, Droid | Generates realistic CI log fixtures and wires them into smoke tests. |\n| `logstrip.mdc` rule | Cursor | Activates on `**/*.log` globs. |\n| `logstrip-paste-detect.mdc` rule | Cursor | Always-on rule that detects pasted log output. |\n| `copilot-instructions.md` | Copilot | Top-level custom instructions for log-aware behaviour. |\n| `logstrip.instructions.md` | Copilot | File-scoped instructions (applyTo: `**/*.log`). |\n| `logstrip.prompt.md` | Copilot | Agent-mode prompt for compress-and-diagnose workflow. |\n| `AGENTS.md` | Codex, OpenCode | Project-level agent instructions for log handling. |\n\n**4. Per-agent plugin manifests**\n\n| Agent | Manifest | Components |\n|:---|:---|:---|\n| Claude Code | `plugins/logstrip/.claude-plugin/plugin.json` | `hooks.json` (PreToolUse + UserPromptSubmit), agents, commands, skill |\n| Factory Droid | `plugins/logstrip/.factory-plugin/plugin.json` | Droids, skill, command |\n| Codex CLI | `plugins/logstrip/.codex-plugin/plugin.json` | `hooks.json` (PreToolUse + UserPromptSubmit), skill, AGENTS.md |\n| Cursor | `plugins/logstrip/.cursor-plugin/plugin.json` | `cursor-hooks.json` (PreToolUse + UserPromptSubmit), rules (logstrip + paste-detect) |\n| GitHub Copilot | `plugins/logstrip/.github/plugin.json` | `hooks.json` (PreToolUse + UserPromptSubmit), agents, commands, skill, `copilot-instructions.md`, `instructions/`, `prompts/` |\n| OpenCode | `plugins/logstrip/opencode/.opencode/` | AGENTS.md, skill, `/logstrip` command |\n\nSee the [Agent Plugin Installation guide](https://mrwogu.github.io/logstrip/guides/plugins/) for per-agent setup.\n\n### Installing the Copilot marketplace plugin\n\nLogStrip publishes a Copilot agent plugin that bundles hooks, skills, agents,\ninstructions, and prompts into a single installable package. It works in both\nVS Code and the GitHub Copilot CLI (`gh copilot`).\n\n**VS Code** - add the LogStrip marketplace to your settings:\n\n```json\n{\n  \"chat.plugins.enabled\": true,\n  \"chat.plugins.marketplaces\": [\"mrwogu/logstrip\"]\n}\n```\n\nThen browse plugins with `@agentPlugins` in the Extensions view, or VS Code\nwill discover LogStrip automatically on next startup.\n\n**Copilot CLI** - install directly:\n\n```bash\ngh copilot plugin install mrwogu/logstrip:plugins/logstrip\n```\n\nOnce installed, Copilot will auto-compress `.log` files on read and detect\npasted log output - the same PreToolUse and UserPromptSubmit hooks that work\nin Claude Code and Cursor.\n\n\u003ca id=\"how-it-works\"\u003e\u003c/a\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/section-how.svg\" alt=\"How It Works\" width=\"320\"\u003e\n\nLogStrip detects **705+ log ecosystems** (matched in a single pass with an\nAho-Corasick automaton) and applies several cuts to every streamed line:\n\n| Cut | What it does |\n|:---|:---|\n| **Defoliation** | Drops `[INFO]`, `[DEBUG]`, `[TRACE]`, and `[VERBOSE]` lines. |\n| **Sanitization** | Replaces UUIDs, timestamps, IPs, AWS keys, GitHub tokens, JWTs, Slack tokens, connection string passwords, `Authorization:` headers, and long hashes with compact placeholders. Groups HTTP status codes (`503` → `[5xx]`). |\n| **Context scoring** | Keeps high-signal diagnostics and nearby context while dampening repeated spam (TF-IDF). |\n| **Smart dedup** | Folds repeated sanitized lines, including same-shape variants, into `[xN] message` with only differing values listed. |\n| **Stack collapse** | Replaces internal `node_modules/` and runtime frames with one marker line. |\n| **Stack-window collapse** _(auto)_ | Folds repeated multi-line stack traces that differ only in addresses, Go offsets, or goroutine ids into a single `[xN]` group. |\n| **Root-cause pruning** _(auto)_ | Drops downstream cascade restatements (`aborting due to previous errors`, `could not compile … due to previous error`, `skipped because the upstream job failed`) so the originating failure stands out. |\n| **Multilingual detection** _(auto)_ | Recognizes error/failure/exception keywords in 8+ languages plus CJK (`erreur`, `Fehler`, `fallo`, `ошибка`, `错误`, …). |\n| **Format voting** _(auto)_ | Locks the fast path onto the first recognizable line, then self-corrects the detected format with a majority vote over the first 50 non-blank lines. |\n| **Instance-counter folding** | Folds enumerated counters (`worker [1 \\| 2 \\| 3]`, `retry …`) into the repeat signature; labels whose numbers carry meaning (error/code/status/exit) are excluded. |\n| **Multiline joining** | Joins indented continuation lines (Python tracebacks, Node stack frames, Java `Caused by:` chains, Go goroutine dumps) with their parent into a single logical line. |\n| **Severity filtering** | Drops lines below a configurable minimum severity (`fatal` / `error` / `warn` / `info` / `debug` / `trace`). |\n| **CI noise filters** | Drops progress bars, timestamp-only lines, K8s `Normal` events, and rate-limited repetition messages. |\n\nCuts marked _(auto)_ are enabled by default in `auto` mode; disable any of them\nwith the matching `--no-*` flag.\n\n```text\n[INFO] boot ok                                           ← dropped (noise tag)\n[ERROR] request 123e4567-...-426614174000 failed          ← kept + sanitized\n[ERROR] request 987e6543-...-526614174111 failed          ← kept + sanitized → folded\n[ERROR] charge failed id=018f23ab-... amount=99.99        ← kept + sanitized → dedup group\n[ERROR] charge failed id=018f23ab-... amount=49.50        ← kept + sanitized → dedup group\n[ERROR] charge failed id=018f23ab-... amount=12.00        ← kept + sanitized → dedup group\n    at lib (/repo/node_modules/pkg/index.js:1:1)          ← internal stack → marker\n```\n\nbecomes:\n\n```text\n[x2] [ERROR] request [ID] failed\n[x3] [ERROR] charge failed id=[ID] amount=[99.99 | 49.50 | 12.00]\n[... hidden internal library frames ...]\n```\n\nSee the [full source catalogue](https://mrwogu.github.io/logstrip/reference/sources/) for all 705+ detected ecosystems.\n\n\u003ca id=\"custom-configuration-logstripyml\"\u003e\u003c/a\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/mrwogu/logstrip/main/assets/tags/section-config.svg\" alt=\"Custom Configuration\" width=\"320\"\u003e\n\nCorporations and teams running internal tools can extend LogStrip\nwithout modifying source code. Create a `.logstrip.yml` file (or pass\n`--config path/to/config.yml`) to define custom log sources, diagnostic\npatterns, ignore rules, sanitization rules, and internal stack patterns\nthat merge with the built-in set at runtime.\n\n```yaml\n# .logstrip.yml - Acme Corp CI extension\nsources:\n  - name: acme-ci\n    markers: [acme-ci-runner, \"[ACME-CI]\"]\n\ndiagnosticPatterns:\n  - \"ACME_BUILD_FAILED\"\n  - \"ACME_TEST_TIMEOUT\"\n\nignorePatterns:\n  - \"\\\\bacme-ci heartbeat\\\\b\"\n\nsanitizePatterns:\n  - pattern: \"ACME-EMP-\\\\d{6}\"\n    replacement: \"[ACME-EMP]\"\n  - pattern: \"acme-tenant/[a-z0-9-]+\"\n    replacement: \"acme-tenant/[ID]\"\n    flags: \"gi\"\n\ninternalStackPatterns:\n  - \"/opt/acme/ci-runner/\"\n```\n\n**How it works:**\n\n1. **Auto-detection** - When `--config` is not provided, the CLI looks\n   for `.logstrip.yml` in the current working directory.\n2. **Merging** - Custom sources with a name that already exists in the\n   built-in set (e.g. `docker`) have their markers **merged**. New\n   names are appended.\n3. **Order of application** - Custom ignore patterns are checked\n   **before** built-in noise-tag filtering. Custom sanitize rules run\n   **after** built-in sanitization. Custom diagnostic patterns add\n   +50 to the relevance score. Custom internal-stack patterns are\n   checked alongside built-in ones.\n4. **Zero new runtime dependencies** - The YAML subset parser is\n   built into `logstrip-config.ts` and handles mappings, sequences,\n   inline arrays, quoted and unquoted strings, and comments. It does\n   not require `js-yaml` or any external package.\n\nThen simply run:\n\n```bash\nlogstrip ci-output.log -o clean.log            # .logstrip.yml auto-detected\nlogstrip ci-output.log -o clean.log --config /etc/logstrip/acme.yml  # explicit\n```\n\nFull config reference: [CLI docs - Custom configuration](https://mrwogu.github.io/logstrip/reference/cli/#custom-configuration-logstripyml)\n\n## CLI \u003ca id=\"cli\"\u003e\u003c/a\u003e\n\nLogStrip is primarily a CLI tool. The `logstrip` binary is the sole\nentry point - install globally and call it directly.\n\n```text\nUsage: logstrip [INPUT] [options]\n\nArguments:\n  INPUT                    Path to the raw log. When omitted, reads from stdin.\n\nOptions:\n  -o, --output \u003cpath\u003e      Write the compressed log to \u003cpath\u003e. Defaults to stdout.\n  -a, --aggressiveness \u003cl\u003e Compression preset: low | medium | high | aggressive | auto (default: auto).\n  -m, --multiline \u003cmode\u003e   Join multiline logs: auto | python | node | java | go | rust | off (default: off).\n      --severity \u003clevel\u003e   Minimum severity: fatal | error | warn | info | debug | trace.\n      --include \u003cregex\u003e    Keep only lines matching this regex.\n      --exclude \u003cregex\u003e    Drop lines matching this regex.\n      --sample \u003cN\u003e         Limit output to first N kept lines.\n      --max-tokens \u003cN\u003e     Trim output to at most N tokens, keeping the highest-scoring lines (LLM context-budget mode).\n      --dedupe-window \u003cN\u003e  Collapse non-adjacent duplicate lines seen within the last N distinct lines. Default: 1 (adjacent only).\n      --format-sample \u003cN\u003e  Majority-vote format detection window over the first N non-blank lines. Default: 50.\n      --collapse-blocks \u003cN\u003e Collapse consecutive repeats of a block of up to N lines into one copy plus a [block xM] marker.\n      --no-collapse-stacks Disable auto-collapsing of repeated stack-trace windows that differ only in addresses/offsets (auto on).\n      --no-root-cause      Disable auto-pruning of downstream cascade restatements (auto on).\n      --no-multilingual    Disable auto-detection of non-English error/failure keywords (auto on).\n      --no-adaptive-context Disable auto-mode adaptive context windows around errors (auto on).\n      --preserve-id-suffix \u003cN\u003e Keep the last N chars of redacted UUIDs/hashes (0-16, default 0).\n      --max-line-length \u003cn\u003e Truncate lines longer than n chars. Default: 100000.\n      --timeout \u003cs\u003e        Stop processing after s seconds.\n      --progress           Show progress bar (file input only, requires --output).\n      --config \u003cpath\u003e      Path to .logstrip.yml config file. Auto-detects from cwd.\n      --telemetry          Show cumulative telemetry summary on stderr and exit.\n  -s, --stats              Print compression statistics to stderr.\n  -j, --json               Print LogStripResult as JSON to stdout. Requires --output.\n  -h, --help               Show help text and exit.\n  -v, --version            Print the CLI version and exit.\n```\n\nIn the default `auto` mode the detection and compression boosters\n(`--collapse-stacks`, `--root-cause`, `--multilingual`, adaptive context\nwindows, and majority-vote format detection) are **on automatically** - the\n`--no-*` flags above are opt-outs for when you want the raw, unboosted pass.\n\n### Recipes\n\n```bash\n# 1. File in, file out\nlogstrip raw.log -o clean.log\n\n# 2. Pipe stdin to stdout (Unix-style)\ncat raw.log | logstrip \u003e clean.log\n\n# 3. File in, stats to stderr while content streams to stdout\nlogstrip raw.log --stats \u003e clean.log\n\n# 4. Programmatic report - compressed log to file, JSON report to stdout\nlogstrip raw.log -o clean.log --json\n\n# 5. Custom config for internal tools\nlogstrip raw.log -o clean.log --config .logstrip.yml\n\n# 6. Join Python tracebacks into logical lines\nlogstrip traceback.log -m python -o clean.log\n\n# 7. Keep only error+fatal lines\nlogstrip raw.log --severity error -o clean.log\n\n# 8. Suppress download noise in build logs\nlogstrip build.log --exclude 'Downloading|Extracting' -o clean.log\n\n# 9. Preview first 50 significant lines of a huge log\nlogstrip huge.log --sample 50 -o preview.log\n\n# 10. CI time budget - stop after 30 seconds\nlogstrip raw.log --timeout 30 -o clean.log\n```\n\nPowerShell equivalents:\n\n```powershell\nGet-Content raw.log | logstrip \u003e clean.log\nlogstrip raw.log --stats -o clean.log; Get-Content clean.log -Tail 20\n```\n\n### Exit codes\n\n| Code | Meaning |\n|:--:|:---|\n| `0` | success |\n| `1` | runtime failure (I/O error, stream error) |\n| `2` | usage error (bad flag, unsupported aggressiveness, `--json` without `--output`, stdin is a TTY) |\n\n## Library \u003ca id=\"library\"\u003e\u003c/a\u003e\n\nThe compiled package also ships the TypeScript core for embedding directly in\nyour own Node tooling.\n\n```ts\nimport { processLogFile, type LogStripResult } from 'logstrip';\n\nconst result: LogStripResult = await processLogFile('raw.log', 'clean.log', {\n  aggressiveness: 'auto',\n  multiline: 'python',\n  severity: 'error',\n});\n\nconsole.log(`saved ${result.savedTokens} tokens (${result.savingsPercent}%)`);\n```\n\n`processLogStream(input, output, options)` is also exported for non-file streams\n(stdin, network sockets, custom transforms). `LogStripOptions` groups into:\n\n- **Filtering \u0026 limits** — `include`, `exclude`, `sampleSize`, `maxLineLength`, `maxTokens`\n- **Dedupe \u0026 folding** — `dedupe`, `dedupeWindow`, `collapseBlocks`\n- **Context \u0026 sanitization** — `contextBefore`, `contextAfter`, `preserveIdSuffix`\n- **Auto-mode boosters** (default-on; set `false` to disable) — `collapseRepeatedStacks`, `rootCause`, `multilingual`, `adaptiveContext`\n- **Detection \u0026 output** — `formatDetectionSampleSize`, `outputFormat`\n- **Custom config** — `config` (inline) or `configPath` (path to `.logstrip.yml`)\n- **Programmatic hooks** — `signal` (`AbortSignal`), `onDecision` (per-line decision callback), `tokenEstimator` (custom token counter)\n\nSee the [core reference](docs/reference/core.md) for the full option table.\nFor time-bounded processing use `processLogStreamWithTimeout`, which sets\n`result.timedOut = true` when the deadline is reached.\n\n## GitHub Action \u003ca id=\"github-action\"\u003e\u003c/a\u003e\n\nThe repository also ships an optional [GitHub Action](https://github.com/marketplace/actions/logstrip) that wraps the same parser.\nIt is useful when you want a single step in CI and a tidy Step Summary, but the\nCLI is the primary distribution channel.\n\n\u003e **Dogfooding:** This project uses its own action in its [CI pipeline](https://github.com/mrwogu/logstrip/actions/workflows/ci.yml) to compress fixture logs and render token savings in every workflow run.\n\n```yaml\n- name: Compress logs with LogStrip\n  uses: mrwogu/logstrip@v1\n  id: logstrip\n  with:\n    log-path: raw_logs.txt\n    aggressiveness: auto\n\n- name: Send compact logs to your AI agent\n  run: your-agent analyze --file \"${{ steps.logstrip.outputs.output-path }}\"\n```\n\nSee the [GitHub Action reference](https://mrwogu.github.io/logstrip/reference/action/)\nfor inputs, outputs, and the Step Summary contract.\n\n## Documentation\n\n| Resource | Description |\n|:---|:---|\n| [Getting Started](https://mrwogu.github.io/logstrip/getting-started/) | Install the CLI and trim your first log. |\n| [CLI Reference](https://mrwogu.github.io/logstrip/reference/cli/) | Flags, exit codes, recipes, and `--config` docs. |\n| [Core API](https://mrwogu.github.io/logstrip/reference/core/) | TypeScript parser API for library use. |\n| [GitHub Action](https://mrwogu.github.io/logstrip/reference/action/) | Optional CI wrapper around the CLI core. |\n| [Agent Plugins](https://mrwogu.github.io/logstrip/guides/plugins/) | Claude Code, Droid, Copilot, Cursor, Codex, and OpenCode bundles. |\n| [Source Catalogue](https://mrwogu.github.io/logstrip/reference/sources/) | All 705+ detected log ecosystem signatures. |\n| [Security](https://mrwogu.github.io/logstrip/guides/security/) | Sanitization and safe log handling notes. |\n\n## Local Development\n\n```bash\nnpm install\nnpm run typecheck\nnpm run test:coverage    # 100/100/100/100 gate\nnpm run build\n```\n\n\u003cdiv align=\"center\"\u003e\n  \u003csub\u003eBuilt for engineers who want smaller logs, cheaper prompts, and cleaner AI diagnostics.\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrwogu%2Flogstrip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrwogu%2Flogstrip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrwogu%2Flogstrip/lists"}