revdiff: Instructions file for Claude Code

CLAUDE.md

revdiff CLAUDE.md is an instructions file for Claude Code from umputun/revdiff. It costs 7,783 tokens per session, scanned A, original, MIT.

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 for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_DATA} variable. Also seen: reads .claude/ paths; mentions .claude-plugin; names the ExitPlanMode tool.

This is umputun/revdiff's own configuration. It tells Claude Code how to work on revdiff itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything revdiff configures →

Reuse

Borrowing it

Nothing to install: this file belongs to umputun/revdiff. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/umputun/revdiff/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/umputun/revdiff

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/umputun/revdiff/claude-md/github.svg)](https://agentmods.dev/instructions/umputun/revdiff/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/umputun/revdiff/claude-md"><img src="https://agentmods.dev/badge/instructions/umputun/revdiff/claude-md/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 revdiff CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/umputun/revdiff/claude-md"><img src="https://agentmods.dev/badge/instructions/umputun/revdiff/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 7,783 This file is loaded in full into every session.
When invoked 7,783 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.07783 $0.07783
Opus 5.5 $0.03113 $0.03113
Sonnet 5.5 $0.01557 $0.01557
Haiku 4.5 $0.00778 $0.00778

Measured 9d ago against content hash 682352ece8a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 9d 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.

CLAUDE.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 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/ - all Go source
  • app/revdiff/ - 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.go — CompareReader 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/ptybridge/ - macOS/Linux PTY bridge (package main) built on demand by plugins/opencode/v2/runtime-check.ts to run a real OpenCode CLI in a terminal. Test helper only: make build and goreleaser build ./app/revdiff alone, so it never ships
  • app/ui/mocks/ - moq-generated mocks (never edit manually)

Read the full file on GitHub · 109 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. 9d ago Changed · +1 lines · +363 tokens per session 682352ece8a2
  2. 11d ago Changed · +9 lines · +447 tokens per session 00cd97616665
  3. 1mo ago Changed · +1 lines · +14 tokens per session d7a0b3a864fc
  4. 1mo ago Changed · +4 lines · +2,239 tokens per session 255ddeb87fd0
  5. 1mo ago 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 (928 stars, last pushed 3d ago), licensed MIT. It adds 7,783 tokens to every session, about $0.0311 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-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,649 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,257 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,159 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens