claude-scaffold: Command for Claude Code

.claude/commands/mode-switch.md

mode-switch is a command for Claude Code from pyramidheadshark/claude-scaffold. It costs 0 tokens per session (727 once invoked), scanned A, original, MIT.

A command that changes how Claude models are assigned across registered repositories. It supports default, economy, and no-sonnet modes.

In plain words
What is it for?
Use it to switch all registered repositories to a chosen routing mode, with confirmation when needed.
Why use it?
It provides an explicit way to adjust model routing when you want to reduce usage, or when a particular model is unavailable.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions Claude Code.

This is pyramidheadshark/claude-scaffold's own configuration. It tells Claude Code how to work on claude-scaffold itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-scaffold configures →

Reuse

Borrowing it

Nothing to install: this file belongs to pyramidheadshark/claude-scaffold. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/pyramidheadshark/claude-scaffold/main/.claude/commands/mode-switch.md
Clone the repo
git clone --depth 1 https://github.com/pyramidheadshark/claude-scaffold

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 mode-switch

README.md
[![agentmods](https://agentmods.dev/badge/commands/pyramidheadshark/claude-scaffold/mode-switch.svg)](https://agentmods.dev/commands/pyramidheadshark/claude-scaffold/mode-switch)
Your own site
<a href="https://agentmods.dev/commands/pyramidheadshark/claude-scaffold/mode-switch"><img src="https://agentmods.dev/badge/commands/pyramidheadshark/claude-scaffold/mode-switch.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 727 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.1 $0.00000 $0.00727
Opus 5 $0.00000 $0.00364
Sonnet 5 $0.00000 $0.00145
Haiku 4.5 $0.00000 $0.00073

Measured 6d ago against content hash 0a759435cbf2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

mode-switch 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 6d 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/mode-switch.md · 59 lines

How it starts

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

/mode-switch

Switch claude-scaffold model routing mode across all registered repos.

Use this slash command as an explicit alternative to natural-language detection. If the user says things like "переходим в экономный режим" or "switch to economy mode" the mode-detector.js hook will catch it automatically; this slash command is the fallback when the detector misses or the user prefers explicit invocation.

Available modes

Mode power repos standard repos balanced repos When to use
default Sonnet 4.6 Haiku 4.5 Haiku 4.5 Regular development
economy Haiku 4.5 Haiku 4.5 Haiku 4.5 Sonnet quota draining, simple tasks
no-sonnet Opus 4.7 Haiku 4.5 Opus 4.7 Sonnet unavailable, critical decisions need Opus

Instructions for Claude Code

When the user invokes /mode-switch, they may provide the target mode as an argument (e.g. /mode-switch economy). If no argument is given, ask which mode they want.

Steps

  1. Determine target mode: read it from the /mode-switch <mode> argument, or ask the user if missing. Valid values: default, economy, no-sonnet.
  2. Ask for confirmation: show a brief preview — "This will rewrite .claude/settings.json across all 30 registered repos. Proceed?"
  3. On confirmation, run via Bash:
    claude-scaffold mode <mode>
    
  4. After switching, warn the user explicitly:
    • "The active Claude Code session still uses the old model. Close and reopen the session to apply the new mode."
    • "Per-repo overrides can be set with claude-scaffold mode set-profile <power|standard|balanced> <repo-path> before re-running this command."
  5. Check quota after switching: suggest claude-scaffold quota status to verify usage and budget alignment for the new mode.

Transient (single-task) model change

If the user wants a one-off model change only for the current task (not persistent), do not run claude-scaffold mode. Instead use Claude Code's session-local /model slash command:

Read the full file on GitHub · 59 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. 6d ago First seen · 59 lines · 0 tokens per session scan A 0a759435cbf2

Subscribe to this mod's changes

mode-switch is a command published in the GitHub repository pyramidheadshark/claude-scaffold (4 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 727 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.