# open-compress/claw-compactor

14-stage Fusion Pipeline for LLM token compression — reversible compression, AST-aware code analysis, intelligent content routing. Zero LLM inference cost. MIT licensed.

Repository: https://github.com/open-compress/claw-compactor
Canonical: https://ross.abutalabs.com/products/claw-compactor
Homepage: https://www.opencompress.ai/
Language: Python
License: MIT
License Family: permissive
Topics: ai-agent-tools, context-compression, context-pruning, context-window-optimization, llm-compression, llm-tools, openclaw, prompt-compression, token-compression, claw-compactor, llm-context-compression, llm-cost-reduction, llm-token-compression, ai-infrastructure, developer-tools, python, tree-sitter, ast-code-analysis, fusion-pipeline, reversible-compression
Last push: 2026-04-01T08:31:20+00:00

## Health v2 (maintenance only)
Score: 63/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 75, release rhythm 75, longevity 14
- inputs: {"age_days": 205, "days_push": 154, "days_rel": 167, "gap_med": 0.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2033, forks 185 (observed 2026-08-28T04:06:07.763284+00:00)

## What it is
Claw Compactor is an open-source Python library and CLI tool that compresses LLM input tokens via a 14-stage Fusion Pipeline, achieving 15-82% reduction with zero LLM inference cost. It uses reversible compression, AST-aware code analysis via tree-sitter, and intelligent content routing to shrink prompts and agent context windows.

## Use cases
- compress prompts before sending to an LLM to cut token costs
- shrink agent context windows so long sessions fit the model's limit
- compress code workspaces with AST-aware analysis before LLM calls
- reduce token usage in Claude Code or Cursor agent traces
- deduplicate and prune repetitive context in chatbot pipelines
- reversibly decompress content after LLM processing

## When to choose
- you want deterministic, offline token compression with no LLM inference cost
- you need reversible compression so original content can be restored
- your workload includes source code that benefits from AST-aware analysis
- you want a Python library plus CLI with MIT licensing and active test coverage

## When to avoid
- you need semantic compression that requires an LLM or embedding model
- your prompts are already short and pre-optimized (minimal impact expected)
- you need a hosted gateway that compresses output tokens across providers
- you require guaranteed lossless fidelity for all content types

## Facets
- artifact type: library
- maturity: active
- function: compression, nlp, parser, developer-tools
- domain: large-language-models, artificial-intelligence, developer-tools
- platform: python, cli, cross-platform
- tags: token-compression, context-window-optimization, prompt-compression, ast-analysis, tree-sitter, llm-cost-reduction, fusion-pipeline, reversible-compression, ai-agents, natural-language-processing

## Member repositories
- open-compress/claw-compactor (main) score 63

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:07.763284+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:59:27.602462+00:00, confidence not recorded.
  - readme: https://github.com/open-compress/claw-compactor (fetched 2026-08-28T04:06:07.763284+00:00, sha f9d930ccca99)
  - homepage: https://www.opencompress.ai/ (fetched 2026-08-29T10:39:21.090668+00:00, sha ed6c35add6f3)
  - registry_pypi: https://pypi.org/pypi/claw-compactor/json (fetched 2026-08-29T10:39:21.100084+00:00, sha 371134d3f55e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
