redline

redline is a cursor rule for Cursor from sandeep-alluru/agentdelta. It costs 510 tokens per session, scanned A, original, MIT.

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

Written for Cursor: installed under .cursor/. Also seen: mentions Cursor.

Good fit Use it to record agent runs, compare their steps, inspect differences, and report the first semantic fork in terminal, JSON, or Markdown formats.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/sandeep-alluru/agentdelta/redline
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.

Clone the repo
git clone --depth 1 https://github.com/sandeep-alluru/agentdelta

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for redline

README.md
[![agentmods](https://agentmods.dev/badge/rules/sandeep-alluru/agentdelta/redline/github.svg)](https://agentmods.dev/rules/sandeep-alluru/agentdelta/redline)
Your own site
<a href="https://agentmods.dev/rules/sandeep-alluru/agentdelta/redline"><img src="https://agentmods.dev/badge/rules/sandeep-alluru/agentdelta/redline/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for redline

Your own site · 80×15
<a href="https://agentmods.dev/rules/sandeep-alluru/agentdelta/redline"><img src="https://agentmods.dev/badge/rules/sandeep-alluru/agentdelta/redline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00510 $0.00510
Opus 5.5 $0.00204 $0.00204
Sonnet 5.5 $0.00102 $0.00102
Haiku 4.5 $0.00051 $0.00051

Measured 1mo ago against content hash b1b839c095b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 2mo ago), licensed MIT. It adds 510 tokens to every session, about $0.0020 per session on Opus 5.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.