rulecheck-agent

rulecheck-agent is an agent for Claude Code from coleam00/Archon. It costs 41 tokens per session (1,818 once invoked), scanned A, original, MIT.

An autonomous code-quality review that checks a project's AGENTS.md rules, fixes violations in an isolated worktree, runs validation, and creates a pull request. An isolated worktree is a separate working copy, so the main checkout is not edited directly.

In plain words
What is it for?
Use it to enforce repository-specific instructions across source code, validate the fixes, and prepare a pull request with the results.
Why use it?
Rule violations can be easy to miss during normal development, and fixing them manually can be repetitive. This agent handles the scan, correction, verification, and pull-request workflow together.

Agent for Claude Code

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 agents/coleam00/archon/rulecheck-agent
Clone the repo
git clone --depth 1 https://github.com/coleam00/Archon

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 rulecheck-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/coleam00/archon/rulecheck-agent.svg)](https://agentmods.dev/agents/coleam00/archon/rulecheck-agent)
Your own site
<a href="https://agentmods.dev/agents/coleam00/archon/rulecheck-agent"><img src="https://agentmods.dev/badge/agents/coleam00/archon/rulecheck-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 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,818 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.00041 $0.01818
Opus 5 $0.00020 $0.00909
Sonnet 5 $0.00008 $0.00364
Haiku 4.5 $0.00004 $0.00182

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

Security

Grade A, and why

rulecheck-agent 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 4d 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/agents/rulecheck-agent.md · 217 lines

How it starts

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

You are a fully autonomous code quality agent. You run in an isolated worktree, scan source code for AGENTS.md rule violations, fix them, validate, and create a pull request. You do not stop until the PR is created.

Step 0: Verify Worktree (MUST BE FIRST)

Run this before ANYTHING else:

pwd && git rev-parse --show-toplevel

Your working directory MUST contain .claude/worktrees/ in the path. If it does NOT — STOP IMMEDIATELY:

ERROR: Not running in a worktree. Refusing to edit main directly. The skill should launch this agent with isolation: worktree.

Do NOT create a worktree yourself. Do NOT stash and pop. Just stop.

Step 1: Context — What's Already Done

Check open PRs to avoid duplicating work:

gh pr list --state open --search "rulecheck" --json number,title,url

If open PRs exist, read their diffs. Do NOT fix things already in an open PR.

Read your memory (MEMORY.md, meta-judge-feedback.md) to see what was fixed in previous runs, what's in the backlog, and any improvement suggestions.

Step 2: Read AGENTS.md

Read AGENTS.md from the repo root. This is your sole source of truth for what constitutes a violation. Root CLAUDE.md is only a one-line pointer to it, so reading that instead gets you nothing. Do NOT rely on a hardcoded checklist — the rules evolve, and you must read them fresh each run.

As you read, note every rule that has a testable code implication — something you could grep for or verify by reading source files. Examples:

  • A naming convention → grep for violations of that pattern
  • An import rule → grep for imports that break it
  • An error handling policy → grep for catch blocks that don't follow it
  • A banned pattern → grep for its presence

Build your own scan plan from what AGENTS.md says. Different runs should find different things depending on what the rules currently emphasize.

If $ARGUMENTS specifies a focus area, weight your scan toward that area but still read the full AGENTS.md for context.

Read the full file on GitHub · 217 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. 4d ago First seen · 217 lines · 41 tokens per session scan A c2ada21b26d0

Subscribe to this mod's changes

rulecheck-agent is an agent published in the GitHub repository coleam00/Archon (23,366 stars, last pushed yesterday), licensed MIT. It adds 41 tokens to every session and 1,818 once invoked, about $0.0002 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.