bc-rules-organizer

bc-rules-organizer is an agent for Claude Code from kochetkov-ma/claude-brewcode. It costs 33 tokens per session (2,002 once invoked), scanned A, original, MIT.

An internal agent for organising Brewcode rules.

In plain words
What is it for?
It is spawned by the /brewcode:rules command to organise rules.
Why use it?
It handles a specific internal rules workflow instead of being used directly.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter; reads .claude/ paths; mentions .claude-plugin.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the brewcode plugin — 4 skills, 7 agents shipped together

Good fit It is spawned by the /brewcode:rules command to organise rules.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add kochetkov-ma/claude-brewcode
Claude Code
/plugin install brewcode

Made for: Claude Code.

Or install brewcode, the plugin that ships this one along with the rest of its 4 skills, 7 agents.

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 bc-rules-organizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/kochetkov-ma/claude-brewcode/bc-rules-organizer/github.svg)](https://agentmods.dev/agents/kochetkov-ma/claude-brewcode/bc-rules-organizer)
Your own site
<a href="https://agentmods.dev/agents/kochetkov-ma/claude-brewcode/bc-rules-organizer"><img src="https://agentmods.dev/badge/agents/kochetkov-ma/claude-brewcode/bc-rules-organizer/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 bc-rules-organizer

Your own site · 80×15
<a href="https://agentmods.dev/agents/kochetkov-ma/claude-brewcode/bc-rules-organizer"><img src="https://agentmods.dev/badge/agents/kochetkov-ma/claude-brewcode/bc-rules-organizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,002 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.00033 $0.02002
Opus 5.5 $0.00013 $0.00801
Sonnet 5.5 $0.00007 $0.00400
Haiku 4.5 $0.00003 $0.00200

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

Security

Grade A, and why

bc-rules-organizer 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 today.

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.

brewcode/agents/bc-rules-organizer.md · 154 lines

How it starts

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

Rules Organizer

You organize .claude/rules/*.md: extract rules from any source, write path-scoped or global frontmatter, dedup against rules/CLAUDE.md, and prepare them for LLM use. Writes: briefed .claude/rules/ plus its checkpoint/report below; != ~/.claude/rules/, != CLAUDE.md.

Return

Checkpoint every finished file (path + what changed) to .claude/reports/YYYYMMDD-HHMMSS_rules-organizer/report.md right after writing it, != at the end: maxTurns: 60 is an anti-loop stop, != a budget; written files survive and CC 2.1.246+ returns the output marked partial. On resume read the checkpoint first, continue from its last file.

Final answer: verdict first, then the table and summary line below, path:line for anything that failed. No rule-file bodies, pasted rule tables, extraction notes or preamble; ledger, rationale and excerpts go to the same report dir and you return its path.

| File | Paths | Change |
|------|-------|--------|
| `.claude/rules/components.md` | `src/components/**/*` | new: 6 added |
| `.claude/rules/testing.md` | `**/*.test.*` | updated: 3 added, 2 merged, 4 skipped |

1 new / 1 updated | 9 added, 2 merged, 4 skipped | rules.sh validate: rc 0

Scope

One bounded unit briefed by /brewcode:rules (or /brewcode:convention-setup P7.4); report out-of-scope work to the caller. A brief missing GOAL, SCOPE, CONTEXT, CONSUMER or acceptance: say what is missing, then state a safe assumption or return the question; leave the rules usable as-is.

You have no Agent tool and do not optimize the rule files: return the written paths, and the caller runs the /brewtools:text-optimize pass on them.

Scope Fit

Write only rules the source supports: !=imagined load, !=speculative abstraction. Before a new rule, follow the closest well-built .claude/rules/*.md principles; additive to conventions/rules/docs, !=a replacement.

Procedure

  1. Analyze. Read the source completely. If source/path patterns are missing, return up to 2 questions to the caller; otherwise infer patterns from repo structure. Check existing .claude/rules/*.md for overlap before writing anything.
  2. Extract and classify. Each finding is an anti-pattern (avoid) or a best practice; map it to a path pattern by domain — component src/components/**/*, API src/api/**/*, test **/*.test.*, build build.gradle.kts/package.json.
  3. Dedup before adding. Run the 3-Check Protocol (below) on every candidate row. CLAUDE.md is the dedup baseline only, never a source: "CLAUDE.md" is never written as a Source value.
  4. Write. New avoid.md/best-practice.md or {prefix}-avoid.md/{prefix}-best-practice.md: scaffold with bash "${CLAUDE_PLUGIN_ROOT}/skills/rules/scripts/rules.sh" create or create-specialized <prefix> '<paths>' — this stamps doc_type/version/generated_by/ last_updated for you — then Edit in the table rows. Editing an existing file instead: refresh only last_updated (today) and version (the one in ${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json), leave every other frontmatter key untouched. Main avoid.md/best-practice.md carry no paths:; every other file requires one. Max 20 rows per table — split into a {prefix}- file past that.
  5. Check before returning, per written file. Fix and re-run a failure; a check that cannot run or still fails is named in the return with the reason, in place of "done".
    • bash "${CLAUDE_PLUGIN_ROOT}/skills/rules/scripts/rules.sh" validate prints V <name> valid and no X <name> line. A descriptive-name file is not scanned: read its frontmatter back.
    • grep -c '^| [0-9]' <file> equals the count before your first edit + rows added - rows deleted; a merged or skipped candidate adds no row.
    • Every backtick literal, number and path of a source entry is unchanged in its row: grep -F -- '<literal>' <file>.

Read the full file on GitHub · 154 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. today Changed · +2 lines a889fffb1801
  2. yesterday Changed 035ecba290d4
  3. 2d ago Changed c9d5a1da59d1
  4. 3d ago Changed 666192d2d405
  5. 4d ago Changed · -29 lines · +9 tokens per session 8764aefb4b9d
  6. 11d ago Changed 9e4beaf15c2f
  7. 16d ago Changed · -4 lines d20b5c9830f1
  8. 1mo ago Changed · -121 lines fcdcd0ae1274
  9. 1mo ago First seen · 306 lines · 24 tokens per session scan A bfb3f40ad532

Subscribe to this mod's changes

bc-rules-organizer is an agent published in the GitHub repository kochetkov-ma/claude-brewcode (33 stars, last pushed today), licensed MIT. It adds 33 tokens to every session and 2,002 once invoked, about $0.0001 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 agents, from other repositories

scout

Cheap read-only explorer on Haiku. Use proactively when a question needs several files read, a wide code search, or web docs fetched — anything that would pull more than 10K tokens into the main conversation. Returns a short answer with file:line references. Not worth it for one known file or a single grep.

egorfedorov/claude-context-optimizer · 68 tokens

brain-merge

Semantically merge brain knowledge from multiple Claude Code machines. Use when brain-sync or brain-join detects unstructured content (memory, CLAUDE.md) that needs intelligent merging. This agent gets smarter over time by remembering merge patterns and user preferences.

toroleapinc/claude-brain · 54 tokens

job-search

Use this agent for finding job opportunities, searching job boards, tracking applications, and researching companies. Invoke when the user needs job listings, salary data, company research, or application management. Handles LinkedIn, Indeed, TrueUp, Glassdoor, and Levels.fyi data through MCP tools. Context: User…

Aznatkoiny/zAI-Skills · 220 tokens

idea-validator

Isolated Claude Opus that critiques ideas, designs, patterns, hypotheses, or plans without context from the parent conversation. Use proactively when a non-trivial design decision needs adversarial review from a fresh perspective. Pair with Gemini second-opinion (parallel call) for two independent opinions from…

awrshift/claude-friends · 94 tokens

skill-analyzer

Deep analysis agent for skill quality review. Reviews skill content, instruction clarity, trigger phrase effectiveness, and provides actionable improvement suggestions.

VersoXBT/skill-manager · 29 tokens

sync-spec-kit-agent

Analyzes implementation changes on a feature branch and updates the spec-kit specification folder (.specify/specs/ /) to reflect the current state — new requirements, architecture changes, completed tasks, research findings, and any drift from the original specification. Context: User finished implementing something…

lukaskellerstein/claude-my-marketplace · 229 tokens