1
00:00:00,000 --> 00:00:00,874
Welcome to the show.

2
00:00:00,874 --> 00:00:05,072
James, I want to start with two ugly
little strings that can absolutely

3
00:00:05,072 --> 00:00:38,601
change your afternoon:
`ENABLE_PROMPT_CACHING_1H` and

4
00:00:05,072 --> 00:00:38,601
`FORCE_PROMPT_CACHING_5M`.

5
00:00:38,601 --> 00:00:43,743
In Claude Code 2.

6
00:00:38,601 --> 00:00:43,743
1.108, those are now the explicit
prompt-cache TTL choices

7
00:00:43,743 --> 00:00:46,434
-- one hour, or five minutes.

8
00:00:46,434 --> 00:00:50,108
And if you've ever looked at a bill
mid-debug session and gone,

9
00:00:50,108 --> 00:00:54,976
"Hang on, why is this thing suddenly
chewing through money like a trail bike

10
00:00:50,108 --> 00:00:54,976
through petrol?"

11
00:00:54,976 --> 00:00:55,456
...

12
00:00:55,456 --> 00:00:59,895
this is probably the reason.
Wait -- the `5M` is the one that

13
00:00:59,895 --> 00:01:01,035
can bite you, right?

14
00:01:01,035 --> 00:01:05,288
Because five minutes sounds fine until
you're twenty minutes into a refactor

15
00:01:05,288 --> 00:01:10,920
and the model has to re-read the same
giant context blob again.

16
00:01:05,288 --> 00:01:10,920
Exactly.

17
00:01:10,920 --> 00:01:14,713
Same large system prompt,
same codebase context,

18
00:01:14,713 --> 00:01:19,187
same working goal -- but if that cache
dies every five minutes,

19
00:01:19,187 --> 00:01:21,901
you're paying to rebuild that context
again and again.

20
00:01:21,901 --> 00:01:24,059
Not every single turn, obviously,

21
00:01:24,059 --> 00:01:27,970
but often enough that in a long debugging
loop it adds up.

22
00:01:27,970 --> 00:01:31,581
It's like paying a mate to re-open the
toolbox every time you ask for

23
00:01:31,581 --> 00:01:36,634
the same spanner.And the
specific win with

24
00:01:31,581 --> 00:01:36,634
`ENABLE_PROMPT_CACHING_1H`

25
00:01:36,634 --> 00:01:39,933
is that it better matches how people
actually work.

26
00:01:39,933 --> 00:01:42,723
A real coding session isn't always this
clean,

27
00:01:42,723 --> 00:01:43,916
uninterrupted sprint.

28
00:01:43,916 --> 00:01:46,627
You get pulled into Slack, you grab lunch,

29
00:01:46,627 --> 00:01:49,974
you run tests, you stare at a stack trace
for twelve minutes.

30
00:01:49,974 --> 00:01:54,518
One hour covers that.

31
00:01:49,974 --> 00:01:54,518
Yeah, that's the sweet spot.

32
00:01:54,518 --> 00:02:00,066
Same context, same task, whole afternoon
humming along -- that's EXACTLY

33
00:02:00,066 --> 00:02:01,310
what cache hits are for.

34
00:02:01,310 --> 00:02:05,215
If Claude's been fed your repo shape and
your constraints already,

35
00:02:05,215 --> 00:02:07,372
you don't want to keep re-paying for the
same meal.

36
00:02:07,372 --> 00:02:11,295
You want it plated once and reused while
the work is still basically

37
00:02:11,295 --> 00:02:15,076
the same.But we should be
careful here: the one-hour cache

38
00:02:15,076 --> 00:02:19,370
isn't just "longer is better." The 1-hour
entries cost more to write than

39
00:02:19,370 --> 00:02:20,388
the 5-minute ones.

40
00:02:20,388 --> 00:02:21,747
So you're making a bet.

41
00:02:21,747 --> 00:02:25,215
You're paying more upfront because you
expect enough reuse to make it

42
00:02:25,215 --> 00:02:27,118
worth it.

43
00:02:25,215 --> 00:02:27,118
Right, that's the trade.

44
00:02:27,118 --> 00:02:31,674
More cache hits can mean lower per-turn
cost over the session,

45
00:02:31,674 --> 00:02:34,148
but only if you actually stay in that
lane.

46
00:02:34,148 --> 00:02:36,776
If you're constantly changing tasks,

47
00:02:36,776 --> 00:02:41,169
or nuking your context,
or bouncing between unrelated prompts,

48
00:02:41,169 --> 00:02:45,224
then a longer TTL can be a bit like
buying a big esky for one can of

49
00:02:45,224 --> 00:02:45,634
drink.

50
00:02:45,634 --> 00:02:52,461
Nice box, wrong day.

51
00:02:45,634 --> 00:02:52,461
The phrase I'd use is: you're choosing
between cheap-to-write

52
00:02:52,461 --> 00:02:53,938
and likely-to-reuse.

53
00:02:53,938 --> 00:02:55,453
`FORCE_PROMPT_CACHING_5M` is cheaper to
write,

54
00:02:55,453 --> 00:02:56,887
but easier to miss.

55
00:02:56,887 --> 00:02:58,883
`ENABLE_PROMPT_CACHING_1H` is more
expensive to write,

56
00:02:58,883 --> 00:03:03,130
but way more forgiving if your session
has human pauses in it.

57
00:03:03,130 --> 00:03:04,988
And humans are mostly pauses, mate.

58
00:03:04,988 --> 00:03:08,102
That's the bit product people sometimes
forget.

59
00:03:08,102 --> 00:03:10,659
We don't work like a benchmark script.

60
00:03:10,659 --> 00:03:12,095
We get interrupted.

61
00:03:12,095 --> 00:03:13,927
We forget what file we were in.

62
00:03:13,927 --> 00:03:15,445
We make tea.

63
00:03:15,445 --> 00:03:18,636
So this release is really saying: okay,

64
00:03:18,636 --> 00:03:21,742
let's let the cache behave more like an
actual work session,

65
00:03:21,742 --> 00:03:24,515
not a stopwatch.

66
00:03:21,742 --> 00:03:24,515
And if you're hearing this and wondering,

67
00:03:24,515 --> 00:03:28,157
"Why did my session get expensive?" --
five minutes is the number to

68
00:03:28,157 --> 00:03:28,861
remember.

69
00:03:28,861 --> 00:03:29,661
`FORCE_PROMPT_CACHING_5M`.

70
00:03:29,661 --> 00:03:33,184
That's the token that explains a lot of
mystery invoices.The

71
00:03:33,184 --> 00:03:36,306
other big thing in 2.

72
00:03:33,184 --> 00:03:36,306
1.108 is scope.

73
00:03:36,306 --> 00:03:42,176
`ENABLE_PROMPT_CACHING_1H=1` now works
across API key usage,

74
00:03:42,176 --> 00:03:46,009
AWS Bedrock, Google Vertex,
and Anthropic Foundry.

75
00:03:46,009 --> 00:03:50,612
That matters because the old story was
way narrower -- the one-hour setting

76
00:03:50,612 --> 00:03:55,775
used to be Bedrock-specific in practice.

77
00:03:50,612 --> 00:03:55,775
So the name to lock in now is

78
00:03:55,775 --> 00:04:00,229
the provider-agnostic one:
`ENABLE_PROMPT_CACHING_1H=1`.

79
00:04:00,229 --> 00:04:05,139
Not just for Bedrock, not some special
corner case -- one switch across

80
00:04:05,139 --> 00:04:06,295
the main setups.

81
00:04:06,295 --> 00:04:07,335
That's tidy.

82
00:04:07,335 --> 00:04:08,455
I like tidy.

83
00:04:08,455 --> 00:04:13,014
My shed is not tidy, but my env vars...

84
00:04:13,014 --> 00:04:15,791
ideally, yes.Same.

85
00:04:15,791 --> 00:04:20,665
And then there's the opposite switch:
`FORCE_PROMPT_CACHING_5M=1`.

86
00:04:20,665 --> 00:04:23,860
I think of that as the "fresh eyes every
turn" mode.

87
00:04:23,860 --> 00:04:25,695
If you're iterating on prompts,

88
00:04:25,695 --> 00:04:28,802
testing behavior,
or trying to isolate a prompt bug,

89
00:04:28,802 --> 00:04:33,320
you may NOT want older context hanging
around very long.

90
00:04:28,802 --> 00:04:33,320
Yeah,

91
00:04:33,320 --> 00:04:34,360
that's a different job.

92
00:04:34,360 --> 00:04:38,811
In a real coding session, I want the
model to remember the repo context

93
00:04:38,811 --> 00:04:41,068
for ages -- or, well, an hour.

94
00:04:41,068 --> 00:04:45,690
But if I'm diagnosing why a prompt
template is behaving weirdly,

95
00:04:45,690 --> 00:04:47,526
short TTL can be a blessing.

96
00:04:47,526 --> 00:04:52,342
Otherwise you're sort of chasing a bug
through old leftovers.

97
00:04:47,526 --> 00:04:52,342
Let me try

98
00:04:52,342 --> 00:04:54,232
to explain it back.

99
00:04:54,232 --> 00:05:01,332
Long-lived cache for "help me
keep working on this feature."

100
00:05:01,332 --> 00:05:09,882
Short-lived cache for "I need to know
whether THIS prompt change caused THIS

101
00:05:01,332 --> 00:05:09,882
behavior."

102
00:05:09,882 --> 00:05:14,638
Is that basically it?

103
00:05:09,882 --> 00:05:14,638
Almost -- the part I'd sharpen is
intention.

104
00:05:14,638 --> 00:05:19,586
`ENABLE_PROMPT_CACHING_1H=1` is for
continuity.

105
00:05:19,586 --> 00:05:24,861
`FORCE_PROMPT_CACHING_5M=1` is for
controlled turnover.

106
00:05:24,861 --> 00:05:29,816
One says, "please keep this mental
workspace warm." The other says,

107
00:05:29,816 --> 00:05:34,400
"clear the bench quickly so I can observe
changes."That's good.

108
00:05:34,400 --> 00:05:35,434
Controlled turnover.

109
00:05:35,434 --> 00:05:37,744
And for backward compatibility,

110
00:05:37,744 --> 00:05:41,890
the older
`ENABLE_PROMPT_CACHING_1H_BEDROCK` still

111
00:05:37,744 --> 00:05:41,890
works.

112
00:05:41,890 --> 00:05:45,558
So if somebody has existing Bedrock
scripts or team docs,

113
00:05:45,558 --> 00:05:50,311
this release doesn't blow them up.

114
00:05:45,558 --> 00:05:50,311
But it is nudging people to migrate.

115
00:05:50,311 --> 00:05:53,026
For consistency, really.

116
00:05:53,026 --> 00:05:55,340
If you've got one team on Bedrock,

117
00:05:55,340 --> 00:05:58,694
another on Vertex,
another just using API keys,

118
00:05:58,694 --> 00:06:02,644
having everybody learn
`ENABLE_PROMPT_CACHING_1H` is cleaner

119
00:05:58,694 --> 00:06:02,644
than dragging

120
00:06:02,644 --> 00:06:06,061
around the old `_BEDROCK` tail
forever.I actually like that

121
00:06:06,061 --> 00:06:08,504
this maps to two very human moods.

122
00:06:08,504 --> 00:06:14,495
Mood one: "I'm deep in the code,
don't make me restate the world." Mood

123
00:06:14,495 --> 00:06:19,649
two: "Something is fishy, strip this down
and let me test it clean." Same

124
00:06:19,649 --> 00:06:24,486
feature family,
totally different purpose.

125
00:06:19,649 --> 00:06:24,486
And that's why these env vars

126
00:06:24,486 --> 00:06:26,356
aren't just knobs for infra nerds.

127
00:06:26,356 --> 00:06:27,951
They're workflow choices.

128
00:06:27,951 --> 00:06:29,783
If you're heads-down shipping,

129
00:06:29,783 --> 00:06:31,141
choose the one-hour path.

130
00:06:31,141 --> 00:06:34,168
If you're poking at prompt behavior with
a stick,

131
00:06:34,168 --> 00:06:35,685
choose the five-minute one.

132
00:06:35,685 --> 00:06:39,834
Wrong tool, wrong job -- and suddenly the
session feels haunted.
