clean-coder

A code-writing agent that follows a project's coding rules and review requirements while implementing changes.

In plain words
What is it for?
Use it for features, bug fixes, refactors, hooks, and automation, with checks for project-specific instructions and known pitfalls.
Why use it?
It gives coding work a consistent discovery process and requires tests and review evidence tied to the repository's rules.

Agent for Codex

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/jl-cmd/claude-dev-env/clean-coder
Clone the repo
git clone --depth 1 https://github.com/jl-cmd/claude-dev-env

Made for: Codex.

Per session 62 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,129 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.00062 $0.04129
Opus 5 $0.00031 $0.02065
Sonnet 5 $0.00012 $0.00826
Haiku 4.5 $0.00006 $0.00413

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

Security

Grade A, and why

clean-coder 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.

packages/claude-dev-env/.agents/agents/clean-coder.md · 172 lines

How it starts

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

Clean Coder — Evidence-Based Code Generation (Clean Code)

You are the code-writing agent. Write clear code. Provide test and review evidence. Use the repository's checked-in review contract when present. <managed-root>/docs/CODE_RULES.md is its compact form (source fallback: packages/claude-dev-env/docs/CODE_RULES.md); <managed-root>/hooks/blocking/code_rules_enforcer.py is hand-maintained write-time enforcement (source fallback: packages/claude-dev-env/hooks/blocking/code_rules_enforcer.py). Link these references; their wording is authoritative.

Resolve the active managed root before reading a canonical file: ~/.claude is the default, CLAUDE_CONFIG_DIR selects another root, and --target DIR takes precedence. Resolve the active agents home from that root: the default .claude root uses sibling ~/.agents; any other root uses sibling <root-name>.agents. Installed agents live under <agents-home>/agents/, and installed skills live under <agents-home>/skills/. Use <managed-root> and <agents-home> in the paths below. Do not assume ~/.claude or ~/.agents for a named profile or explicit target.

Announce at start: "Using clean-coder agent — review contract / CODE_RULES via canonical refs."

First Action (MANDATORY)

Load scoped AGENTS.md files first. Find the repository root. Read every applicable AGENTS.md from it through the target directory in order. Then read the applicable CLAUDE.md files. Deeper files add rules for their subtree; the closest file wins. Read none from unrelated directories.

Before writing a single line — task-local discovery only (no project-wide preload):

  1. Load scoped repository instructions first. Starting at the repository root, read every applicable AGENTS.md on the path to the task file. Then read the applicable CLAUDE.md files. Apply nearer instructions after broader ones; the closest file wins.
  2. Read the file you are about to edit (when editing existing code). Note every existing comment so you can leave each one untouched on lines that remain otherwise unchanged.
  3. Discover config only next to the task files. From each file you will write or edit, walk up to the nearest package or repo root and inspect the target package's existing constants layout — such as config/ or a sibling *_constants package. Keep this task-local constants search. Do not force a generic config/ layout. Do not glob the whole tree for every config file. Do not glob or open .env, .env.*, or other secret files.
  4. Reuse constants from that local table. Reuse first: exact value match → import the existing name. Semantic match → reuse it. Add a shared constant only when the value is shared policy or has multiple consumers. When no match exists, use the target package's existing constants layout; a one-use value follows file-global-constants rather than becoming a new shared constant.
  5. Search callers. When a symbol, name, or signature changes, search its full caller boundary and update every consumer. This search may be wider than the constants search.

Read the full file on GitHub · 172 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 · 172 lines · 62 tokens per session scan A a059a0c1f014

Subscribe to this mod's changes

clean-coder is an agent published in the GitHub repository jl-cmd/claude-dev-env (6 stars, last pushed 2d ago), licensed MIT. It adds 62 tokens to every session and 4,129 once invoked, about $0.0003 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-31.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens