compare-cli AGENTS.md

A project instruction file that documents the stable command-line interface of compare-cli, a tool for comparing two versions of an agreement or contract. It explains output formats, exit codes, and which output fields can be relied on.

In plain words
What is it for?
Use it when building integrations with compare-cli, checking contract drift, or handling its human-readable and JSON reports.
Why use it?
Agents can follow the same rules when calling the tool and correctly interpret contract changes instead of treating every nonzero result as a generic error.

Instructions file for CodexOpenCode

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 instructions/drbaher/compare-cli/agents-md
Clone the repo
git clone --depth 1 https://github.com/DrBaher/compare-cli

Made for: Codex, OpenCode.

Per session 3,157 This file is loaded in full into every session.
When invoked 3,157 The same file — it is already loaded in full.
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.03157 $0.03157
Opus 5 $0.01579 $0.01579
Sonnet 5 $0.00631 $0.00631
Haiku 4.5 $0.00316 $0.00316

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

Security

Grade A, and why

compare-cli AGENTS.md 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.

AGENTS.md · 327 lines

How it starts

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

AGENTS.md

This file describes the stable surface of compare-cli for LLM agents and downstream tooling. The exit codes and --json shape documented here are stable across v1.x minor releases.

Output contract

compare-cli is a deterministic pre-signature gate: given two contract versions (BASE = what was agreed, CANDIDATE = what's being put forward), it classifies the drift between them and reports it via the exit code.

stdout is the report. Human-readable when stdout is a TTY (with ANSI color), structured JSON when --json is set, plain text otherwise.

stderr is the side channel. Warnings, the --why block, and error messages go to stderr. --silent / -q suppresses all stderr output; exit codes are unchanged. Argument-parse errors always print on the real stderr regardless of --silent.

Exit codes

The exit code is the verdict — these are drift severities, not just error/success, so branch on them (don't assume the suite's common scheme):

Exit exit_class Meaning
0 clean No drift detected. Every clause matches. Safe to sign.
1 n/a I/O error — input not found, unreadable, malformed .docx/.pdf.
2 substantive Substantive drift, or --strict/--strict-cosmetic was tripped.
3 cosmetic / typographic Cosmetic-only or typographic-only drift. Informational.
4 moved Clause(s) moved but content identical.

--json output shape (stable across v1.x)

{
  "ok": true,
  "exit_class": "clean",
  "exit_code": 0,
  "base": {
    "path": "negotiated.docx",
    "format": "docx",
    "lossiness": "none",
    "clauses_total": 12,
    "track_changes": []
  },
  "candidate": {
    "path": "ready-to-sign.pdf",
    "format": "pdf",
    "lossiness": "extracted",
    "clauses_total": 12,
    "track_changes": []
  },
  "summary": {
    "clauses_total": 12,
    "clauses_changed": 0,
    "clauses_moved": 0,
    "clauses_added": 0,
    "clauses_removed": 0,
    "differences": {
      "cosmetic": 0,
      "typographic": 0,
      "substantive": 0,
      "added": 0,
      "removed": 0,
      "moved": 0
    },
    "suppressed_by_filter": 0
  },
  "differences": [],
  "warnings": []
}

Read the full file on GitHub · 327 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 · 327 lines · 3,157 tokens per session scan A b5addc944b96

Subscribe to this mod's changes

compare-cli AGENTS.md is an instructions file published in the GitHub repository DrBaher/compare-cli (1 stars, last pushed 29d ago), licensed MIT. It adds 3,157 tokens to every session, about $0.0158 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.