redline

A rules file for comparing the meaning of two AI coding-agent runs. It records each run as a JSONL file—a text file with one JSON record per line—and finds the first point where their behavior differs.

In plain words
What is it for?
Use it to record agent runs, compare their steps, inspect differences, and report the first semantic fork in terminal, JSON, or Markdown formats.
Why use it?
It helps reveal behavioral changes that may be hidden when two runs produce similar final answers. This is useful after changing a prompt, model, or tool.

Cursor rule for Cursor

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

Made for: Cursor.

Per session 510 This file is loaded in full into every session.
When invoked 510 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.00510 $0.00510
Opus 5 $0.00255 $0.00255
Sonnet 5 $0.00102 $0.00102
Haiku 4.5 $0.00051 $0.00051

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

Security

Grade A, and why

redline 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 2d ago.

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.

.cursor/rules/redline.mdc · 44 lines

What it actually says

redline — Cursor Rules

What this project does

Semantic diff engine for AI agent behavior. Records agent traces as JSONL, embeds steps with all-MiniLM-L6-v2, aligns two traces by cosine similarity, detects the first semantic fork point.

Module map

  • trace.py — data model (TraceNode, TraceEdge, AgentTrace, NodeType, EdgeType)
  • embed.py — thread-safe sentence-transformer singleton + sliding-window alignment
  • diff.py — diff_traces() → DiffResult, ForkPoint, StepDiff
  • instrument.py — LangChain callback + record() context manager
  • report.py — Rich/JSON/Markdown formatters
  • cli.py — Click CLI (diff, inspect commands)

Invariants — never break these

  • TraceNode.id is SHA-256[:16] of "{node_type}:{content}" — must stay content-addressed
  • embed_trace() is idempotent — safe to call twice on the same trace
  • fork_threshold=0.70 and match_threshold=0.85 are the defaults; don't change without tests
  • has_regression is True iff fork_point is not None — no other state
  • All embeddings come from the thread-safe _get_model() singleton in embed.py

Code style

  • Python 3.10+, fully type-annotated, mypy strict mode
  • Ruff lint rules: E W F I UP B S N SIM RUF PT
  • No print() in library code — use rich.console.Console
  • All public functions and classes must have Google-style docstrings
  • Tests: pytest, CliRunner for CLI tests, no mocking of embed model (use short test traces)

When adding a new output format

  1. Add to_<format>(result: DiffResult) -> str in report.py
  2. Add format name to --format Choice in cli.py
  3. Add at least 2 tests in tests/test_report.py

When adding a new instrumentation adapter

  1. Create src/redline/instrument_.py
  2. Implement a context manager mirroring record() in instrument.py
  3. Export from init.py, add to all alphabetically
  4. Add tests in tests/test_instrument_.py
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. 2d ago First seen · 44 lines · 510 tokens per session scan A b1b839c095b1

Subscribe to this mod's changes

redline is a cursor rule published in the GitHub repository sandeep-alluru/agentdelta (0 stars, last pushed 16d ago), licensed MIT. It adds 510 tokens to every session, about $0.0026 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.