You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,17 +37,17 @@ No Makefile — all build tooling is Cargo-native.
37
37
38
38
Cross-call awareness across 16 recent invocations:
39
39
-**cache.rs** — tracks seen outputs, file paths, errors from Read/Glob/Grep/Bash results
40
-
-**redundancy.rs** — two-path dedup: exact FNV-1a hash (fast), then fuzzy bottom-k MinHash trigram Jaccard ≥0.85 (whitespace/timestamp changes don't break match). Emits `[squeez: identical to ...]`or`[squeez: ~P% similar to ...]`
40
+
-**redundancy.rs** — two-path dedup: exact FNV-1a hash (fast), then fuzzy bottom-k MinHash trigram Jaccard ≥0.85 (whitespace/timestamp changes don't break match). Emits `[squeez: identical to ...]``[squeez: ~P% similar to ...]`
41
41
-**summarize.rs** — triggered at >500 lines; benign outputs (no error markers) get 2× threshold (1000 lines). Produces ≤40-line dense summary (errors, files, test status, verbatim tail)
42
-
-**intensity.rs** — truly adaptive: **Full** (×0.6) when used < 80% of budget, **Ultra** (×0.3) when ≥80%. `[adaptive: Full]`or`[adaptive: Ultra]` in header
42
+
-**intensity.rs** — truly adaptive: **Full** (×0.6) when used < 80% of budget, **Ultra** (×0.3) when ≥80%. `[adaptive: Full]``[adaptive: Ultra]` in header
|`src/commands/benchmark.rs`| 19-scenario reproducible benchmark suite |
53
53
|`src/config.rs`| Config struct + `~/.claude/squeez/config.ini` parser; all fields have defaults |
@@ -62,7 +62,7 @@ Cross-call awareness across 16 recent invocations:
62
62
63
63
### Tests
64
64
65
-
35 integration test files under `tests/`. Each strategy and handler has dedicated test file. Notable new ones: `test_redundancy_shingle.rs` (8 fuzzy-match tests), `test_mcp_server.rs` (10 JSON-RPC tests). Benchmark fixtures live in `bench/fixtures/`; capture new ones w/ `bash bench/capture.sh`.
65
+
35 integration test files under `tests/`. Each strategy and handler has dedicated test file. Notable new ones: `test_redundancy_shingle.rs` (8 fuzzy-match tests), `test_mcp_server.rs` (10 JSON-RPC tests). Benchmark fixtures live in `bench/fixtures/`capture new ones w/ `bash bench/capture.sh`.
|**MCP server**|`squeez mcp` runs a JSON-RPC 2.0 server over stdio exposing 6 read-only tools so any MCP-compatible LLM can query session memory directly. Hand-rolled, no `mcp.server` dependency. |
81
81
|**Auto-teach payload**|`squeez protocol` (or the `squeez_protocol` MCP tool) prints a 2.4 KB self-describing payload — the LLM learns squeez's markers and protocol on first call. |
82
82
|**Caveman persona**| Injects an ultra-terse prompt at session start so the model responds with fewer tokens. |
83
-
|**Memory-file compression**|`squeez compress-md` compresses CLAUDE.md / AGENTS.md / copilot-instructions.md in-place — pure Rust, zero LLM. |
83
+
|**Memory-file compression**|`squeez compress-md` compresses CLAUDE.md / AGENTS.md / copilot-instructions.md in-place — pure Rust, zero LLM. i18n-aware: set `lang = pt` (or `--lang pt`) for pt-BR article/filler/phrase dropping and Unicode-correct matching. |
84
84
|**Session memory**| On `SessionStart`, injects a summary of the previous session (files touched, errors, test results, git events). Summaries carry temporal validity (`valid_from`/`valid_to`) so invalidated entries age from `valid_to`. |
85
85
|**Token tracking**| Every `PostToolUse` result (Bash, Read, Grep, Glob) feeds a `SessionContext` so squeez knows what the agent has already seen. |
PT-BR is **~1.5× slower** than EN due to Unicode case folding — still sub-millisecond per call. Both locales produce `result.safe = true`. Run `cargo run --release --bin bench_i18n` to reproduce.
136
+
137
+
**Before / after — pt-BR Full mode:**
138
+
```
139
+
IN: O sistema é basicamente apenas uma ferramenta para configurar o repositório.
140
+
De modo geral, você pode considerar que a função principal inicializa a documentação do projeto.
141
+
142
+
Full: sistema é ferramenta para configurar repositório. função principal inicializa documentação projeto.
143
+
Ultra: sistema é ferramenta p/ configurar repo. fn principal inicializa docs projeto.
println!(" PT-BR Full: {}ms ({:.0}µs/call) {:.2}× vs EN", pt_ms,
47
+
pt_ms asf64*1000.0 / iters asf64,
48
+
pt_ms asf64 / en_ms.max(1)asf64);
49
+
50
+
assert!(pt_ms < en_ms *3 + 100,"PT-BR too slow vs EN: {}ms vs {}ms", pt_ms, en_ms);
51
+
52
+
println!();
53
+
println!("── Before / after example (pt-BR) ────────────────────────────");
54
+
let demo = "O sistema é basicamente apenas uma ferramenta para configurar o repositório. \
55
+
De modo geral, você pode considerar que a função principal inicializa a documentação do projeto.";
56
+
let rf = compress_text_with_locale(demo,Mode::Full, pt);
57
+
let ru = compress_text_with_locale(demo,Mode::Ultra, pt);
58
+
println!(" IN: {}", demo);
59
+
println!(" Full: {}", rf.output.trim());
60
+
println!(" Ultra: {}", ru.output.trim());
61
+
}
62
+
63
+
#[allow(dead_code)]
64
+
fnshow_example(){
65
+
let pt = Locale::from_code("pt-BR");
66
+
let inputs = [
67
+
("O sistema é basicamente apenas uma ferramenta para configurar o repositório. De modo geral, você pode considerar que a função principal inicializa a documentação do projeto.","pt-BR Full"),
68
+
("O sistema é basicamente apenas uma ferramenta para configurar o repositório. De modo geral, você pode considerar que a função principal inicializa a documentação do projeto.","pt-BR Ultra"),
69
+
];
70
+
for(input, label)in inputs {
71
+
let mode = if label.contains("Ultra"){Mode::Ultra}else{Mode::Full};
72
+
let r = compress_text_with_locale(input, mode, pt);
This document describes the architecture of the system. The project is basically a tool for compressing markdown files. It really just provides a simple way to remove the filler words and unnecessary phrases from prose content.
4
+
5
+
## Overview
6
+
7
+
The compression pipeline works in several stages. First, the parser identifies code blocks, URLs, headings, and tables that must be preserved verbatim. Then the prose content is processed through a series of filters that drop articles, fillers, and hedges.
8
+
9
+
## Configuration
10
+
11
+
You can configure the behavior of the tool with the configuration file. The configuration is loaded from a standard location in the user home directory. Each parameter has a sensible default, so you only need to override the ones that you really care about.
12
+
13
+
## Usage
14
+
15
+
To use the tool, simply pass the path to the file that you want to compress. The tool will read the file, run the compression pipeline, and write the output back to the same file. A backup of the original file is created automatically.
16
+
17
+
Of course, if you just want to preview the output without modifying the file, you can use the dry-run flag. This will print the compressed output to standard output instead. I'd be happy to help you configure the tool if you have any questions.
18
+
19
+
## Architecture
20
+
21
+
The architecture of the tool is really quite simple. Each stage of the pipeline is implemented as a separate function that takes the input and returns the transformed output. The stages are composed together in a fixed order, and the result is written to the destination.
22
+
23
+
In general, you should not need to modify the architecture of the tool. The default configuration is suitable for most use cases. However, if you have special requirements, you can extend the tool by adding new stages to the pipeline.
24
+
25
+
## Performance
26
+
27
+
The tool is designed to be fast. It processes a typical markdown file in a few milliseconds. The compression ratio depends on the content, but you can typically expect a reduction of around fifty percent on prose-heavy documents.
Este documento descreve a arquitetura do sistema. O projeto é basicamente uma ferramenta para comprimir arquivos markdown. Ele realmente apenas fornece uma maneira simples de remover as palavras de preenchimento e frases desnecessárias do conteúdo em prosa.
4
+
5
+
## Visão Geral
6
+
7
+
O pipeline de compressão funciona em várias etapas. Primeiro, o parser identifica os blocos de código, URLs, títulos e tabelas que devem ser preservados literalmente. Em seguida, o conteúdo em prosa é processado através de uma série de filtros que removem os artigos, preenchimentos e atenuações.
8
+
9
+
## Configuração
10
+
11
+
Você pode configurar o comportamento da ferramenta com o arquivo de configuração. A configuração é carregada de um local padrão no diretório home do usuário. Cada parâmetro tem um padrão razoável, então você só precisa substituir aqueles com os quais realmente se importa.
12
+
13
+
## Uso
14
+
15
+
Para usar a ferramenta, simplesmente passe o caminho do arquivo que você quer comprimir. A ferramenta lerá o arquivo, executará o pipeline de compressão e escreverá a saída de volta no mesmo arquivo. Um backup do arquivo original é criado automaticamente.
16
+
17
+
Claro que, se você apenas quer visualizar a saída sem modificar o arquivo, você pode usar a flag dry-run. Isso vai imprimir a saída comprimida na saída padrão. Fico feliz em ajudar você a configurar a ferramenta se tiver dúvidas.
18
+
19
+
## Arquitetura
20
+
21
+
A arquitetura da ferramenta é realmente bem simples. Cada estágio do pipeline é implementado como uma função separada que recebe a entrada e retorna a saída transformada. Os estágios são compostos em uma ordem fixa, e o resultado é escrito no destino.
22
+
23
+
De modo geral, você não precisa modificar a arquitetura da ferramenta. A configuração padrão é adequada para a maioria dos casos. Porém, se você tiver requisitos especiais, pode estender a ferramenta adicionando novos estágios ao pipeline.
24
+
25
+
## Desempenho
26
+
27
+
A ferramenta é projetada para ser rápida. Ela processa um arquivo markdown típico em poucos milissegundos. A taxa de compressão depende do conteúdo, mas você pode tipicamente esperar uma redução de cerca de cinquenta por cento em documentos com muita prosa.
0 commit comments