diff

A command that compares two JSONL files containing records of an AI agent's actions. It reports whether the newer trace followed a different behavior path from a baseline.

In plain words
What is it for?
Compare baseline and candidate agent traces, identify the step and tool where they diverged, report similarity and step-count changes, and return an exit code when requested.
Why use it?
It helps detect behavioral regressions—unexpected changes in tool use or reasoning steps—even when the final answer is unchanged.

Command for Claude Code

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/sandeep-alluru/agentdelta/diff
Clone the repo
git clone --depth 1 https://github.com/sandeep-alluru/agentdelta

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 293 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.00000 $0.00293
Opus 5 $0.00000 $0.00147
Sonnet 5 $0.00000 $0.00059
Haiku 4.5 $0.00000 $0.00029

Measured today against content hash bc3b9e55834c, 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 today.

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.

.claude/commands/diff.md · 22 lines

What it actually says

Diff two agentdelta trace files and report any behavioral regression.

Usage: /project:diff <baseline.jsonl> <candidate.jsonl> [--format rich|json|markdown] [--exit-code]

Steps:

  1. Run: agentdelta diff $ARGUMENTS
  2. Parse the output:
    • "REGRESSION DETECTED" → a ForkPoint was found; show the fork step, tool change, and similarity score
    • "No regression" → traces are equivalent; show match percentage
  3. If a fork is detected, explain in plain English what changed:
    • Tool change (e.g. get_weather → web_search): mention latency/reliability implications
    • Reasoning divergence: mention that the LLM reasoning path changed even if the final answer is the same
    • Step count difference: mention added/removed tool calls
  4. Suggest a remediation if asked: tighten the system prompt, pin the model version, or add a unit test fixture for this trace pair.

Context:

  • Traces are JSONL files — one JSON object per line (trace_meta, node, edge records)
  • Fork threshold default: 0.70 cosine similarity
  • Match threshold default: 0.85 cosine similarity
  • The embedding model is all-MiniLM-L6-v2, runs locally, no API key needed
  • has_regression is True iff fork_point is not None
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. today First seen · 22 lines · 0 tokens per session scan A bc3b9e55834c

Subscribe to this mod's changes

diff is a command published in the GitHub repository sandeep-alluru/agentdelta (0 stars, last pushed 14d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 293 tokens. 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.