1
00:00:00,159 --> 00:00:04,179
You run a headless CI pipeline or wrap up
a long terminal session,

2
00:00:04,699 --> 00:00:06,879
everything reports zero errors, but...

3
00:00:07,639 --> 00:00:10,319
wait, where did the audit logs go?

4
00:00:10,836 --> 00:00:13,676
Yeah, or the transcript upload just
completely vanishes.

5
00:00:14,236 --> 00:00:18,717
Everything looks like a clean exit on the
surface, but your post session cleanup got

6
00:00:18,797 --> 00:00:20,377
quietly murdered in the background.

7
00:00:20,417 --> 00:00:24,897
Brought to you by Jellypod AI, today we
are digging into a silent killer in Claude

8
00:00:24,961 --> 00:00:29,217
Code sessions that drove me absolutely up
the wall in my shed last week.

9
00:00:29,250 --> 00:00:31,810
So what was actually happening under the
hood?

10
00:00:31,880 --> 00:00:34,370
Because people were setting the
environment variable

11
00:00:34,477 --> 00:00:39,650
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS
expecting it to give their heavy cleanup

12
00:00:39,730 --> 00:00:40,370
scripts extra time, right?

13
00:00:40,375 --> 00:00:41,015
Spot on.

14
00:00:41,195 --> 00:00:46,855
But due to a bug, if your individual
SessionEnd hook did not have an explicit per

15
00:00:46,919 --> 00:00:52,215
hook timeout property written right inside
its config, Claude Code just ignored that

16
00:00:52,262 --> 00:00:57,735
environment variable entirely and hard
killed the script after a strict 1.5 seconds.

17
00:00:57,750 --> 00:00:59,510
One point five seconds!

18
00:00:59,606 --> 00:01:03,910
That is barely enough time to spawn a node
process, let alone compress a multi

19
00:01:03,970 --> 00:01:07,350
megabyte log file or sweep an entire git
worktree.

20
00:01:07,375 --> 00:01:09,295
It is ridiculously tight!

21
00:01:09,735 --> 00:01:14,255
I had a custom bash script designed to
sync local session telemetry and compress my

22
00:01:14,308 --> 00:01:15,135
build logs.

23
00:01:15,322 --> 00:01:19,535
It kept getting yanked mid write, leaving
me with corrupted files or missing

24
00:01:19,605 --> 00:01:22,495
uploads, and no error message saying why.

25
00:01:22,599 --> 00:01:24,859
But the latest patch finally fixes this.

26
00:01:25,639 --> 00:01:29,119
Now, setting
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS properly overrides that default

27
00:01:29,299 --> 00:01:34,899
1.5 second limit for all SessionEnd
lifecycle hooks that lack an explicit per hook

28
00:01:34,960 --> 00:01:35,420
timeout.

29
00:01:35,542 --> 00:01:41,418
So if you stick
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS=10000 into your GitHub

30
00:01:41,480 --> 00:01:46,678
Actions workflow or your local shell
profile, your teardown script gets a full ten

31
00:01:46,742 --> 00:01:47,462
seconds to wrap up cleanly.

32
00:01:47,500 --> 00:01:49,900
Though there is an operational caveat
here.

33
00:01:50,080 --> 00:01:53,900
You still want to be careful setting
massive global timeouts.

34
00:01:54,060 --> 00:01:58,460
If a teardown script hangs because of a
deadlock or a broken network socket,

35
00:01:58,492 --> 00:02:01,020
your terminal exit is going to sit there
hanging too.

36
00:02:01,182 --> 00:02:05,041
Yeah, nobody wants to hit exit and wait
thirty seconds for their prompt to return!

37
00:02:05,561 --> 00:02:09,762
So best practice is still setting specific
per hook timeouts where you can,

38
00:02:10,342 --> 00:02:14,701
and using the global env var as a reliable
baseline cap for the team.

39
00:02:14,917 --> 00:02:15,557
Exactly.

40
00:02:15,610 --> 00:02:19,637
In our dev containers, we established a
team wide ten second cap using that

41
00:02:19,670 --> 00:02:20,597
environment variable.

42
00:02:20,757 --> 00:02:24,677
It gives telemetry scripts enough runway
to finish uploading without letting runaway

43
00:02:24,749 --> 00:02:27,157
processes hijack the developer's shell.

44
00:02:27,167 --> 00:02:30,687
While we are on the topic of observability
and infrastructure updates in this

45
00:02:30,737 --> 00:02:34,447
release, there are two other big additions
worth bumping into your stack.

46
00:02:34,458 --> 00:02:39,338
Right, if you run enterprise gateways,
setting pricing: inside your gateway.yaml

47
00:02:39,402 --> 00:02:44,218
file now syncs managed settings directly
to signed in Claude Code clients.

48
00:02:44,298 --> 00:02:48,698
That means your /cost command and spend
meters actually match up with central

49
00:02:48,748 --> 00:02:49,578
gateway rates.

50
00:02:49,583 --> 00:02:54,063
And for direct telemetry monitoring, you
can now pipe OpenTelemetry trace data

51
00:02:54,107 --> 00:02:58,943
straight out by setting
OTEL_EXPORTER_OTLP_ENDPOINT directly in your environment.

52
00:02:58,958 --> 00:03:02,798
Which means no more lost log uploads,
accurate billing rates,

53
00:03:02,838 --> 00:03:05,598
and actual traces for your AI tooling
pipelines.

54
00:03:05,765 --> 00:03:10,784
Check your session hooks today, raise that
timeout, and stop losing your audit logs

55
00:03:10,824 --> 00:03:13,524
to the 1.5 second execution cliff.

