Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

docs(readme): list C# and PHP as AST-compressed, drop quarantined Perl (#3225)

Yevhen Koval76ec363a603e
diff --git a/README.md b/README.md
index 646c2eed9..912e426c8 100644
--- a/README.md
+++ b/README.md
@@ -383,7 +383,7 @@ reduction, and blocks under `min_input_words` come back byte-identical.
<summary><b>What's inside</b></summary>
- **SmartCrusher** — universal JSON: arrays of dicts, nested objects, mixed types. It keeps error items, values outside the normal statistical range, and first/last boundaries, selected from field-variance statistics rather than a keyword list.
-- **CodeCompressor** — AST-aware for Python, JS/TS, Go, Rust, Java, C/C++ and Perl.
+- **CodeCompressor** — AST-aware for Python, JS/TS, Go, Rust, Java, C/C++, C#, PHP.
- **Kompress-v2-base** — our HuggingFace model, trained on agentic traces.
- **Image compression** — 40–90% reduction through a trained ML router.
- **CacheAligner** — flags volatile content that would bust a provider KV-cache prefix; never rewrites prompts.
diff --git a/headroom/transforms/code_compressor.py b/headroom/transforms/code_compressor.py
index a709cf293..60a1cd13c 100644
--- a/headroom/transforms/code_compressor.py
+++ b/headroom/transforms/code_compressor.py
@@ -16,7 +16,7 @@ Supported Languages (Tier 1):
- Python, JavaScript, TypeScript
Supported Languages (Tier 2):
-- Go, Rust, Java, C, C++
+- Go, Rust, Java, C, C++, C#, PHP
- Bash (validated and preserved losslessly)
Compression Strategy:
diff --git a/wiki/transforms.md b/wiki/transforms.md
index b599b5164..aa764d8a6 100644
--- a/wiki/transforms.md
+++ b/wiki/transforms.md
@@ -155,7 +155,7 @@ AST-based compression for source code using tree-sitter.
- **Syntax validity guaranteed** — Output always parses correctly
- **Preserves critical structure** — Imports, signatures, types, error handlers
-- **Multi-language support** — Python, JavaScript, TypeScript, Go, Rust, Java, C, C++
+- **Multi-language support** — Python, JavaScript, TypeScript, Go, Rust, Java, C, C++, C#, PHP
- **Lightweight** — ~50MB vs ~1GB for the ML compressor
### Installation
@@ -228,7 +228,7 @@ print(f"Syntax valid: {result.syntax_valid}") # True
| Tier | Languages | Support Level |
|------|-----------|---------------|
| 1 | Python, JavaScript, TypeScript | Full AST analysis |
-| 2 | Go, Rust, Java, C, C++ | Function body compression |
+| 2 | Go, Rust, Java, C, C++, C#, PHP | Function body compression |
### Memory Management