model-switch-sentinel

model-switch-sentinel is a skill for Claude Code from oscarsterling/clelp-skills. It costs 73 tokens per session (1,803 once invoked), scanned B, original, MIT.

A session monitor that notices when an AI coding session quietly switches to a cheaper fallback model and prepares a safer return to the intended model.

In plain words
What is it for?
Use it to watch models turn by turn, track fallback periods, emit events, scrub a context brief, and connect your own automation for switching back and restoring the session.
Why use it?
It helps prevent lower-quality answers from being used as the basis for later work. It alerts a person before interrupting active work and cleans the saved context before restoration.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: reads .claude/ paths.

Good fit Use it to watch models turn by turn, track fallback periods, emit events, scrub a context brief, and connect your own automation for switching back and restoring the session.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/oscarsterling/clelp-skills/model-switch-sentinel
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.

Any agent
npx skills add oscarsterling/clelp-skills --skill model-switch-sentinel
Clone the repo
git clone --depth 1 https://github.com/oscarsterling/clelp-skills

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 model-switch-sentinel

README.md
[![agentmods](https://agentmods.dev/badge/skills/oscarsterling/clelp-skills/model-switch-sentinel/github.svg)](https://agentmods.dev/skills/oscarsterling/clelp-skills/model-switch-sentinel)
Your own site
<a href="https://agentmods.dev/skills/oscarsterling/clelp-skills/model-switch-sentinel"><img src="https://agentmods.dev/badge/skills/oscarsterling/clelp-skills/model-switch-sentinel/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 model-switch-sentinel

Your own site · 80×15
<a href="https://agentmods.dev/skills/oscarsterling/clelp-skills/model-switch-sentinel"><img src="https://agentmods.dev/badge/skills/oscarsterling/clelp-skills/model-switch-sentinel.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,803 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00073 $0.01803
Opus 5 $0.00036 $0.00901
Sonnet 5 $0.00015 $0.00361
Haiku 4.5 $0.00007 $0.00180

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

Security

Grade B, and why

model-switch-sentinel scanned grade B with 1 finding 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 10d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (reference/model-sentinel.example.py, scripts/brief-scrub.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`~/.claude/settings.json` (user scope), `.claude/settings.json` (project
model-switch-sentinel/SKILL.md · 144 lines

How it starts

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

Model Switch Sentinel

You are setting up a sentinel that watches the session model per turn and reacts when it silently falls back to a cheaper model. The recovery has to be SAFE: it must not interrupt live work, it must not trust a brief blindly, and it must not let degraded output silently become the foundation for later work.

The package gives you two portable, runnable pieces and one documented seam:

  • reference/model-sentinel.example.py - the per-turn hook. It detects the fallback, does a busy check first, tracks the span of fallback turns, and emits events. It never switches the model itself and never blocks a tool.
  • scripts/brief-scrub.py - the mechanical scrubber that neutralizes turn-boundary and markup injection signatures in the context brief before it is injected into the restored session.
  • The SEAM: switch-back, context clear, and restore are harness-specific. The hook emits events; your automation performs the actual plumbing. You wire it at the config on_event_command field. The package deliberately ships no environment-specific plumbing.

Ring-and-ask is the safe default throughout. Busy heuristics are imperfect, so the sentinel prefers to alert a human and wait over taking an automatic action on a wrong guess.

Step 1: Inspect the setup

  • Settings location. Check, in order, for a hooks-capable settings file: ~/.claude/settings.json (user scope), .claude/settings.json (project scope), .claude/settings.local.json (local scope). Confirm which scope the user wants and read the chosen file.
  • Intended model marker. Ask which model the session is SUPPOSED to run on. You need a substring that appears in that model's harness id (case insensitive). Any observed model lacking that marker is treated as a fallback.
  • Busy probe. Ask how the user can tell, mechanically, that work is in flight. This becomes busy_probe_command: a shell command that exits 0 when busy and non-zero when idle (for example, a check for an active lock file, a task file with open items, or a queue depth). Warn the user that any such heuristic is imperfect, which is exactly why the default is to ring and wait. If they have no reliable probe, leave it empty: the sentinel then stays in alert-and-wait and never claims idle on its own.
  • Automation seam. Ask what should perform the actual switch-back, clear, and restore in their harness. This becomes on_event_command: a shell command the hook runs once per event, with the event JSON on stdin. If they are not ready to automate, leave it empty and consume the handoff JSONL manually.

Read the full file on GitHub · 144 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 144 lines · 73 tokens per session scan B 94c25f178658

Subscribe to this mod's changes

model-switch-sentinel is a skill published in the GitHub repository oscarsterling/clelp-skills (0 stars, last pushed 4d ago), licensed MIT. It adds 73 tokens to every session and 1,803 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.