Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
Diffs
text
diffs
is an optional plugin tool with short built-in system guidance and a companion skill that turns change content into a read-only diff artifact for agents.
It accepts either:
text
before
and
text
after
text
a unified
text
patch
It can return:
a gateway viewer URL for canvas presentation
a rendered file path (PNG or PDF) for message delivery
both outputs in one call
When enabled, the plugin prepends concise usage guidance into system-prompt space and also exposes a detailed skill for cases where the agent needs fuller instructions.
Canvas-first flows: agents call `diffs` with `mode: "view"` and open `details.viewerUrl` with `canvas present`.
text
<Tab title="file">
Chat file delivery: agents call `diffs` with `mode: "file"` and send `details.filePath` with `message` using `path` or `filePath`.
</Tab>
<Tab title="both">
Combined: agents call `diffs` with `mode: "both"` to get both artifacts in one call.
</Tab>
</Tabs>
Disable built-in system guidance
If you want to keep the
text
diffs
tool enabled but disable its built-in system-prompt guidance, set
Original text. Required with `after` when `patch` is omitted.
Updated text. Required with `before` when `patch` is omitted.
Unified diff text. Mutually exclusive with `before` and `after`.
Display filename for before and after mode.
Language override hint for before and after mode. Unknown values fall back to plain text.
Viewer title override.
Output mode. Defaults to plugin default `defaults.mode`. Deprecated alias: `"image"` behaves like `"file"` and is still accepted for backward compatibility.
Viewer theme. Defaults to plugin default `defaults.theme`.
Diff layout. Defaults to plugin default `defaults.layout`.
Expand unchanged sections when full context is available. Per-call option only (not a plugin default key).
Rendered file format. Defaults to plugin default `defaults.fileFormat`.
Quality preset for PNG or PDF rendering.
Device scale override (`1`-`4`).
Max render width in CSS pixels (`640`-`2400`).
Artifact TTL in seconds for viewer and standalone file outputs. Max 21600.
Viewer URL origin override. Overrides plugin `viewerBaseUrl`. Must be `http` or `https`, no query/hash.
Output details contract
The tool returns structured metadata under
text
details
.
Mode behavior summary:
Mode
What is returned
text
"view"
Viewer fields only.
text
"file"
File fields only, no viewer artifact.
text
"both"
Viewer fields plus file fields. If file rendering fails, viewer still returns with
text
fileError
and
text
imageError
alias.
Collapsed unchanged sections
The viewer can show rows like
text
N unmodified lines
.
Expand controls on those rows are conditional and not guaranteed for every input kind.
Expand controls appear when the rendered diff has expandable context data, which is typical for before and after input.
For many unified patch inputs, omitted context bodies are not available in the parsed patch hunks, so the row can appear without expand controls. This is expected behavior.