compact_transcript
Cut spent tool outputs from a session transcript: pairs each call with its result, pins first and newest messages, and keeps survivors verbatim so nothing is summarized. Offline ranker; failures keep calls.
Instructions
Tool-call compaction for a session transcript: pairs each tool call with its result, pins the first and newest messages, and drops the pairs a semantic judge says are spent — kept messages stay verbatim, so nothing is summarized. Default 'auto' is the local specialist-v3 ranker (offline, no key); 'jev' is remote and needs TYPESAFE_API_KEY. Every failure keeps the call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trigger | No | Request-log label only: 'idle' for the plugin's idle stash. | |
| messages | Yes | Messages with role/text and toolUses/toolResults blocks (Claude Code hook shape) or tool_calls/tool_results. | |
| provider | No | 'auto' (default) and 'specialist-v3' use the local CPU ranker (no key, no network; ranks, does not judge). 'jev' is the remote TypeSafe System 1, needs TYPESAFE_API_KEY, and runs only when named. 'laya' is DEPRECATED (local, needs the [laya] extra) and runs only when named. 'rules' is an offline deterministic policy (no key, no model); see rules_mode. | auto |
| question | Yes | ||
| jev_model | No | jev-latest | |
| threshold | No | ||
| disk_check | No | ||
| laya_model | No | ||
| ref_blocks | No | ref_unchanged down to the block: a changed message comes back as {'ref': <input index>, 'toolUses': [<kept call index>...], 'toolResults': [<kept result index> | {'ref', 'tool_use_id', 'text', 'head'?, 'tail'?}...]}, a replaced result being original[:head] + text + original[-tail:] (UTF-16 units). | |
| rules_mode | No | Only for provider 'rules'. 'lossless' replaces a tool result with a pointer only when its text is kept verbatim in a later result, and verifies it. 'recoverable' also replaces old file reads (of files not written later) and read-only allowlisted command outputs with a re-read/re-run pointer, and verifies it. 'stashed' removes what 'lossy' drops or trims and 'recoverable' replaces, after saving the exact bytes to a local stash; the pointer names a 'recall' id. 'lossy' is EXPERIMENTAL (trims and drops outputs; failed blind audits v0.4 and v0.5). | lossless |
| max_workers | No | ||
| min_reduction | No | ||
| ref_unchanged | No | Return each message the pass left unchanged as {'ref': <input index>} and leave per-call decisions out, for size-capped callers. | |
| workspace_root | No | rules_mode 'recoverable' only: the session's working directory. When set (and disk_check on), the disk decides file pointers: a read is replaced iff the file inside it (or its own directory) currently holds exactly the removed content, even after later writes. | |
| idle_gap_bucket | No | Request-log label only: the idle gap bucket, e.g. '1h-2h'. | |
| preserve_recent | No | ||
| trim_head_chars | No | ||
| max_state_tokens | No | ||
| max_request_tokens | No | ||
| allow_command_pointers | No | rules_mode 'recoverable' only: also replace allowlisted read-only command outputs with a re-run pointer. Off by default. |