[BUG] claude -r crashes with "UKH is not a function" on session resume

Resolved 💬 2 comments Opened Apr 25, 2026 by Nicu106 Closed Apr 27, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

ERROR UKH is not a function. (In 'UKH(K)', 'UKH' is undefined)

/$bunfs/root/src/entrypoints/cli.js:9247:5663

9244: ${K.join(`

9245:

9246 )}}var $v5,sv4=1000,qv5=300,Kv5=5000;var FC6=T(()=>{L$();V$();Tp();zb();av4();$$();oN();$v5=(NmH(),S6(kmH))});var KV4={};X$(KV4,{useScheduledTasks:()=>Av5});function

: Av5({isLoading:H,assistantMode:$,setMessages:q}){let K=QD8.useRef(H);K.current=H;let _=B9(),A=F6(),z=Ww();QD8.useEffect(()=>{if(!TZ()||R6())return;let

f=(M)=>Ez({value:_v5.resolveLoopDefaultFire(M),mode:"prompt",priority:"later",isMeta:!0,workload:SSH}),Y=void 0,O=BC6({onFire:f,onFireTask:(M)=>{if(M.agentId){let

w=dr(M.agentId,_.getState().tasks);if(w&&!sI(w.status)){fmH(w.id,M.prompt,z);return}E(`[ScheduledTasks] teammate ${M.agentId} gone, removing orphaned cron

${M.id}),l$H([M.id]);return}let D=WB7(M.kind==="loop"?Claude resuming /loop wakeup (${qV4(new Date)}):Running scheduled task (${qV4(new
Date)})`);q((w)=>[...w,D]),f(M.pro
mpt)},isLoading:()=>K.current,assistantMode:$,getJitterConfig:t5H,isKilled:()=>!TZ(),getExtraTasks:$V4&&Y?()=>$V4.getRoutineCronTasks(Z_(),Y):void 0});return

O.start(),()=>{O.stop()}},[$,q,_.getState,z])}function qV4(H){return H.toLocaleString("en-US",{month:"short",day:"nume
──── (153 lines hidden) ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
ser"));yY([]),f4?.abort("user-cancel")}else if(_J.isRemoteMode)_J.cancelRequest();else
f4?.abort("user-cancel");pA(null),vvH(f5.current,!0)}let AL$=s$.useCallback(()=>{let
j$=vc$(M7.current,0);if(!j$)return;if(G_(j$.text),nM("prompt"),j$.images.length>0)DL((r$)=>{let _8={...r$};for(let Hq of j$.images)_8[Hq.id]=Hq;return

_8})},[G_,nM,DL]),zL$={setToolUseConfirmQueue:GK,onCancel:IvH,getConnectionSummary:()=>SD.current?.summary(),onAgentsKilled:()=>F7((j$)=>[...j$,ZB7()]),isMessageSelectorVisib

le:gs||!!Uc,screen:f$,abortSignal:f4?.signal,isExternalLoading:A5,popCommandFromQueue:AL$,isLocalJSXCommand:P8?.isLocalJSXCommand,isInputOverlayActive:E$,inputMode:ff,isInput
Empty:i9};s$.useEffect(()=>{if(h)return;if(LL()>=5&&!ds&&!Fc){if(d("tengu_cost_threshold_reached",{}),AJ(!0),YS$())pKH(!0)}},[S9,ds,Fc]);let
hw8=s$.useCallback(async(j$)=>{let
r$=DH.getState(),{mode:_8,isBypassPermissionsModeAvailable:Hq}=r$.toolPermissionContext;switch(GV$(_8,Hq)){case"allow":return!0;case"deny":return!1;case"classify":return
C68(j$.host,j$.port,f5.current,X6.current,r$.toolPermissionContext,new AbortController().signal);case"ask":break}if(yK()&&R_$()){let OK=vQK(),qK=await
VQK(j$.host,OK);return
new
Promise((lK)=>{if(!qK){BA(($q)=>[...$q,{hostPattern:j$,resolvePromise:lK}]);return}EQK({requestId:OK,host:j$.host,resolve:lK}),e(($q)=>({...$q,pendingSandboxRequest:{requ
estId:OK,host:j$.host}}))})}return new Promise((OK)=>{let qK=!1;function lK($q){if(qK)return;qK=!0,OK($q)}BA(($q)=>[...$q,{hostPattern:j$,resolvePromise:lK}]);{let
$q=DH.getState().replBridgePermissionCallbacks;if($q){let Y7=mOH.randomUUID();$q.sendRequest(Y7,yD8,{host:j$.host},mOH.randomUUID(),Allow network connection to
${j$.host}?
);let U1=$q.onResponse(Y7,(Lz)=>{U1();let _O=Lz.behavior==="allow";BA((Fw)=>{return
Fw.filter((Uw)=>Uw.hostPattern.host===j$.host).forEach((Uw)=>Uw.resolvePromise(_O)),Fw.filter((Uw)=>Uw.hostPattern.host!==j$.host)});let
NG=pw.current.get(j$.host);if(NG){for(let Fw of
NG)Fw();pw.current.delete(j$.host)}}),iM=()=>{U1(),$q.cancelRequest(Y7)},R9=pw.current.get(j$.host)??[];R9.push(iM),pw.current
.set(j$.host,R9)}}})},[e,DH]);if(s$.useEffect(()=>{let j$=E6.getSandboxUnavailableReason();if(!j$)return;if(E6.isSandboxRequired()){process.stderr.write(
9248: Error: sandbox required but unavailable: ${j$}
9249:
+` sandbox.failIfUnavailable is set \u2014 refusing to start without a working sandbox.
9250:

What Should Happen?

● What should happen:

When you run claude -r, the CLI should:

  1. Show a picker of previous sessions (or resume the last one directly).
  2. Load historical messages (initialMessages) from the JSONL transcript.
  3. Restore session context: working directory, agent type, file history, tool state.
  4. Call onSessionRestored(messages) to notify dependent subsystems (remote bridge, telemetry, dedup state) that the session has been rehydrated.
  5. Drop you at the prompt with the transcript visible, ready to continue the conversation.

What happens instead: step 4 crashes because onSessionRestored is undefined — the RW4 hook only returns that callback when enabled=true, but the flag is hardcoded to false, so
the process dies before reaching the prompt.

Expected fix: either RW4 should return a no-op stub when disabled, or the call site should guard with optional chaining: onSessionRestored?.(K).

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Have at least one prior Claude Code session recorded for the current project (i.e. a JSONL transcript exists under ~/.claude/projects/<project-slug>/).
  2. From the project directory, run:

```bash
claude -r --dangerously-skip-permissions
(The --dangerously-skip-permissions flag is not required to trigger the bug — claude -r alone reproduces it.)

  1. Select any previous session from the resume picker (or let it auto-pick if only one exists).

Expected: The CLI loads the transcript and drops me at the prompt, ready to continue the session.

Actual: The process crashes immediately with:

ERROR UKH is not a function. (In 'UKH(K)', 'UKH' is undefined)

/$bunfs/root/src/entrypoints/cli.js:9247:5663

Environment

  • OS: Linux 6.8.0-101-generic (Ubuntu)
  • Shell: bash
  • Claude Code version: <run claude --version and paste here>
  • Install method: <npm global / bun / other>

Notes

  • Reproduces on every claude -r invocation, regardless of which session is selected.
  • Workaround: launch a fresh session with claude (no -r) and use the in-session /resume slash command — that path works.
  • Root cause appears to be in the REPL hook RW4({ enabled: I, ... }) at cli.js ~line 9247: I is hardcoded false via useMemo(() => false, []), so the destructured

onSessionRestored callback is undefined. The resume code path then calls it unconditionally as UKH(K) after rehydrating initialMessages, throwing the TypeError.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.119

Claude Code Version

2.1.119

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗