revdiff CLAUDE.md

Project instructions for revdiff, a terminal interface for reviewing code changes, files, and documents with inline notes. It also documents the project's Go structure, commands, and support for Git, Mercurial, and Jujutsu.

In plain words
What is it for?
Work on revdiff by following its architecture, running its build and test commands, generating mocks, and maintaining its version-control and terminal interface code.
Why use it?
They give an coding agent the project rules needed to build, test, format, lint, and change revdiff consistently. This avoids guessing how the repository is organized or verified.

Instructions file

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/umputun/revdiff/claude-md
Clone the repo
git clone --depth 1 https://github.com/umputun/revdiff
Per session 4,720 This file is loaded in full into every session.
When invoked 4,720 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.04720 $0.04720
Opus 5 $0.02360 $0.02360
Sonnet 5 $0.00944 $0.00944
Haiku 4.5 $0.00472 $0.00472

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

Security

Grade A, and why

revdiff CLAUDE.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.

CLAUDE.md · 94 lines

How it starts

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

revdiff

TUI for reviewing diffs, files, and documents with inline annotations, built with bubbletea.

Architecture: see docs/ARCHITECTURE.md for system design, data flows, interfaces, and design decisions.

Commands

  • Build: make build (output: .bin/revdiff)
  • Test: make test (race detector + coverage, excludes mocks)
  • Lint: make lint or golangci-lint run
  • Format: make fmt or ~/.claude/format.sh
  • Generate mocks: go generate ./...
  • Vendor after adding deps: go mod vendor

Project Structure

  • app/ - composition root (package main), split by concern: main.go (entrypoint + run()), config.go (options/parsing), stdin.go (stdin mode), renderer_setup.go (VCS wiring), themes.go (theme CLI + adapter), history_save.go (session save)
  • app/diff/ - VCS interaction (git + hg + jj), unified diff parsing, VCS detection, Mercurial + Jujutsu support. compare.goCompareReader renderer for --compare-old/--compare-new (runs git diff --no-index, no repo required)
  • app/ui/ - bubbletea TUI package. Single Model struct with state grouped into sub-structs (cfg, layout, file, modes, nav, search, annot), methods split across files by concern (~500 lines each). Each source file has a matching _test.go. See app/ui/doc.go for package docs, docs/ARCHITECTURE.md for file-by-file breakdown. Does not import app/theme or app/fsutil — theme operations go through the ThemeCatalog interface
  • app/ui/style/ - color/style resolution: hex-to-ANSI, lipgloss styles, SGR tracking, HSL math. Types: Resolver, Renderer, SGR. Also display.go - package-level SanitizeFilenameForDisplay and TruncateLeftToWidth, the shared helpers every filename-rendering surface must route through
  • app/ui/sidepane/ - file tree + markdown TOC components with cursor/offset management
  • app/ui/worddiff/ - intra-line word-diff: tokenizer, LCS, line pairing, highlight insertion
  • app/ui/overlay/ - layered popups: help, annotation list, theme selector, file picker. Manager enforces one-at-a-time
  • app/highlight/ - chroma syntax highlighting, foreground-only ANSI
  • app/keymap/ - configurable keybindings (Action constants, parser, defaults, dump)
  • app/theme/ - Catalog-centric theme system: Theme (data + serialization) and Catalog (discovery, loading, installation, gallery). Zero standalone functions — all logic as methods. Files: theme.go (Theme struct), catalog.go (Catalog struct + all operations). 7 bundled + community gallery
  • app/annotation/ - in-memory annotation store and structured output
  • app/editor/ - external $EDITOR invocation for multi-line annotations: temp-file lifecycle, editor resolution ($EDITOR → $VISUAL → vi), and Command() API returning *exec.Cmd + completion func for tea.ExecProcess. Consumed by app/ui via the ExternalEditor interface
  • app/handoff/ - prepares user-configured post-flush shell commands. Annotation snapshots are provided on stdin; stdout is suppressed so helpers cannot overwrite the TUI. Consumed by app/ui via the PostFlushHook interface and tea.ExecProcess
  • app/history/ - review session auto-save to ~/.config/revdiff/history/
  • app/fsutil/ - filesystem utilities
  • app/ui/mocks/ - moq-generated mocks (never edit manually)

Read the full file on GitHub · 94 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 · 94 lines · 4,720 tokens per session scan A a0f7c5c98e9c

Subscribe to this mod's changes

revdiff CLAUDE.md is an instructions file published in the GitHub repository umputun/revdiff (826 stars, last pushed 3d ago), licensed MIT. It adds 4,720 tokens to every session, about $0.0236 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-30.