openrewrite-violations

openrewrite-violations is a command for coding agents from motlin/claude-code-plugins. It costs 18 tokens per session (1,060 once invoked), scanned A, original, Apache-2.0.

A command for applying OpenRewrite recipes—automated code-change rules—to a Java project, with each rule's changes recorded in its own Git commit. It works on a separate branch so the fixes can be reviewed independently.

In plain words
What is it for?
Use it to create an OpenRewrite violations branch, apply each configured recipe, and commit each recipe's fixes separately.
Why use it?
It turns a large set of automated findings into traceable commits, making review and rollback easier. It also checks that existing uncommitted work is not overwritten.

Command

Part of the java plugin — 7 skills, 3 commands, 1 agent shipped together

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/motlin/claude-code-plugins/openrewrite-violations
Clone the repo
git clone --depth 1 https://github.com/motlin/claude-code-plugins

Or install java, the plugin that ships this one along with the rest of its 7 skills, 3 commands, 1 agent.

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 openrewrite-violations

README.md
[![agentmods](https://agentmods.dev/badge/commands/motlin/claude-code-plugins/openrewrite-violations.svg)](https://agentmods.dev/commands/motlin/claude-code-plugins/openrewrite-violations)
Your own site
<a href="https://agentmods.dev/commands/motlin/claude-code-plugins/openrewrite-violations"><img src="https://agentmods.dev/badge/commands/motlin/claude-code-plugins/openrewrite-violations.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,060 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.00018 $0.01060
Opus 5 $0.00009 $0.00530
Sonnet 5 $0.00004 $0.00212
Haiku 4.5 $0.00002 $0.00106

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

Security

Grade A, and why

openrewrite-violations 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.

plugins/java/commands/openrewrite-violations.md · 77 lines

How it starts

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

OpenRewrite Violations

Create a branch named openrewrite-violations, then apply every configured OpenRewrite recipe that has violations one at a time, committing each recipe's changes as a separate commit with the message Fix violations of OpenRewrite rule: <recipe>.

If $ARGUMENTS is provided, use it as the branch name instead of openrewrite-violations.

Require a clean working tree

Run git status --porcelain. If there are uncommitted changes, stop and tell the user — this command creates commits and must start clean. Do not stash or discard their work.

Create the branch

Fetch the upstream default branch and create the new branch from it, so the commits land on top of current main:

git fetch origin
git switch -c openrewrite-violations origin/HEAD

Use a worktree (git worktree add) instead if the user is mid-work on another branch and you should not move their checkout.

Determine how this repo invokes OpenRewrite

Inspect the repo before running anything:

  • If a mise.toml, .mise.toml, or .mise/ config exists, every Maven command must be prefixed with mise exec --, and the config must be trusted first: mise trust. Without the right JDK, the build fails with release version NN not supported.
  • If a justfile defines rewrite-dry-run and rewrite <RECIPE> recipes (common in these repos), prefer them — they already activate the correct profile and recipe dependencies.
  • Otherwise call the plugin directly: mvn rewrite:dryRun and mvn rewrite:run -Drewrite.activeRecipes=<recipe>. Check pom.xml for the rewrite-maven-plugin: if its configuration sits inside a <profile>, add --activate-profiles <that-profile> to every invocation.

Enumerate the recipes that have violations

Run the dry run and capture the full log (it takes minutes):

mise exec -- just rewrite-dry-run 2>&1 | tee .llm/rewrite-dryrun.log | tail -20

The dry run "fails" with Applying recipes would make changes when violations exist — that is the signal to proceed, not an error.

Read the full file on GitHub · 77 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 · 77 lines · 18 tokens per session scan A fd7aa1c958a6

Subscribe to this mod's changes

openrewrite-violations is a command published in the GitHub repository motlin/claude-code-plugins (15 stars, last pushed today), licensed Apache-2.0. It adds 18 tokens to every session and 1,060 once invoked, about $0.0001 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-09-04.