Latest release: v2026.9.2Download zip
Compatibility
Security Scan
OpenClaw
Benign
high confidenceCredentials
The plugin registers a local gateway HTTP route, uses Chromium via Playwright for rendering, and can optionally allow remote viewer access; these are disclosed and proportionate to shareable diff viewing, with remote viewing disabled by default.
Install Mechanism
The package uses normal OpenClaw plugin metadata with a runtime extension, tool contract, config schema, and no package install script or shell-based installer in the inspected artifacts.
Instruction Scope
The skill guidance tells agents when to use the diffs tool and how to return viewer URLs or file paths; the system-prompt hook is disclosed in the README and contains stable tool-use guidance rather than unrelated role or policy manipulation.
Persistence & Privilege
Viewer HTML is stored in expiring OpenClaw blob storage with token hashes, and rendered files are temporary materializations under the OpenClaw temp directory with cleanup logic; this is purpose-aligned persistence rather than broad indexing or credential storage.
Purpose & Capability
The stated purpose is to render before/after text or unified patches as viewer URLs and optional PNG/PDF files, and the runtime implements that specific tool behavior with input size limits and no unrelated capabilities found.
Assessment
Installers should understand that diff contents may be stored temporarily in the gateway blob store or as temp PNG/PDF files, and enabling remote viewer access makes token URLs reachable by non-local clients who know the full path. Keep remote access disabled unless that sharing model is intended.dist/assets/viewer-runtime.js:1
Potential obfuscated payload detected.
About static analysis
These patterns were detected by automated regex scanning. They may be normal for skills that integrate with external APIs. Check the VirusTotal and OpenClaw results above for context-aware analysis.Verification
Tags
@openclaw/diffs
Read-only diff viewer plugin for OpenClaw agents.
Install
openclaw plugins install @openclaw/diffs
Restart the Gateway after installing or updating the plugin.
It gives agents one tool, diffs, that can:
- render a gateway-hosted diff viewer
- render the same diff to a file (PNG or PDF)
- accept either arbitrary
beforeandaftertext or a unified patch
What Agents Get
The tool can return:
details.changed:falsewhen before/after inputs are identical and no artifact was rendered;truefor rendered resultsdetails.viewerUrl: a gateway URL that can be opened in the operator's browserdetails.filePath: a local rendered artifact path when file rendering is requesteddetails.fileFormat: the rendered file format (pngorpdf)details.artifactIdanddetails.expiresAt: artifact identity and TTL metadatadetails.context: available routing metadata such asagentId,sessionId,messageChannel, andagentAccountId
When the plugin is enabled, it also ships a companion skill from skills/ and prepends stable tool-usage guidance into system-prompt space via before_prompt_build. The hook uses prependSystemContext, so the guidance stays out of user-prompt space while still being available every turn.
This means an agent can:
- call
diffswithmode=view, then returndetails.viewerUrlfor the operator to open - call
diffswithmode=file, then send the file through the normalmessagetool usingpathorfilePath - call
diffswithmode=bothwhen it wants both outputs
Tool Inputs
Before and after:
{
"before": "# Hello\n\nOne",
"after": "# Hello\n\nTwo",
"path": "docs/example.md",
"mode": "view"
}
Patch:
{
"patch": "diff --git a/src/example.ts b/src/example.ts\n--- a/src/example.ts\n+++ b/src/example.ts\n@@ -1 +1 @@\n-const x = 1;\n+const x = 2;\n",
"mode": "both"
}
Useful options:
mode:view,file, orbothDeprecated alias:imagebehaves likefileand is still accepted for backward compatibility.layout:unifiedorsplittheme:lightordark(default:dark)fileFormat:pngorpdf(default:png)fileQuality:standard,hq, orprintfileScale: device scale override (1-4)fileMaxWidth: max width override in CSS pixels (640-2400)expandUnchanged: expand unchanged sections (per-call option only, not a plugin default key)path: display name for before and after inputlang: language hint for before/after input; unknown values fall back to plain text- Default syntax highlighting covers common source, config, and documentation languages. Install
diffs-language-packfor the extended language catalog. title: explicit viewer titlettlSeconds: artifact lifetime for viewer and standalone file outputsbaseUrl: override the gateway base URL used in the returned viewer link (origin or origin+base path only; no query/hash)viewerBaseUrlplugin config: persistent fallback used when a tool call omitsbaseUrl
Input safety limits:
beforeandafter: max 512 KiB eachpatch: max 2 MiB- patch rendering cap: max 128 files / 120,000 lines
Plugin Defaults
Set plugin-wide defaults in ~/.openclaw/openclaw.json:
{
plugins: {
entries: {
diffs: {
enabled: true,
config: {
defaults: {
fontFamily: "Fira Code",
fontSize: 15,
lineSpacing: 1.6,
layout: "unified",
showLineNumbers: true,
diffIndicators: "bars",
wordWrap: true,
background: true,
theme: "dark",
fileFormat: "png",
fileQuality: "standard",
fileScale: 2,
fileMaxWidth: 960,
mode: "both",
ttlSeconds: 21600,
},
},
},
},
},
}
Explicit tool parameters still win over these defaults.
Docs
Package
- Plugin id:
diffs - Package:
@openclaw/diffs - Minimum OpenClaw host:
2026.4.30
Security options:
security.allowRemoteViewer(defaultfalse): allows non-loopback access to/plugins/diffs/view/...token URLsviewerBaseUrl(optional): persistent viewer-link origin/path fallback for shareable URLsdefaults.ttlSeconds(default1800, max21600): default artifact lifetime for viewer and standalone file outputs
Example:
{
plugins: {
entries: {
diffs: {
enabled: true,
config: {
viewerBaseUrl: "https://gateway.example.com/openclaw",
},
},
},
},
}
Example Agent Prompts
Open in the browser:
Use the `diffs` tool in `view` mode for this before and after content, then return the viewer URL.
Path: docs/example.md
Before:
# Hello
This is version one.
After:
# Hello
This is version two.
Render a file (PNG or PDF):
Use the `diffs` tool in `file` mode for this before and after input. After it returns `details.filePath`, use the `message` tool with `path` or `filePath` to send me the rendered diff file.
Path: README.md
Before:
OpenClaw supports plugins.
After:
OpenClaw supports plugins and hosted diff views.
Do both:
Use the `diffs` tool in `both` mode for this diff. Return the viewer URL and then send the rendered file by passing `details.filePath` to the `message` tool.
Path: src/demo.ts
Before:
const status = "old";
After:
const status = "new";
Patch input:
Use the `diffs` tool with this unified patch in `view` mode. Return its viewer URL.
diff --git a/src/example.ts b/src/example.ts
--- a/src/example.ts
+++ b/src/example.ts
@@ -1,3 +1,3 @@
export function add(a: number, b: number) {
- return a + b;
+ return a + b + 1;
}
Notes
- Multi-file patches start with a changed-files summary card: totals, per-file
+N/-Nstats, change badges, and anchor links. - Rendered PNG/PDF files keep the per-file header counts but omit the interactive view toggles.
- The viewer is hosted locally through the gateway under
/plugins/diffs/.... - Viewer HTML and metadata are ephemeral SQLite plugin blobs. The URL token is returned to the caller while SQLite stores only its SHA-256 hash.
- Rendered PNG/PDF files remain temporary materializations in
$TMPDIR/openclaw-diffsbecause delivery APIs require a file path. No JSON metadata sidecars are written or imported. - Default viewer URLs use
gateway.publicOriginwhen configured, then the existing bind-aware Gateway fallback. PluginviewerBaseUrland per-callbaseUrltake precedence. - If
gateway.trustedProxiesincludes loopback for a same-host proxy (for example Tailscale Serve), raw127.0.0.1viewer requests without forwarded client-IP headers fail closed by design. - In that topology, prefer
mode=file/mode=bothfor attachments, or intentionally enable remote viewers and set pluginviewerBaseUrl(or pass a proxy/publicbaseUrl) when you need a shareable viewer URL. - Remote viewer misses are throttled to reduce token-guess abuse.
- PNG or PDF rendering requires a Chromium-compatible browser. Set
browser.executablePathif auto-detection is not enough. - If your delivery channel compresses images heavily (for example Telegram or WhatsApp), prefer
fileFormat: "pdf"to preserve readability. N unmodified linesrows may not always include expand controls for patch input, because many patch hunks do not carry full expandable context data.- Diff rendering is powered by Diffs.
