1
00:00:00,140 --> 00:00:04,159
You set up an automated background
subagent, head off to grab a flat white,

2
00:00:04,659 --> 00:00:09,399
and come back to discover it silently
upgraded itself to Opus 5 mid task.

3
00:00:10,260 --> 00:00:12,819
Suddenly your API bill looks like a phone
number.

4
00:00:13,474 --> 00:00:17,534
Oh yeah, that surprise context shift will
get you every time.

5
00:00:18,134 --> 00:00:22,135
Before we dive into how to lock that down,
today's episode is brought to you by

6
00:00:22,295 --> 00:00:27,375
Jellypod AI, the easiest way to turn your
written content into high quality audio

7
00:00:27,514 --> 00:00:28,154
podcasts.

8
00:00:28,250 --> 00:00:34,490
So, Anthropic dropped version 2 point 1
point 251 for Claude Code on August 28,

9
00:00:34,570 --> 00:00:39,050
2026, and it finally gives us proper
brakes for model jumping.

10
00:00:39,281 --> 00:00:44,901
Yeah, the big news is two lifecycle hook
events, PreModelSwitch and PostModelSwitch.

11
00:00:45,361 --> 00:00:49,621
Plus, when you resume a session with
SessionStart, you now get session staleness

12
00:00:49,661 --> 00:00:53,101
metrics and estimated re cache costs right
in the payload.

13
00:00:53,391 --> 00:00:55,351
Walk me through PreModelSwitch though.

14
00:00:55,492 --> 00:00:58,611
How does that stop my agents from spending
all my gold bullion?

15
00:00:58,667 --> 00:01:02,667
It fires synchronously right before any
model transition happens.

16
00:01:02,800 --> 00:01:08,747
So if an agent tries to bump up from Haiku
to Opus, platform engineers can catch it,

17
00:01:08,804 --> 00:01:13,387
demand developer confirmation in the
terminal, or just outright block it in CI CD

18
00:01:13,451 --> 00:01:14,187
pipelines.

19
00:01:14,167 --> 00:01:15,367
Ah, that's beautiful mate.

20
00:01:15,547 --> 00:01:20,567
You can also attach custom audit
annotations to your team telemetry logs so you know

21
00:01:20,647 --> 00:01:23,047
who requested the upgrade and why.

22
00:01:23,182 --> 00:01:23,821
Exactly.

23
00:01:24,402 --> 00:01:26,301
Setting it up is super straightforward.

24
00:01:26,801 --> 00:01:31,181
In your project, you open up dot claude
slash hooks dot json and point a

25
00:01:31,342 --> 00:01:35,801
PreModelSwitch handler to a validation
script, say validate model dot py.

26
00:01:35,833 --> 00:01:39,673
Right, the script checks the target model
ID from the event payload,

27
00:01:39,693 --> 00:01:44,873
and if it breaks your team policy, you
just exit with code 1 or return a denial JSON

28
00:01:44,942 --> 00:01:45,433
object.

29
00:01:45,561 --> 00:01:47,273
Boom, request blocked.

30
00:01:47,491 --> 00:01:49,171
Just watch out for edge cases though.

31
00:01:49,752 --> 00:01:53,911
If you block model switches too
aggressively, you will break subagent workflows that

32
00:01:53,951 --> 00:01:57,172
legitimately need higher reasoning models
to fix a complex bug.

33
00:01:57,307 --> 00:01:58,067
Yeah, fair call.

34
00:01:59,347 --> 00:02:02,507
And while SessionStart gives you re cache
cost estimates on resume,

35
00:02:03,007 --> 00:02:06,668
if your prompt shifted massively while you
were away, you're still hitting a full

36
00:02:06,727 --> 00:02:08,088
cold cache miss regardless.

37
00:02:08,250 --> 00:02:08,930
True.

38
00:02:08,980 --> 00:02:12,490
But there are some slick quality of life
tweaks in this release too.

39
00:02:12,610 --> 00:02:17,690
The slash cost command now breaks down
your prompt cache hit ratios between warm and

40
00:02:17,754 --> 00:02:18,650
cold tokens.

41
00:02:18,667 --> 00:02:22,987
Plus slash effort now remembers your
preference per model, so you don't have to keep

42
00:02:23,035 --> 00:02:23,867
resetting it.

43
00:02:23,947 --> 00:02:28,667
And you get direct CLI management commands
like claude attach with session ID,

44
00:02:28,747 --> 00:02:31,227
stop, respawn, and rm.

45
00:02:31,327 --> 00:02:34,787
No more hunting down rogue background
processes manually.

46
00:02:34,807 --> 00:02:37,327
You have full command line governance from
top to bottom.

