refine

refine is a command for Claude Code from AhmedHabiba/architor. It costs 0 tokens per session (504 once invoked), scanned A, original, MIT.

A command for revising a software architecture proposal stored in project files. It works through separate evaluation, methodology, and component-design phases.

In plain words
What is it for?
Use it to apply feedback to an evaluation, revise the overall architecture approach, or update the relevant methodology documents.
Why use it?
It keeps proposed changes tied to the current architecture phase and records refinements in the project’s decision log.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to apply feedback to an evaluation, revise the overall architecture approach, or update the relevant methodology documents.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/ahmedhabiba/architor/refine
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/AhmedHabiba/architor

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 refine

README.md
[![agentmods](https://agentmods.dev/badge/commands/ahmedhabiba/architor/refine.svg)](https://agentmods.dev/commands/ahmedhabiba/architor/refine)
Your own site
<a href="https://agentmods.dev/commands/ahmedhabiba/architor/refine"><img src="https://agentmods.dev/badge/commands/ahmedhabiba/architor/refine.svg" alt="Measured on agentmods" 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 504 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.00504
Opus 5 $0.00000 $0.00252
Sonnet 5 $0.00000 $0.00101
Haiku 4.5 $0.00000 $0.00050

Measured 8d ago against content hash 12131ac97652, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

refine 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 8d 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/refine.md · 47 lines

What it actually says

Read .arch/state.json first.

GATE CHECK: Something must be in awaiting_acceptance status. If nothing is pending, say: "Nothing is currently pending refinement. Use /status to check state."

The user wants to refine the current proposal. Their feedback is in $ARGUMENTS.

Determine what is being refined

If Phase 1 (Evaluation):

  • Re-read .arch/phase1-evaluation.md
  • Apply the user's feedback
  • Re-analyze the specific areas mentioned
  • Rewrite .arch/phase1-evaluation.md with updates
  • Append refinement to .arch/decisions.md
  • Present updated analysis, highlight what changed

If Phase 2 (Methodology):

  • Re-read .arch/phase2-methodology.md and .arch/phase2-components-overview.md
  • Apply feedback to the OVERALL approach (not individual components)
  • If user tries to refine a specific component's details: "Individual component refinement happens in Phase 3. In Phase 2, I can adjust the overall architecture pattern, component boundaries, or integration approach. What would you like to change at the system level?"
  • Rewrite both files with updates
  • Present updated methodology and component overview, highlight what changed

If Phase 3 (Component):

  • Read the current component file from .arch/components/[current_component].md
  • Apply feedback to this specific component only
  • Check if changes affect previously accepted components — if yes, FLAG it: "⚠️ This change affects [Component X] which was already accepted. Specifically: [what breaks]. We should address this before proceeding."
  • Rewrite the component file
  • Present updated design, highlight what changed

After refinement:

  • Status remains awaiting_acceptance
  • Append to .arch/decisions.md:
    ### [DEC-NNN] Phase X | Refinement
    - **Decision:** Refined [target] — [brief description of what changed]
    - **Rationale:** [user's feedback that drove the refinement]
    - **Alternatives:** Previous version: [what was changed from]
    - **Trade-offs:** [any trade-offs introduced by the refinement]
    - **Risk:** [any new risk from the change]
    - **References:** [DEC-NNN of the original proposal being refined]
    - **Date:** [timestamp]
    
  • Ask for acceptance again

$ARGUMENTS

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. 8d ago First seen · 47 lines · 0 tokens per session scan A 12131ac97652

Subscribe to this mod's changes

refine is a command published in the GitHub repository AhmedHabiba/architor (6 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 504 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.