← Back to Plugins
Tools

Transcript Slim

lxsdsd By lxsdsd 👁 4 views ▲ 0 votes

Standalone OpenClaw plugin that slims bulky persisted tool results into compact summaries plus artifact files for long-running sessions.

GitHub

Install

npm install
pnpm

Configuration Example

{
  "plugins": {
    "slots": {
      "runtimeHooks": [
        "transcript-slim"
      ]
    },
    "entries": {
      "transcript-slim": {
        "enabled": true,
        "sourcePath": "/absolute/path/to/openclaw-transcript-slim-plugin",
        "installPath": "/absolute/path/to/openclaw-transcript-slim-plugin"
      }
    }
  }
}

README

# Transcript Slim

`transcript-slim` is a hook-only OpenClaw plugin for long-running operator sessions.
It trims only the **persisted transcript copy** of bulky structured tool results and leaves
current-turn tool reasoning untouched.

## Why this plugin exists

The biggest persistent token churn is often not model output itself. It is repeated
structured tool payloads from research and operations loops:

- `web_search`
- `sessions_list`
- `sessions_history`
- `feishu_bitable_app_table_record`
- `read`
- `exec`
- `process`
- `edit`
- `memory_search`

`context-safe` already helps with `exec`, `read`, and `web_fetch`. This plugin fills the gap for
persisted history bloat: large tool results that are still useful, but do not need to remain inline forever.

## What it does

- detects oversized tool results for selected tools
- writes the full payload to an artifact file
- replaces the persisted transcript copy with a concise summary and artifact path
- keeps enough inline signal for future turns to understand what happened

## What it does **not** do

- It does **not** change the live tool result during the current turn
- It does **not** block re-reading the full payload later
- It does **not** compress your session JSONL by rewriting history retroactively

In practice, this means current-turn quality stays intact, while later turns stop dragging huge old tool payloads back into the prompt.

## Supported tool types

Default slimming rules are included for:

- `web_search`
- `sessions_list`
- `sessions_history`
- `feishu_bitable_app_table_record`
- `read`
- `exec`
- `process`
- `edit`
- `memory_search`

## Default artifact path

Artifacts default to:

`~/.openclaw/artifacts/transcript-slim/<tool>/<timestamp>-<hash>.json`

You can override this with `plugins.entries.transcript-slim.config.artifactRoot`.

## Install

Clone this repository somewhere stable, then reference it from your OpenClaw config:

```json
{
  "plugins": {
    "slots": {
      "runtimeHooks": [
        "transcript-slim"
      ]
    },
    "entries": {
      "transcript-slim": {
        "enabled": true,
        "sourcePath": "/absolute/path/to/openclaw-transcript-slim-plugin",
        "installPath": "/absolute/path/to/openclaw-transcript-slim-plugin"
      }
    }
  }
}
```

Then restart the gateway:

```bash
openclaw gateway restart
```

## Recommended config

```json
{
  "plugins": {
    "entries": {
      "transcript-slim": {
        "enabled": true,
        "config": {
          "webSearch": {
            "enabled": true,
            "thresholdChars": 2200,
            "maxInlineResults": 4,
            "maxSnippetChars": 180
          },
          "sessions": {
            "enabled": true,
            "thresholdChars": 3200,
            "maxInlineItems": 4
          },
          "bitable": {
            "enabled": true,
            "thresholdChars": 2600,
            "maxInlineRecords": 3,
            "maxFieldNames": 8
          },
          "read": {
            "enabled": true,
            "thresholdChars": 1800,
            "previewChars": 320
          },
          "exec": {
            "enabled": true,
            "thresholdChars": 1800,
            "previewChars": 320
          },
          "process": {
            "enabled": true,
            "thresholdChars": 1600,
            "previewChars": 320
          },
          "edit": {
            "enabled": true,
            "thresholdChars": 1800,
            "previewChars": 320
          },
          "memorySearch": {
            "enabled": true,
            "thresholdChars": 2200,
            "maxInlineResults": 3,
            "maxSnippetChars": 180
          }
        }
      }
    }
  }
}
```

## Why it is usually worth it

- Low capability impact: current-turn reasoning stays untouched
- High token savings in long-running sessions with heavy tool use
- Better session hygiene for multi-agent workflows
- Easier post-mortem debugging because the full payload is kept as an artifact

## Development

```bash
pnpm install
pnpm run check
pnpm run test
```
tools

Comments

Sign in to leave a comment

Loading comments...