diff

A command for comparing two versions of an OpenAPI specification, which is a machine-readable description of an API. It reports what was added, changed, or removed and can compare local files, a remote specification, or a cached copy.

In plain words
What is it for?
Use it to compare old and new OpenAPI files, check the current specification against a remote version, or run an offline comparison using cached data. It requires the OpenAPI Sync MCP server before execution.
Why use it?
It makes API changes visible before they cause synchronization or integration problems, while caching can avoid downloading an unchanged remote specification.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jhlee0409/claude-plugins/diff
Clone the repo
git clone --depth 1 https://github.com/jhlee0409/claude-plugins
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,376 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00007 $0.02376
Opus 5 $0.00003 $0.01188
Sonnet 5 $0.00001 $0.00475
Haiku 4.5 $0.00001 $0.00238

Measured yesterday against content hash 82233c5a14be, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

diff scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/oas/commands/diff.md · 371 lines

How it starts

The opening of the file, as written. The whole thing — 371 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Diff

Compare OpenAPI spec changes to see what's new, changed, or removed.

MCP Dependency Check

Before executing this command, invoke skill: mcp-dependency

  • Verify OpenAPI Sync MCP server is installed
  • If not available, offer to install via npm install -g @jhlee0409/openapi-sync-mcp
  • Only proceed after MCP is confirmed available

Usage

# Current spec vs latest remote spec (smart caching)
/oas:diff --remote

# Compare two files
/oas:diff ./old-openapi.json ./new-openapi.json

# Current spec vs specific file
/oas:diff ./previous-version.json

# Compare with cached previous version
/oas:diff

# Force fetch remote (bypass cache)
/oas:diff --remote --force

# Use cached spec only (offline)
/oas:diff --offline

Smart Caching

Use skill: cache-manager

When using --remote:
  1. Check if spec changed (HEAD request)
     - ETag/Last-Modified comparison
  2. If unchanged → Use cached spec for "new" side
  3. If changed → Fetch new spec, update cache

Benefits:
  - Fast when spec hasn't changed
  - Saves bandwidth
  - Always accurate when changes detected

Output with cache hit:

/oas:diff --remote

✅ Using cached spec (ETag unchanged)
   Comparing cached version vs codebase...

Output with cache miss:

/oas:diff --remote

🔄 Spec changed, fetching updates...
   Comparing new spec vs codebase...

Diff Process

┌─────────────────┐    ┌─────────────────┐
│    OLD SPEC     │    │    NEW SPEC     │
│  (cache/file)   │    │ (remote/file)   │
└────────┬────────┘    └────────┬────────┘
         │                      │
         └──────────┬───────────┘
                    │
                    ▼
         ┌─────────────────────┐
         │  Compare Endpoints  │
         │   path + method     │
         └──────────┬──────────┘
                    │
    ┌───────────────┼───────────────┐
    ▼               ▼               ▼
┌───────┐     ┌──────────┐    ┌─────────┐
│ ADDED │     │ CHANGED  │    │ REMOVED │
│ (+)   │     │   (~)    │    │  (-)    │
└───┬───┘     └────┬─────┘    └────┬────┘
    │              │               │
    └──────────────┼───────────────┘
                   ▼
         ┌─────────────────────┐
         │   Output Report     │
         └─────────────────────┘

Read the full file on GitHub · 371 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 371 lines · 7 tokens per session scan A 82233c5a14be

Subscribe to this mod's changes

diff is a command published in the GitHub repository jhlee0409/claude-plugins (4 stars, last pushed 7mo ago), licensed MIT. It adds 7 tokens to every session and 2,376 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.