update-models

A guided five-step process for refreshing the AI models recommended by OpenRouter, a service that lists and provides access to language models. It collects rankings, asks for approval, updates a shared file, and copies the changes to plugins.

In plain words
What is it for?
Use it to review trending OpenRouter models, approve a new model list, update the shared configuration, and sync that list across plugins.
Why use it?
It removes the need to manually gather model rankings, decide what to change, edit files, and synchronize several plugins. It also coordinates recovery when a step fails.

Command 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 commands/madappgang/claude-code/update-models
Clone the repo
git clone --depth 1 https://github.com/MadAppGang/claude-code

Made for: Claude Code.

Per session 51 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 9,909 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.00051 $0.09909
Opus 5 $0.00026 $0.04954
Sonnet 5 $0.00010 $0.01982
Haiku 4.5 $0.00005 $0.00991

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

Security

Grade A, and why

update-models 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 2d 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/update-models.md · 1,146 lines

How it starts

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

<user_request> $ARGUMENTS </user_request>

  You MUST:
  - Use Task tool to delegate ALL data manipulation to agents
  - Use AskUserQuestion for user approval gate
  - Use Bash for running sync script and git commands
  - Use Read for file verification only
  - Use Glob/Grep for finding files

  You MUST NOT:
  - Use Write or Edit tools directly
  - Perform filtering, categorization, or file updates yourself
  - Manipulate data structures
  - Only coordinate workflow and make decisions about delegation

  **Rationale:** Orchestrators coordinate but never manipulate data. All data operations
  must be delegated to specialized agents with appropriate tool permissions.
</orchestrator_role>

<todowrite_requirement>
  You MUST use the TodoWrite tool to create and maintain a todo list throughout your orchestration workflow.

  **Before starting**, create a todo list with all 5 phases:
  1. PHASE 0: Initialization
  2. PHASE 1: Scrape and Filter Models
  3. PHASE 2: User Approval
  4. PHASE 3: Update Shared File
  5. PHASE 4: Sync to Plugins

  **Update continuously**:
  - Mark tasks as "in_progress" when starting
  - Mark tasks as "completed" immediately after finishing
  - Keep only ONE task as "in_progress" at a time
</todowrite_requirement>

<delegation_contract mandatory="true">
  **Strict Delegation Rules:**

  - ALL scraping → model-scraper agent
  - ALL filtering/deduplication/categorization → model-scraper agent
  - ALL file updates → model-scraper agent
  - Orchestrator only: coordinates, validates, approves, recovers from errors

  **Never violate this contract.** If you find yourself about to use Write/Edit,
  STOP and delegate to model-scraper instead.
</delegation_contract>

<user_approval_gate mandatory="true">
  You MUST present filtered model list to user before updating:

  - Show: model IDs, providers, categories, pricing
  - Allow user to: approve, modify, or reject
  - Do NOT proceed without approval
  - Support structured modification input (see knowledge section)
</user_approval_gate>

</critical_constraints>

<core_principles> - Orchestrator coordinates but never manipulates data - All data operations delegated to specialized agents - Clear separation of concerns: orchestration vs implementation - Tool restrictions enforced: NO Write/Edit in orchestrator

<principle name="Context-Aware Filtering" priority="high">
  Provide these filtering rules to model-scraper agent:

  1. **Anthropic Filter**: Exclude all Anthropic models (Claude available natively)
  2. **Provider Deduplication**: Max 1 per provider (keep top-ranked)
  3. **Category Balance**: Min 2 models per category (coding, reasoning, vision, budget)
  4. **Target Count**: 9-12 models
  5. **Diversity**: ≥5 different providers

  **Category Balance Override:**
  - If category has <2 models after deduplication, allow 2nd model from that provider
  - Priority: Category diversity > Provider deduplication
</principle>

<principle name="Safe Updates" priority="high">
  - Always read existing file first for verification
  - Create backup before sync
  - Rollback on any failure
  - Preserve existing file if update fails
  - User approval required before modifications
</principle>

<principle name="Error Recovery with Retry Limits" priority="high">
  - Handle scraping failures gracefully (max 3 attempts)
  - Rollback on sync script errors
  - Partial sync recovery (continue with successful, retry failures)
  - Log all errors for debugging
  - User decision gates for ambiguous failures
</principle>

</core_principles>

Read the full file on GitHub · 1,146 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. 2d ago First seen · 1,146 lines · 51 tokens per session scan A 1c7cf0fafbe7

Subscribe to this mod's changes

update-models is a command published in the GitHub repository MadAppGang/claude-code (279 stars, last pushed 5mo ago), licensed MIT. It adds 51 tokens to every session and 9,909 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-30.