Skip to main content
Glama
lcc (Local Context Compiler)

lcc (Local Context Compiler)

compact_transcript

Compact session transcripts by pairing tool calls with results and dropping spent pairs via a semantic judge, while kept messages stay verbatim for smaller context.

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "messages": "<messages>",
      "question": "<question>"
    },
    "name": "compact_transcript"
  }
}

Input Schema

NameRequiredDescriptionDefault
ledgerNoOpt-in: append one line of counts (never text or paths) for a pass that stands to the local ledger (~/.cache/lcc/ledger.jsonl, LCC_LEDGER_PATH). LCC_LEDGER=1 turns it on for every call.
triggerNoRequest-log label only: 'idle' for the plugin's idle stash.
messagesYesMessages with role/text and toolUses/toolResults blocks (Claude Code hook shape) or tool_calls/tool_results.
providerNo'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
questionYes
jev_modelNojev-latest
thresholdNo
disk_checkNo
laya_modelNo
ref_blocksNoref_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_modeNoOnly 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
cache_stateNoProvider prompt-cache state for the report's cache_effect (unknown is priced as warm). The idle stash sends 'cold'.unknown
max_workersNo
min_reductionNo
ref_unchangedNoReturn each message the pass left unchanged as {'ref': <input index>} and leave per-call decisions out, for size-capped callers.
stash_pointerNorules_mode 'stashed' only. 'lean' adds the exit status, error type or failing test and the first line to each pointer (about +13 tokens each). 'head' is 'lean' with the first 160 characters across lines instead of the first line.plain
ledger_sessionNoSession id; the ledger and the stash sidecars store only its truncated SHA-256.
workspace_rootNorules_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_bucketNoRequest-log label only: the idle gap bucket, e.g. '1h-2h'.
preserve_recentNo
trim_head_charsNo
max_state_tokensNo
max_request_tokensNo
allow_command_pointersNorules_mode 'recoverable' only: also replace allowlisted read-only command outputs with a re-run pointer. Off by default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.4.0
    • changedInput schema / properties / stash_pointer / description
      Previous value: -"rules_mode 'stashed' only. 'lean' adds the exit status, error type or failing test and the first line to each pointer (about +13 tokens each)."New value: +"rules_mode 'stashed' only. 'lean' adds the exit status, error type or failing test and the first line to each pointer (about +13 tokens each). 'head' is 'lean' with the first 160 characters across lines instead of the first line."
    • changedInput schema / properties / stash_pointer / enum
      Previous value: -[
      -  "plain",
      -  "lean"
      -]New value: +[
      +  "plain",
      +  "lean",
      +  "head"
      +]
  2. Changed4 schema fields changedv1.3.0
    • addedInput schema / properties / cache_state
      Added value: +{
      +  "default": "unknown",
      +  "description": "Provider prompt-cache state for the report's cache_effect (unknown is priced as warm). The idle stash sends 'cold'.",
      +  "enum": [
      +    "warm",
      +    "cold",
      +    "unknown"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / ledger
      Added value: +{
      +  "default": false,
      +  "description": "Opt-in: append one line of counts (never text or paths) for a pass that stands to the local ledger (~/.cache/lcc/ledger.jsonl, LCC_LEDGER_PATH). LCC_LEDGER=1 turns it on for every call.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / ledger_session
      Added value: +{
      +  "description": "Session id; the ledger and the stash sidecars store only its truncated SHA-256.",
      +  "type": "string"
      +}
    • addedInput schema / properties / stash_pointer
      Added value: +{
      +  "default": "plain",
      +  "description": "rules_mode 'stashed' only. 'lean' adds the exit status, error type or failing test and the first line to each pointer (about +13 tokens each).",
      +  "enum": [
      +    "plain",
      +    "lean"
      +  ],
      +  "type": "string"
      +}
  3. First observed

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does disclose the key behavioral contract: kept messages stay verbatim (no summarization), and 'every failure keeps the call' — a fail-safe guarantee. It also flags the offline/no-network default and the remote key requirement, though it omits return shape and cost/latency traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core operation and followed by the provider default distinction; little waste. Density is high but proportional to a 24-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 24-parameter tool with no output schema, the description covers the safety story and provider selection but says nothing about what the response looks like or how the reduction knobs behave, leaving material gaps for an agent to fill from schema defaults alone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 54%, so the schema covers roughly half; the description reinforces the important provider semantics and key requirements beyond the enum labels. Most operational knobs (threshold, preserve_recent, min_reduction, max_state_tokens, disk_check) get no treatment in the description, so it does not fully compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Tool-call compaction for a session transcript') and explains the core mechanism: pairing calls with results, pinning first/newest messages, dropping judge-spent pairs. It is clear enough to distinguish from a generic 'compact' sibling in concept, but never names or contrasts that sibling explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provider selection guidance is present ('auto' is local and default, 'jev' is remote and only runs when named, 'laya' is deprecated), which implies a usage posture. However there is no explicit statement of when to choose this tool over the sibling 'compact' or 'prepare', and no prerequisites beyond the API key note.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.