polish

polish is a command for Claude Code from eddiebelaval/squire. It costs 0 tokens per session (1,186 once invoked), scanned A, original, MIT.

A code-quality command that reviews recently written code, simplifies it, applies the approved changes, and can run verification checks. It can also limit the work to selected files or skip particular phases.

In plain words
What is it for?
Use it to review changed files, simplify implementation, run type checks and builds, or preview suggested changes without applying them.
Why use it?
It helps catch defects and unnecessary complexity before code is considered finished.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to review changed files, simplify implementation, run type checks and builds, or preview suggested changes without applying them.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/eddiebelaval/squire/polish
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.

Clone the repo
git clone --depth 1 https://github.com/eddiebelaval/squire

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 polish

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/eddiebelaval/squire/polish"><img src="https://agentmods.dev/badge/commands/eddiebelaval/squire/polish.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,186 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.01186
Opus 5 $0.00000 $0.00593
Sonnet 5 $0.00000 $0.00237
Haiku 4.5 $0.00000 $0.00119

Measured 5d ago against content hash 80087c7f81d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

polish 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 5d 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.

commands/polish.md · 160 lines

How it starts

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

/polish - Code Review + Simplify (Full Auto)

You are polishing code that was just written. This runs a two-phase quality pass — review then simplify — and auto-applies all changes. The user sees a final report of everything that changed.

Philosophy: Ship clean code without manual review overhead. Review catches bugs and violations. Simplify catches complexity and clutter. Together they produce code that's correct AND readable.

Arguments

Parse $ARGUMENTS for:

  • --files <glob> - Only polish specific files (e.g., --files src/components/**/*.tsx)
  • --skip-review - Skip the code review phase, only simplify
  • --skip-simplify - Skip the simplification phase, only review
  • --no-verify - Skip build/type-check verification at the end
  • --dry-run - Show what would change but don't apply anything
  • Empty = polish all changes on the current branch vs base (most common usage)

Step 0: Detect Scope

Determine what code to polish:

# Find base branch
BASE=$(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null)

# Get changed files
git diff $BASE..HEAD --name-only
git diff --name-only          # Also include unstaged changes
git diff --cached --name-only # Also include staged changes

If --files was provided, use that glob instead.

Build a file list of everything that will be polished. Report it:

Polishing [N] files on branch [branch-name] (vs [base-branch])

If there are no changes detected, inform the user and exit.


Step 1: Code Review (AUTO-APPLY)

Unless --skip-review was passed:

Launch the feature-dev:code-reviewer agent via the Task tool:

  • Pass it the list of changed files
  • Ask it to review for: bugs, logic errors, security vulnerabilities, code quality issues, and adherence to project conventions
  • Request it returns findings with confidence levels

Auto-fix everything the reviewer flags:

  • Missing/incorrect imports
  • Unused variables and imports
  • Security issues (XSS, injection, etc.)
  • Logic errors and off-by-one bugs
  • Type errors and missing type annotations
  • Convention violations (naming, patterns)
  • Dead code and unreachable branches

Read the full file on GitHub · 160 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. 5d ago First seen · 160 lines · 0 tokens per session scan A 80087c7f81d1

Subscribe to this mod's changes

polish is a command published in the GitHub repository eddiebelaval/squire (21 stars, last pushed 24d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,186 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-09-03.