CLAUDE LABJP
RELEASE — Claude Code v2.1.251 landed on August 28 with close to a hundred changes, built around two themes: tightening permissions and sandboxing, and making usage and cost visibleSECURITY — Read, Write, and Edit could follow a symlink swapped inside the working directory after the permission check had passed, reading or writing outside the approved locationSECURITY — Grep and Glob were not applying Read(...) deny rules to files reached through a symlinked search path. Plugin command path traversal was closed off in the same releaseCOST — /cost now shows a per-session prompt cache line covering hit ratio, misses, tokens re-cached, and warm versus cold, with a matching prompt_cache object for status line scriptsHOOKS — New PreModelSwitch and PostModelSwitch events let you block, confirm, or annotate a model switch, and SessionStart resume hooks now receive staleness and estimated re-cache costMODEL — Seat-billed Enterprise now defaults to Opus 5, and /effort saves a default per model. The 50% weekly limit increase runs through August 31, which leaves one dayRELEASE — Claude Code v2.1.251 landed on August 28 with close to a hundred changes, built around two themes: tightening permissions and sandboxing, and making usage and cost visibleSECURITY — Read, Write, and Edit could follow a symlink swapped inside the working directory after the permission check had passed, reading or writing outside the approved locationSECURITY — Grep and Glob were not applying Read(...) deny rules to files reached through a symlinked search path. Plugin command path traversal was closed off in the same releaseCOST — /cost now shows a per-session prompt cache line covering hit ratio, misses, tokens re-cached, and warm versus cold, with a matching prompt_cache object for status line scriptsHOOKS — New PreModelSwitch and PostModelSwitch events let you block, confirm, or annotate a model switch, and SessionStart resume hooks now receive staleness and estimated re-cache costMODEL — Seat-billed Enterprise now defaults to Opus 5, and /effort saves a default per model. The 50% weekly limit increase runs through August 31, which leaves one day
Articles/API & SDK
API & SDK/2026-08-30Advanced

Read the Catalog Your CLI Already Ships Before Bulk-Replacing Model IDs

A newer generation makes older model IDs look stale. Here is how to pull the catalog embedded in your installed binary, sort every reference into matched, date-mismatched, and malformed, and stop the replacement that would break working IDs.

Claude API119model IDsmigration7auditingoperations24

Premium Article

A few nights after Opus 5 started showing up as the newest model, I was reviewing my own site and stopped mid-scroll. The claude-sonnet-4-6 and claude-opus-4-6 strings scattered through my articles suddenly looked like leftovers.

It seemed like a one-line sed job. I got as far as counting the targets: 209 Japanese articles, 56 of them still indexed. My finger was on the command when I noticed the thing I had not verified.

Were those 4-6 IDs actually invalid?

Had I replaced them without checking, I would have stripped a still-working identifier out of 56 articles and handed readers code that no longer runs. Working as a solo indie developer, that flavor of well-intentioned damage is the one I fear most, because nobody else is going to catch it.

The short version: the Claude Code binary already installed on your machine carries a catalog of the model IDs that version knows about. You can read it without a network call and without an API key. What follows is how to pull it, reconcile it against your own files, and stop the replacement before it lands.

A new generation appearing is not the same event as an ID being retired

Conflating those two is exactly what nearly cost me.

A new generation means the set of options grew. A retirement means requests that used to succeed will start failing, and that normally arrives with an announcement and a date. The first does not imply the second.

The catalog I pulled from v2.1.246 contained claude-opus-4, claude-opus-4-1, claude-opus-4-5, claude-opus-4-6, claude-opus-4-7, claude-opus-4-8, and claude-opus-5 at the same time. Generations show up as a list of things that coexist, not as a history of replacements.

The habit of reading "newest released" as "previous one is dead" gets stronger the faster you skim release notes. I track updates daily, and that reflex almost took over.

The installed binary carries the model catalog

The Claude Code native binary stores its supported model identifiers as plain strings. Pin a version, run strings over it, and you get the full set that build knows about.

#!/usr/bin/env bash
# model_catalog.sh — pull the model ID catalog out of the installed CLI
# usage: ./model_catalog.sh > catalog.txt
set -euo pipefail
 
BIN="$(command -v claude || true)"
if [ -z "$BIN" ]; then
  echo "claude is not on PATH" >&2
  exit 1
fi
BIN="$(readlink -f "$BIN")"
 
# Always record which build you read. The catalog is only what that build knows.
echo "# source: $BIN" >&2
claude --version >&2
 
strings -n 8 "$BIN" \
  | grep -Eo 'claude-(opus|sonnet|haiku|fable)-[0-9][a-z0-9._@-]*' \
  | sort -u

Running it against v2.1.246 (/usr/local/bin/claude, roughly 237MB) produced this:

StageCountWhat it contains
Strings beginning with claude-233Mostly internal identifiers, not models
Containing a family name (opus / sonnet / haiku / fable)38The candidate pool
Matching the ID shape25Directly usable
Failing the shape check13Not all of these are wrong, as shown below

Only 38 of the 233 claude- strings looked like model IDs at all. The rest were internal identifiers such as claude-code-agent-id and claude-cli-internal. A naive grep hands you six times more noise than signal.

This works as long as the binary is not stripped. Distribution formats change, so the gate described later must always have a branch for "the catalog could not be read."

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
You will be able to stop a bulk replacement that would break still-valid IDs, before the command runs
You will be able to pull a catalog of model IDs straight from the binary on your disk, with no network call and no API key
You will be able to narrow more than 1,300 references down to the 63 that actually need attention
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $15 for lifetime access
View Membership →

Related Articles

API & SDK2026-07-11
Tightening Tool Schemas From the Arguments You See in Production
Record the arguments Claude actually passes to your tools in production, then use that distribution to add enums and patterns back into your JSON Schema. With logging code and before/after numbers.
API & SDK2026-07-04
Reading the Claude apps gateway Announcement, I Rebuilt My Indie-Scale Control Plane
The self-hosted Claude apps gateway is a control-plane/data-plane separation you can scale down. Per-app cost attribution, model allowlists, and fail-closed spend caps, implemented as a small Cloudflare Workers proxy.
API & SDK2026-06-24
What I Decided the Day the Ceiling Doubled: A Headroom Budget for Scheduled Jobs on One Shared API Key
Why I did not compress my intervals when the rate limit doubled, and how to design a headroom budget for running several scheduled jobs on one shared API key, with measurement and working code.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →