Expand description
Tokenless report file consumer.
Reads the per-session JSONL report file produced by tokenless hooks incrementally: each API request reads only the new lines since the last consumption, keeping the file on disk so every request gets its fair share of project/user context and incremental savings.
§Report file format (JSONL)
Each line is a JSON object with these fields:
| Field | Type | Example | Description |
|---|---|---|---|
sessionId | string | "abc123" | Claude Code session ID |
agentId | string | "claude" | Agent identifier |
projectPath | string|null | "my-project" | Project path |
opType | string | "compress-schema" | Operation type (see below) |
method | string|null | "ToonHrv" | Compression strategy (see below) |
beforeTokens | u64 | 1500 | Estimated tokens before compression |
afterTokens | u64 | 700 | Estimated tokens after compression |
savedTokens | u64 | 800 | Tokens saved |
beforeBytes | u64 | 6000 | Bytes before compression |
afterBytes | u64 | 2800 | Bytes after compression |
savedBytes | u64 | 3200 | Bytes saved |
timestamp | string | RFC 3339 | When the hook ran |
§opType values
| Value | Meaning |
|---|---|
compress-schema | Tool schema definition compression (BeforeModel hook) |
compress-response | Tool response output compression (PostToolUse hook) |
rewrite-command | Shell command rewriting via RTK (PreToolUse hook) |
compress-toon | TOON format encoding |
§method values (by opType)
compress-schema:
| Value | Meaning |
|---|---|
CompressorOnly | Basic schema compressor (truncate descriptions, drop titles) |
ToonHrv | Uniform object arrays → HRV encoding (>= 5 items) |
EnhancedToon | Deep nesting or enum constraints → enhanced TOON |
CjsonCompact | CJSON compact encoding (fallback) |
compress-response:
| Value | Meaning |
|---|---|
Standard | Standard response compression (truncate strings/arrays, drop nulls) |
HighFidelity | Bash output compression (wider truncation limits) |
Semantic | Semantic-aware field filtering (--semantic flag) |
rewrite-command:
| Value | Meaning |
|---|---|
RtkStandard | RTK command rewriting |
compress-toon:
| Value | Meaning |
|---|---|
ToonDefault | Basic TOON encoding |