hermit-agent: Command for Claude Code

.claude/commands/code-apply-hermit.md

code-apply-hermit is a command for Claude Code from cafitac/hermit-agent. It costs 0 tokens per session (1,173 once invoked), scanned A, original, MIT.

A command that passes findings from the latest code review to Hermit, an automated code-editing system.

In plain words
What is it for?
Use it with a pull-request number and optional severity filters to apply P1–P5 review findings in the relevant worktree.
Why use it?
It lets the review findings guide mechanical edits without rereading every file and manually repeating each change.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions subagents.

This is cafitac/hermit-agent's own configuration. It tells Claude Code how to work on hermit-agent 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 hermit-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cafitac/hermit-agent. 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/cafitac/hermit-agent/main/.claude/commands/code-apply-hermit.md
Clone the repo
git clone --depth 1 https://github.com/cafitac/hermit-agent

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 code-apply-hermit

README.md
[![agentmods](https://agentmods.dev/badge/commands/cafitac/hermit-agent/code-apply-hermit/github.svg)](https://agentmods.dev/commands/cafitac/hermit-agent/code-apply-hermit)
Your own site
<a href="https://agentmods.dev/commands/cafitac/hermit-agent/code-apply-hermit"><img src="https://agentmods.dev/badge/commands/cafitac/hermit-agent/code-apply-hermit/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 code-apply-hermit

Your own site · 80×15
<a href="https://agentmods.dev/commands/cafitac/hermit-agent/code-apply-hermit"><img src="https://agentmods.dev/badge/commands/cafitac/hermit-agent/code-apply-hermit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 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,173 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.01173
Opus 5.5 $0.00000 $0.00469
Sonnet 5.5 $0.00000 $0.00235
Haiku 4.5 $0.00000 $0.00117

Measured 2mo ago against content hash ee66af184cab, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-apply-hermit 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 2mo 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/commands/code-apply-hermit.md · 158 lines

How it starts

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

/code-apply-hermit — Claude reads the review, Hermit applies it

Hands the P1–P5 findings from the most recent /code-review to Hermit so Claude doesn't burn tokens re-reading every file and retyping every edit. Claude stays on judgment; Hermit does the mechanical apply.

Arguments

$ARGUMENTS — PR number, optionally followed by severity filters. Examples: 123, 123 P1 P2 P3.

  • --model <model_name> — which executor model Hermit should run. Defaults to the gateway's active model (./bin/gateway.sh --status to see the current pick).

Prerequisites

  • A /code-review output from the previous turn in this conversation.
  • Hermit gateway + MCP server running.

Workflow

Step 1 — locate the worktree

If the argument contains a PR number, follow the repo's worktree convention to resolve the worktree path (or infer from the current branch if you are already inside it). If no worktree / PR info can be resolved, ask the user which directory to operate on.

Step 2 — harvest review findings

Scan the prior conversation for the last /code-review output and extract each finding: severity, file path, line number, description, and the proposed direction.

If no review output is present, stop and tell the user to run /code-review $ARGUMENTS first.

Step 3 — choose what to apply

  • Default: every P1 through P5 item.
  • Filter: if severities are listed in $ARGUMENTS (e.g. P1 P2), apply only those.

Step 3.5 — write findings to disk

Save the selected findings to:

.omc/reviews/<branch>-review-<YYYYMMDDHHMMSS>.md

Format:

# Code Review Findings — <branch>

## P1
- `path/to/file.py:42` — short description — suggested fix

## P2
- ...

Step 4 — concurrency lock

mkdir -p .hermit
cat > .hermit/active-task.lock <<EOF
{
  "task_id": "<filled-after-run_task>",
  "started_at": "$(date -Iseconds)",
  "skill": "code-apply-hermit",
  "pr": "$ARGUMENTS",
  "cwd": "<worktree_path>",
  "findings": "<findings_file_path>"
}
EOF

Read the full file on GitHub · 158 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. 2mo ago First seen · 158 lines · 0 tokens per session scan A ee66af184cab

Subscribe to this mod's changes

code-apply-hermit is a command published in the GitHub repository cafitac/hermit-agent (4 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,173 tokens. 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.